OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Knut Erik on 11 Apr 2003, 17:11:32

Title: Tank burn help...
Post by: Knut Erik on 11 Apr 2003, 17:11:32
After I downloaded the "drop untily" I finaly learned about the drop command. (Thanks a lot to uiox !  ;D "

I decided to make my own little "tank burning script". However i can't get it to work properly.
When the unit dies, the script runs for a milisecond and then exits  >:( so i only get to see the first drops. I want to make the script run for x seconds.

When i "setdammage 1" a unit, the script runns in x seconds.
Here is the script :


Code: [Select]
_tank = _this select 0

@ not canmove _tank and not canfire _tank || not alive _tank
   ~3
#loop

Due to the big space the drop commands take, i decided NOT to put them here. I'm sure they're correct.

~0.3
? _time < 60: goto "loop"
_tank setdammage 1

Does anybody have a clue about what is wrong here.
(I have [this] exec "tankburn.sqs" in every init field of the tanks.

Phew  :-[
Title: Re:Tank burn help...
Post by: macguba on 11 Apr 2003, 17:19:01
_time measures the time since the script started running.   The script is called at the start of the mission.    So if the mission has been running for more than a minute the loop will never happen.

Replace _time with a counter, so that it counts the iterations of the loop.

If you're using "@" for every tank in the mission, watch out for lag.    Since there is a 3s gap between the tank being zapped and starting the drops, you might want to consider a loop (say 0.5s, the same as triggers) instead.


Aside:   I was only able to answer this because the tiny detail
Quote
(I have [this] exec "tankburn.sqs" in every init field of the tanks.

which just goes to show how important it is to tell us everything about the problem.    Assuming I'm right. [/i]:P
Title: Re:Tank burn help...
Post by: Knut Erik on 11 Apr 2003, 17:49:53
erm.. I'm not so very sure about what a "Counter"  ??? :-[

Can you please explain  :P
Title: Re:Tank burn help...
Post by: macguba on 11 Apr 2003, 17:56:58
Knut Erik, never be embarrassed about a follow up question, or if you're not sure about something in the original answer.

I can reply most easily with an example.   Ask again if its not clear.


_tank = _this select 0

_counter=0

@ not canmove _tank and not canfire _tank || not alive _tank
   ~3
#loop

Due to the big space the drop commands take, i decided NOT to put them here. I'm sure they're correct.

~0.3

_counter=_counter+1
? _counter>180: goto "loop"


_tank setdammage 1
exit

Title: Re:Tank burn help...
Post by: Ace on 11 Apr 2003, 21:32:25
http://www.ofpec.com/yabbse/index.php?board=8;action=display;threadid=7532

is a ready done script for burning tanks. I don't need to tell yu how to use it because you know drop so you what to edit to make it last longer or shorter bla bla
Title: Re:Tank burn help...
Post by: Knut Erik on 11 Apr 2003, 22:55:10
Thanks for the advice, Ace. I'll check it out...

And MacGuba. Onse again you have proven that u are the best  8)
I got the script to wooork!!

Topic solved and locked !
Topic solved and locked !
Topic solved and locked !
Topic solved and locked !
Topic solved and locked !
Topic solved and locked !
Topic solved and locked !