OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Captain Crunch on 23 May 2003, 23:33:56
-
Hi everyone! :D
I'm trying to build a very small and simple script that will SetDammage anything that comes close to it. Very useful for fires or just to annoy the others!! ;D
I've placed a GameLogic with in it's Init field [This] Exec "Dammage.sqs"
And the script looks like this:
_Obj = _This Select 0
#Loop
? (_Obj Distance Logic1 < 10) : _Obj SetDammage 1
goto "Loop"
And it does not work! Any idea why? BTW, if I change "_Obj" for the name of the player that walks or drives close to "Logic1", then it works. How could I make ANY units or vehicles or objects get the dammage when they get close to the Logic?
And even better, how could I make the "SetDammage" command to set only a few dammage to the object every 1 second for example? I tried this but it doesn't work:
_Obj = _This Select 0
#Loop
? (_Obj Distance Logic1 < 10) : _Obj SetDammage 0.2
~1
goto "Loop"
Any ideas?
Many Thanx in advance!
:D
-
Create a trigger, centered on the danger spot (you don't need the gamelogic) with size as you like - say 10x10.
Activation box: Anybody present repeatedly
On activation: "_x setdammage 1" forEach units thislist
syntax not guaranteed. Alternatively, add a countdown of 1 second (write 1 in each box) and have this
On activation: "_x setdammage ((getdammage _x)+0.1)" forEach units thislist
Again, you may have to play with the syntax.
-
Hmm. I get an error message:
Error Type Array, Expected Object, Group
Do You know where I could find the right syntax?
-
It might be forEach thislist, I can never remember.
-
Yes, thats ForEach ThisList.
Your first works fine: On activation: "_x setdammage 1" forEach thislist
But the second doesn't:
"_x setdammage ((getdammage _x)+0.1)" forEach thislist
It would be a great deal to get it working. (please ;D) That the object gets a bit dammage every second or so when in the danger area.
I first wanted to use a gamelogic cos the fire will start on a vehicle that was MOVING! So with a trigger it would be imposible. I'm going to try to switch and mix this into a script! :D