OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: dmakatra on 04 Feb 2003, 17:23:31
-
Hi! I have a tank, and I want to camcreate bombs untill heÂ's dead. Over and over again. I want it to be included in a script. Plz help.
Thx in advance.
-
you need a wee looping script.
#loop
camcreate bomb etc
~0.2
? getDammage tank1=1:goto "End"
goto "loop"
#End
exit
Syntax guaranteed to be hopelessly wrong, but I hope you get the gist. You may want to include a random element in the postitioning so that the bombs explode around the vehicle, rather than all in exactly the same place. (I have a feeling somebody made a script about that ... have a look in the Ed Depot) I'm assuming you know how to camcreate.
It is vital that in every looping script that you have a time delay, otherwise Bad Things happen to the game.
-
ok, IÂ'll try that out, be back in a sec.
-
funny things happen >:(. I said I wanted to camcreate a bomb cause IÂ'm not sure everyone knows how to camcreate a bullet, so I changed tank1 to aguy, the name of the dying soldiers and a white text appears says that the operator is unknown. Whats wrong?
Oh, and I deleted the "exit" cause I didnÂ't want the script to exit there, is it that?
-
exit will make the script end yes, so if you want it to do something else in the same script delete the exit by all means.
unknown operator basically means that you are giving the script an instruction it doesn't understand. check the command reference and make sure you have the syntax and spelling correct for every command - I always have to check everything, which is why I don't pretend I can remember it .......
you might need == rather than =
if you're quick, the white text at the top of the screen sometimes gives you clues as to what part is going wrong.
the basic principle in debugging a script is to break it down into seperate parts an see if you can make each part work. for example, can you camcreate one bomb?
-
I know that the part with the name is guilty, now IÂ've to check out why...
thx :D
-
Ok, I checked an old topic I posted some time ago, IÂ'm gonna change the guilty topic to:
? !(alive aguy) goto "end"
-
The good news is that the white text gone.
The bad news is that the script wont proceed.
-
Yippie! I added a little ":" between "aguy)" and "goto". Now all I have to do is terminate the cam to complete the intro! It is sooooooo cool, even my brother who hates OFP thinks that. Ok, perhaps not that cool. ;D
This scripting I have started with is quite fun ;D! ItÂ's kinda har though :'((thereÂ's no turtorials! SnYpir, get yer ass up here and do one! ;D).
*TOPIC SOLVED AND LOCKED*