Home   Help Search Login Register  

Author Topic: targets to continue popping up.  (Read 2090 times)

0 Members and 1 Guest are viewing this topic.

Offline 22jacket

  • Members
  • *
  • I'm a llama!
targets to continue popping up.
« on: 06 Aug 2005, 17:59:10 »
Hi, Can u help, I can get targets on a  target range to lay down then once the trigger is activated they pop up..and then stay down....Is there a way of the target popping back up say when it is shot ..then 20 secs later pops back up again and continues to pop back up every time it is shot down..
ie...target shot..goes down...20 secs etc pops back up..target shot again..goes down ..20 secs pops up again..so on and so on..
cheers..

Offline 456820

  • Contributing Member
  • **
Re:targets to continue popping up.
« Reply #1 on: 06 Aug 2005, 20:21:51 »
yep create a trigger name the target what you likef or my example its target1
now set the trigger to 0x and 0y then set it to repeatedly in the condition field its
either
!alive target 1
or
getdammage target1 == 0

then onactivation field put
target1 setdammage 1

also in the countdown time in the min, max and medium box put 20 to get it to pop up every 20 seconds

also thats not 100% guranteed but im pretty sure it will work

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:targets to continue popping up.
« Reply #2 on: 06 Aug 2005, 23:38:10 »
your getdammage and setdammage are backwards

that will kill it when its at full health...

switch the numbers around (target setdammage 0)

Offline 22jacket

  • Members
  • *
  • I'm a llama!
Re:targets to continue popping up.
« Reply #3 on: 07 Aug 2005, 02:28:21 »
tried it but it does not pop back up..

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:targets to continue popping up.
« Reply #4 on: 08 Aug 2005, 09:40:13 »
try adding a 'killed' event handler to the target. once it's 'dead', the event handler ressurects it, by using the old setdamage 0. not guaranteed, because once a unit is dead, it 'disappears' from flashpoint if you don't catch it quickly enough. i suspect that's why the previous method won't work.

edit - just had a wee play around with this idea - see attached.

« Last Edit: 08 Aug 2005, 10:11:29 by bedges »

Offline 22jacket

  • Members
  • *
  • I'm a llama!
Re:targets to continue popping up.
« Reply #5 on: 09 Aug 2005, 17:36:38 »
yo dude,

It works well except for when I shoot the target it pops up in a diffreent direction...ie back to front...also I want to use a target callede Fig 11 Target how could i edit it so I could use it..

Offline 22jacket

  • Members
  • *
  • I'm a llama!
Re:targets to continue popping up.
« Reply #6 on: 09 Aug 2005, 17:38:20 »
also how can i extend the time..is it edited by putting in a higher figure at 0.9

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:targets to continue popping up.
« Reply #7 on: 09 Aug 2005, 18:48:08 »
mkay, this is the script as it stands

Code: [Select]
;pop up targets

_targ = _this select 0
_x = getpos _targ select 0
_y = getpos _targ select 1

~5
deletevehicle _targ

_newtarg = "target" camcreate [_x, _y, 0.9]
_newtarg addeventhandler ["killed",{_this exec "popup.sqs"}]

exit

the first bit (before the ~5) finds out where the target is. so if you add

Code: [Select]
_dir = getdir _targ
that will find out what direction the target is facing.

then comes the pause, the ~5 bit, which waits for five seconds. if you want it to wait 20 seconds, put

Code: [Select]
~20
then comes the bit where the old target is deleted and the new target is placed. the 0.9 you mentioned is the height. you'd expect it to be 0, but camcreate buries stuff for some reason. once the new target is created you want to turn it to the same direction as the old one, so put

Code: [Select]
_newtarg setdir _dir
there. problem solved and some programming practice all in one. OFPEC - it's all good :)
« Last Edit: 09 Aug 2005, 18:48:51 by bedges »

DoDgY

  • Guest
Re:targets to continue popping up.
« Reply #8 on: 09 Aug 2005, 19:58:11 »
Quote
OFPEC - it's all good

Hehe- that should be your slogan. ;)

Offline 22jacket

  • Members
  • *
  • I'm a llama!
Re:targets to continue popping up.
« Reply #9 on: 11 Aug 2005, 10:24:43 »
hello again,
the targets are popping up like popcorn..lol but just a few niggles
1.when targets are set at 180 degrees on the azimut targets pop up properly but any other setting 0 degrees etc target pops up but at a diffrent angle so the targets face the opposite direction...
2.I use the british fig 11 targets ..when i first shoot them they go down but when they come back up it turns in to a target e(blue) one..is there anyway that the same fig11 target can return after being shot down...

sorry to be a pain..but its almost there ...lol
many thanks
jacket

Offline 456820

  • Contributing Member
  • **
Re:targets to continue popping up.
« Reply #10 on: 11 Aug 2005, 11:21:42 »
how about for the first one this

_dirt = getdir target_name

target_name setdir _dirt + 180
_dirt = getdir target_name

that should work, if its right it should get the direction of the target then add 180 to it to spin it around to face the right way
just put that after youve got it to pop back up

not sure about question 2 though

hope it helps (alsoif you mean by the target will pop up any random direction ?or is it always backwards ?)

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:targets to continue popping up.
« Reply #11 on: 12 Aug 2005, 03:26:25 »
_targ = _this select 0
_x = getpos _targ select 0
_y = getpos _targ select 1
_type = typeof _targ

~5
deletevehicle _targ

_newtarg = _type camcreate [_x, _y, 0.9]
_newtarg addeventhandler ["killed",{_this exec "popup.sqs"}]

exit

that will work for any type of target/ anything really

Offline 22jacket

  • Members
  • *
  • I'm a llama!
Re:targets to continue popping up.
« Reply #12 on: 12 Aug 2005, 23:57:50 »
excellent thanks...only one thing left..lol  
first round of shooting targets fall after 3 shoots..but after that it takes 10 shots to fall again..is there anyway i can just have 3 shoots all the time to make target falll..

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:targets to continue popping up.
« Reply #13 on: 13 Aug 2005, 04:45:04 »
can't think of why thats happening, unless its just that the new targets aren't registering in ofp until a few seconds later?

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:targets to continue popping up.
« Reply #14 on: 13 Aug 2005, 09:30:00 »
Would setDammage 0.7 help?