Jump to content
Sign in to follow this  
MrWho

DeBug script help PLEASE!!!!

Recommended Posts

I'm so close to getting this to work!!! Can someone please help me over this hump? help.gif

I can get this script to work, but on one object only. If I have two targets it only works on one. I need to use this on about 30 pop-ups.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

this addeventhandler ["hit",{[this,120] exec "downed.sqs"}]

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

~.5

?_target animationPhase "terc" > 0: goto "end"

_target= _this select 0

_timedelay = _this select 1

_i = 0

_timeto = _timedelay * 10

;_target setdammage 0

#loop

_i = _i + 1

_target animate["terc",1]

? (_i == _timeto) : goto "end"

~.01

;hint format [" i= %1 timeto = %2", _i,_timeto]

goto "loop"

#end

_target animate["terc",0]

this addeventhandler ["hit",{[this,120] exec "downed.sqs"}]

Pop up delay demo

notworthy.gifnotworthy.gifnotworthy.gifnotworthy.gifnotworthy.gif

Share this post


Link to post
Share on other sites

this addeventhandler ["hit",{[_this,120] exec "downed.sqs"}]

Share this post


Link to post
Share on other sites

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">this addeventhandler ["hit",{[this,120] exec "downed.sqs"}] is ok here.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">this addeventhandler ["hit",{[_this,120] exec "downed.sqs"}]is also possible,

but then U need to change your script:

_target= _this select 0 will return the whole EH hit default array (Who is hit,who did it,damage value)

U need:_target= (_this select 0)select 0

Just a question Mr.Who:U added the EH in each initfield of each popup target?

Share this post


Link to post
Share on other sites

Platoon_Patton and mr.Flea, Thanks for your reply.   notworthy.gif

YEs, I added <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> this addeventhandler ["hit",{[this,120] exec "downed.sqs"}]

 To each pop-up.  I will try your suggestion of <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">this addeventhandler ["hit",{[_this,120] exec "downed.sqs"}]

If I understand your other suggestions, the downed.sqs should look like this?  The third line was changed to your suggestion??

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

~.5

?_target animationPhase "terc" > 0: goto "end"

_target= (_this select 0)select 0

_timedelay = _this select 1

_i = 0

_timeto = _timedelay * 10

;_target setdammage 0

#loop

_i = _i + 1

_target animate["terc",1]

? (_i == _timeto) : goto "end"

~.01

;hint format [" i= %1  timeto = %2", _i,_timeto]

goto "loop"

#end

_target animate["terc",0]

this addeventhandler ["hit",{[this,120] exec "downed.sqs"}]

Share this post


Link to post
Share on other sites

Thanks to you both.  You were correct and everything is work on all pop-ups!  Thanks again for your help!

yay.gif  yay.gif  yay.gif

notworthy.gif  notworthy.gif  notworthy.gif  

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×