To install it you have 2 possibilities :
First, you recreate manually the environment of the system, including custom npc configuration, scripts, etc ...
Or, the second possibility is to use the install assistant balance.bat (dezip attached "install_balance.zip").
Put the installator in the same directory of your level file, open it, write the level name (without .lvl extension, i.e. if your level file is mylevel.lvl just write "mylevel" (without quotation marks)). Then, it will create automatically all the things we need (custom npc configuration, scripts, variables ...).
Now we'll need to do some ajustments. First you need to trigger the "Fonction" script (i.e. on Level Start event).
Then in the "Fonction" script you have to write in the beginning of the script all the balances you will create, with this custom function :
Code: Select all
Call CreerBalance([x], [y], [d])
[x] stands to the X-coordinate of the platform's center block
[y] stands to the Y-coordinate
[d] stands to the length of the platform, in blocks (i. e. in the screens 5 for the left platform and 8 for the right platform).
(you can determinate x and y by activating grid then press F11)
As you can see, I make this system as modular as I could ; I also include an "API" :P
The followings informations are for users of TeaScript only :
The function CreerBalance() returns an NPC id which can be used to get and edit some balance's internal informations, as seen in these examples :
Code: Select all
val(balance) = CreerBalance(-199500, -200050, 6)
'npc(val(balance)).x : Read&Write, X-coordinate of middle of balance ; modify will move the platform
'npc(val(balance)).y : Read&Write, Y-coordinate of middle of balance ; modify will move the platform
'npc(val(balance)).ivala : Read&Write, Angle of platform (between -40 and 40) ; modify will change the angle
'npc(val(balance)).ivalb : Read-Only, Length of the platform (in blocks) ; modify will make the platform buggy, so don't do it
I hope it will be useful for you !