OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: dmakatra on 04 Feb 2003, 17:23:31

Title: bomb him untill he´s dead!
Post 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.
Title: Re:bomb him untill he´s dead!
Post by: macguba on 04 Feb 2003, 18:12:00

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.    
Title: Re:bomb him untill he´s dead!
Post by: dmakatra on 04 Feb 2003, 18:18:02
ok, IÂ'll try that out, be back in a sec.
Title: Re:bomb him untill he´s dead!
Post by: dmakatra on 04 Feb 2003, 18:24:23
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?
Title: Re:bomb him untill he´s dead!
Post by: macguba on 04 Feb 2003, 18:47:39
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?    
Title: Re:bomb him untill he´s dead!
Post by: dmakatra on 04 Feb 2003, 19:03:00
I know that the part with the name is guilty, now IÂ've to check out why...

thx :D
Title: Re:bomb him untill he´s dead!
Post by: dmakatra on 04 Feb 2003, 19:15:20
Ok, I checked an old topic I posted some time ago, IÂ'm gonna change the guilty topic to:

? !(alive aguy) goto "end"
Title: Re:bomb him untill he´s dead!
Post by: dmakatra on 04 Feb 2003, 19:19:34
The good news is that the white text gone.

The bad news is that the script wont proceed.
Title: Re:bomb him untill he´s dead!
Post by: dmakatra on 04 Feb 2003, 19:24:47
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*