MrWho 0 Posted March 7, 2007 I'm so close to getting this to work!!! Can someone please help me over this hump? 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 Share this post Link to post Share on other sites
mr.Flea 0 Posted March 7, 2007 this addeventhandler ["hit",{[_this,120] exec "downed.sqs"}] Share this post Link to post Share on other sites
Platoon_Patton 0 Posted March 7, 2007 <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
MrWho 0 Posted March 8, 2007 Platoon_Patton and mr.Flea, Thanks for your reply. Â 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
MrWho 0 Posted March 8, 2007 Thanks to you both. Â You were correct and everything is work on all pop-ups! Â Thanks again for your help! Â Â Â Â Â Share this post Link to post Share on other sites