OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: wired on 17 Jan 2004, 23:14:13

Title: Problems with script- probably simple!
Post 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......
Quote
_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!!!!!
Title: Re:Problems with script- probably simple!
Post by: Artak on 17 Jan 2004, 23:21:11
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 ;)
Title: Re:Problems with script- probably simple!
Post by: wired on 17 Jan 2004, 23:38:25
nope, didn't solve it
Title: Re:Problems with script- probably simple!
Post by: icarus_uk on 18 Jan 2004, 00:02:45
Its because you cant getdammage of a mine.

Your line;

_dammage = (getdammage _mine)

Returns an error, and so _dammage is never greater than 0.
Title: Re:Problems with script- probably simple!
Post by: wired on 18 Jan 2004, 00:05:39
so how can i tell if A mine goes bang?
Title: Re:Problems with script- probably simple!
Post by: icarus_uk on 18 Jan 2004, 00:09:22
I'll tell when I figure it out myself :)  Ive tried a few things now, and nothings worked.
Title: Re:Problems with script- probably simple!
Post by: icarus_uk on 18 Jan 2004, 00:23:48
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.
Title: Re:Problems with script- probably simple!
Post by: MachoMan on 18 Jan 2004, 00:26:57
how about:
Code: [Select]
? !alive _mine : bla bla
Title: Re:Problems with script- probably simple!
Post by: icarus_uk on 18 Jan 2004, 01:32:45
Oh yes, that was another one I tried.  No it didnt work.
Title: Re:Problems with script- probably simple!
Post by: deaddog on 18 Jan 2004, 04:18:01
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.
Title: Re:Problems with script- probably simple!
Post by: Unnamed on 18 Jan 2004, 09:53:31
The variable _mine will be set to null once it explodes, so IsNull(_Mine) should do the job.
Title: Re:Problems with script- probably simple!
Post by: Chris Death on 19 Jan 2004, 06:12:40
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
Title: Re:Problems with script- probably simple!
Post by: Skumball on 19 Jan 2004, 09:33:29
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
Title: Re:Problems with script- probably simple!
Post by: icarus_uk on 19 Jan 2004, 14:23:45
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.