Jump to content
Sign in to follow this  
A.J.Sawyer

Pop up targets to stay down

Recommended Posts

How can you set it so that the "Pop up target E" remains in the down position once it has been shot?

If i'm right in thinking the resurection of the target is done by an event which I have no control over.

Anyone have any ideas of how to do it?

Also if possible I wouldnt mind having the targets pop back up after a certain length of time, 5mins or something.

Thanks for any help

Share this post


Link to post
Share on other sites

So yeh, ehh...this things still bugging me. huh.gif

its pretty weird though, is the things classed as dead when you hit it thats why it goes down?

Share this post


Link to post
Share on other sites

hi

sorry i had to rush this but youre obviously struggling

i noticed that some anim was available in the ca pbo. so i adapted it for your use.

put this in the pop up target init.

<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,10] exec "downed.sqs"}]

this is well the target 10 is time before it pop up in seconds

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]

hope it helps , i am sure it is more efficient with sqf but ,its not my field smile_o.gif

Share this post


Link to post
Share on other sites

Somewhere in your mission, declare "nopop=true", and all those pop-up targets will stay down.

To set it back up again, you need to name the target (e.g. T1), and then call it with: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">T1 animate ["terc",0]

["terc",1] will put it into the downward position.

Share this post


Link to post
Share on other sites

Wow thanks for the help guys. really appreciate it.

Deano I have tried your method but it doesnt seem to work. I have the down.sqs like you have any set the initialzation to the same but the target is having none of it.

NVM- I got it working, thanks again

Share this post


Link to post
Share on other sites

you can stick it in any init .

the variable itself is hardcoded to false in the game i believe.

so where and whenever you want you can add the line you typed above

nopop = true

heres how bis use it

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

_target setdammage 0

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

_target animate["terc",1]

?nopop: goto "end"

~3

?nopop: goto "end"

?alive _target: _target animate["terc",0]

#end

exit

Share this post


Link to post
Share on other sites

I put the nopopup= true in the game logic, for some reason the it wouldnt work in trigger.

Share this post


Link to post
Share on other sites

Sorry, here is what I did. I cut and pasted the code into a text doc and saved out as downed.sqs  then added the next code into the int line of the object.  still was not able to get to work.  Any ideas?

Please help Obey 1, your my only hope. help.gif

<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 * 120

;_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]

Share this post


Link to post
Share on other sites

You don't need the script, just put nopop=true into any init field (your player's, the target's, a game logic's) and the targets will stay down.

Also, it's not "nopopup=true", but "nopop=true", so watch your spelling...

Share this post


Link to post
Share on other sites

WORKING!!!!    yay.gif  yay.gif  yay.gif

WORKING!!!!

Here is what to do to make it work:

Add this to the int line of the Popup target.  Where you see the 120, this is the delay time.  Only change this here!  Do not touch the bottom code.

<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"}]

Open word pad, and copy and paste the following code in a text document.  Then rename your text document to downed.sqs    Now place this tex document into you mission dirctory you are working on.  Done, you are all set.

<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
I need it to pop back up after 2 minutes. Can this be done?

try<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_target animate["terc",1]or<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_target animate["terc",0]

Share this post


Link to post
Share on other sites
I need it to pop back up after 2 minutes. Can this be done?

best thing to do is probably a trigger with a count down of 120seconds, then do the On act as "targetname animate["terc",0]" (or which ever one sets it in the up position).

you'd obvioustly have to have the conditions done properly but i'm not to sure how you'd go about doing that.

Share this post


Link to post
Share on other sites

WORKING!!!!    yay.gif  yay.gif  yay.gif

WORKING!!!!

Here is what to do to make it work:

Add this to the int line of the Popup target.  Where you see the 120, this is the delay time.  Only change this here!  Do not touch the bottom code.

<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"}]

Open word pad, and copy and paste the following code in a text document.  Then rename your text document to downed.sqs    Now place this tex document into you mission dirctory you are working on.  Done, you are all set.

<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"}]

Share this post


Link to post
Share on other sites

OK,

MrWho, I copied and pasted your work and couldn't get it to work.  Could it just be out dated because of the updates?  Anyone?

Kronzky,

Quote[/b] ]put nopop=true into any init field (your player's, the target's, a game logic's) and the targets will stay down.

Worked like a charm.  What is that command"nopop"?

5133p39,

I put <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">t1 animate["terc",1] in the init field of all my targets.  "t1" is the name of the target. Replace "t1" with the name of your target. On mission startup, all targets are down.

I put <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">t1 animate["terc",0] in the on activation field of trip wire, aka trigger.  Now target pops up when trigger is tripped. "t1" the name of the target you want to activate.

I put <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">nopop = truein the init field of a game logic on the map.  This keeps the targets down after they've been shot.

This all works fine.  I just have one question.

How do I increase the number of shots it takes to knock it down?

As always any and all help is appreciated.

Knight Trane

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  

×