OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: 22jacket on 06 Sep 2005, 21:34:26

Title: pop up targets nearly done...
Post by: 22jacket on 06 Sep 2005, 21:34:26
hi there
can u help...

I have fig 11 targets to pop up every 5 secs and drop down with 3 shots..
only trouble is they reset at zero degrees and go back to full health ..so say if i shoot a target which is 45 degrees  it pops back up at zero.. same as 180..the target pops up facing backwards...

i use the script below which  all the credit  goes to bedges and triggerhappy
(thanks dudes)..can anyone help on the final piece to the jigsaw..
many thanks a bald 22jacket who has pulled all his hair out..lol..


_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

Title: Re:pop up targets nearly done...
Post by: bedges on 06 Sep 2005, 22:15:10
Code: [Select]
_targ = _this select 0
_x = getpos _targ select 0
_y = getpos _targ select 1
_type = typeof _targ
_dir = getdir _targ

~5
deletevehicle _targ

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

exit
Title: Re:pop up targets nearly done...
Post by: 22jacket on 06 Sep 2005, 22:35:36
bedges ur my hero....
last thing...lol
how can i keep the health down to single shot as when they pop up again its full health....
nearly there..lol.... ;D :D
Title: Re:pop up targets nearly done...
Post by: bedges on 06 Sep 2005, 22:48:44
add

Code: [Select]
_newtarg setdamage 0.8
under the setdir command. you may need to adjust the value slightly depending on how strong a single bullet is - it may well need to be set at 0.99.
Title: Re:pop up targets nearly done...
Post by: THobson on 06 Sep 2005, 23:29:18
Reply #14 of this thread?
http://www.ofpec.com/yabbse/index.php?board=6;action=display;threadid=25021
Title: Re:pop up targets nearly done...
Post by: Planck on 06 Sep 2005, 23:38:29
It would have been better if this had been continued in the thread mentioned by THobson instead of starting a new one.

Something to remember for the future perhaps.   ;D ;D


Planck
Title: Re:pop up targets nearly done...
Post by: 22jacket on 07 Sep 2005, 00:12:45
ok..sorry about that..
just one final thing..works a treat ,,but not in multiplayer...is there a way to save it as mulitplayer...tried it on our server but did not work..
Title: Re:pop up targets nearly done...
Post by: Triggerhappy on 07 Sep 2005, 02:28:34
add a gamelogic named server to you mission, then add:
Code: [Select]
?!(local server):exitat the top of the script
i believe that should work