OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: wired on 17 Jan 2004, 23:14:13
-
Im having a problem with one of my scripts. _mine is just a normal mine. When it explodes or gets dammaged, i want it to do an effect......
_mine = _this select 0
_dammage = (getdammage _mine)
#al
~0.000001
? _dammmage >0:goto "ex1"
? _dammmage ==0:goto "al"
goto "al"
#ex1
setacctime 0.05
(then the effect here!)
but when i call the mine ( [this] exec "mine.sqs" ) it dont work!
why? i know its something in this part of the script cos it doesn't slow the time down as it shud.
HELP!!!!!
-
Check your spelling. First the BIS screwed up with the spelling of damage and made it dammage. Now you're adding even a third m and making it dammmage later in the script ;D ;)
-
nope, didn't solve it
-
Its because you cant getdammage of a mine.
Your line;
_dammage = (getdammage _mine)
Returns an error, and so _dammage is never greater than 0.
-
so how can i tell if A mine goes bang?
-
I'll tell when I figure it out myself :) Ive tried a few things now, and nothings worked.
-
Nopes, Ive tried everything I can think of;
Getdammage, doesnt work.
Fuel, doesnt work (that was more a shot in the dark)
I even tried Getpos to see if that would start a script, but even using Getpos on a mine returns errors.
I cant think of anything else, hopefully someone else will.
-
how about:
? !alive _mine : bla bla
-
Oh yes, that was another one I tried. No it didnt work.
-
Place a small trigger over the mine, size 4X4 meters.
anybody present
condition: "tank" counttype thislist > 0
activation : whatever you want
Will only activate if an armored vehicle is in the trigger. If you'll notice, a vehicle doesn't actually have to touch the mine to set it off, only get close.
-
The variable _mine will be set to null once it explodes, so IsNull(_Mine) should do the job.
-
And just for info:
the script would also not work if you could getdammage a mine.
You assign _dammage = getdammage _mine only once before
the loop starts. Therefore _dammage will never change anymore during the loop.
~S~ CD
-
As the man above says:
_mine = _this select 0
#al
_damage = (getdammage _mine)
~0.001
? _damage == 0 : goto "al"
setacctime 0.05
I modified the script slightly (spelling, delay time - think 0.001 is small enough). I couldn't say if it works so try it out :P
-
I already tried that and said why it doesnt work. Also the loop is a terrible way of doing that when you could just as easily use the @ to make the script wait.