OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: guards on 05 Oct 2007, 16:01:22
-
is it poss to have invis targets to appear and dissapear? as i want a group of enemy to engage said targets but not all the time as there ammo soon runs out
thanks again in advance
-
Just delete them when they aren't needed and recreate them again when you want the AI to shoot them again.
-
as im no ofp wizard how do i do this, as ive never did this type of editing before ?
-
Well, it really depends what exactly you are using them for and how specifically you would like them to act. Do you want them to disappear after they have been hit 10 times? 2 minutes into the mission? 10 seconds after they first get hit? Do you want them to appear for 1 second every 10 seconds? Without more details, it isn't worth making any complicated example code, but someone else might be inspired! Anyway, you'd create/recreate them using createVehicle (http://www.ofpec.com/COMREF/index.php?action=list&game=All&letter=c#createVehicle) and delete them with deleteVehicle (http://www.ofpec.com/COMREF/index.php?action=list&game=All&letter=d#deleteVehicle).
-
i could do with something that is taken away for example 2 mins into mission and the comes back again 5 mins later,
also ive just seen a demo with fox 2 invis targets but i cant find the add on to go with it, any ideals anyone
just found the fox targets, and i can now stop the target from being shot at by using setdamge,
but im still stuck on having a invis target appear, any help please
-
You said you used setDammage to stop the enemies from shooting the targets - therefore, to get them back up, use TargetName setDammage 0 (it might work...).
@ Spooner, I think those commands are for ArmA? I tried looking for OFP ones... No luck... :blink:
For some reason I'm getting a feeling this can get a bit complicated. Someone might have to edit this to get the desired effect:
"soldierWB" createUnit [getMarkerPos "barracks", groupAlpha]
Chris :)
-
that was what i thought would do it but it does not work
-
@Chris
Erm, I know I'm primarily an ArmA chap, but I do know that createVehicle and deleteVehicle work fine in OFP (though I think there is a more advanced version of createVehicle that doesn't). createUnit is for creating AI, like soldiers, so I don't think it is the right thing to create "dumb" targets. The examples (both of which I've tested with a "Jeep" in OFP Res 1.96) assume that you want the target to appear at a marker called "targetMkr" and you will need to replace "invisibleTargetClass" with the actual class name of the invisible targets that you are using.
; Create at start of mission
_target = "invisibleTargetClass" createVehicle (getMarkerPos "targetMkr")
~120
; Remove after 2 minutes.
deleteVehicle _target
~180
; Recreate at 5 minute mark.
_target = "invisibleTargetClass" createVehicle (getMarkerPos "targetMkr")
or, if you are going to be removing and replacing the objects a lot, it might be better to just move them away and back again,
; Create at start of mission
_target = "invisibleTargetClass" createVehicle (getMarkerPos "targetMkr")
~120
; Move off the map after 2 minutes.
_target setPos [0,0,0]
~180
; Move back at 5 minutes into the mission.
_target setPos (getMarkerPos "targetMkr")
-
Corret, createVehicle and deleteVehicle are OFP commands since version 1.34.
-
Mandoble pointed out to me that you might not know the class-name of the invisible targets you are using. To find this out, place one of the invisible targets in the mission editor with the init line,
hint format["%1", typeof this]
The class-name of the target will be shown in a hint when you run the mission.
-
And that class is what you should use in any createVehicle command to create these invisible targets.
-
right o i will give it a go cheers
-
Oh, my bad, lol. It's just that I never saw it in CMDREFv104 or the Command Reference (under OFP) over here.
Chris