Home   Help Search Login Register  

Author Topic: invisable targets to appear and dissapear  (Read 1811 times)

0 Members and 1 Guest are viewing this topic.

Offline guards

  • Members
  • *
invisable targets to appear and dissapear
« 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

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: invisable targets to appear and dissapear
« Reply #1 on: 05 Oct 2007, 17:25:32 »
Just delete them when they aren't needed and recreate them again when you want the AI to shoot them again.
« Last Edit: 05 Oct 2007, 17:27:50 by Spooner »
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline guards

  • Members
  • *
Re: invisable targets to appear and dissapear
« Reply #2 on: 05 Oct 2007, 19:27:16 »
as im no ofp wizard how do i do this, as ive never  did this type of editing before ?

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: invisable targets to appear and dissapear
« Reply #3 on: 05 Oct 2007, 19:44:14 »
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 and delete them with deleteVehicle.
« Last Edit: 05 Oct 2007, 19:46:20 by Spooner »
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline guards

  • Members
  • *
Re: invisable targets to appear and dissapear
« Reply #4 on: 05 Oct 2007, 20:16:38 »
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
« Last Edit: 05 Oct 2007, 21:52:35 by guards »

Offline Chrispy

  • Members
  • *
  • You never saw me! ;)
    • Delta Zero
Re: invisable targets to appear and dissapear
« Reply #5 on: 06 Oct 2007, 04:28:18 »
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 :)
Need proof-reading for anything? Need a banner for your upcoming mod? Need a pic for your mission? Hit me up with a message. I have a bit of knowledge in Photoshop and formal/military writing.
Be sure to provide sufficient details when posting what you want requested. Thanks guys!

Offline guards

  • Members
  • *
Re: invisable targets to appear and dissapear
« Reply #6 on: 06 Oct 2007, 09:18:17 »
that was what i thought would do it but it does not work

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: invisable targets to appear and dissapear
« Reply #7 on: 06 Oct 2007, 12:03:11 »
@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.
Code: (init.sqs) [Select]
; 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,
Code: (init.sqs) [Select]
; 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")
« Last Edit: 06 Oct 2007, 12:34:57 by Spooner »
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: invisable targets to appear and dissapear
« Reply #8 on: 06 Oct 2007, 12:37:24 »
Corret, createVehicle and deleteVehicle are OFP commands since version 1.34.

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: invisable targets to appear and dissapear
« Reply #9 on: 06 Oct 2007, 12:42:10 »
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,
Code: (object init) [Select]
hint format["%1", typeof this]

The class-name of the target will be shown in a hint when you run the mission.
« Last Edit: 06 Oct 2007, 12:44:24 by Spooner »
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: invisable targets to appear and dissapear
« Reply #10 on: 06 Oct 2007, 12:47:46 »
And that class is what you should use in any createVehicle command to create these invisible targets.

Offline guards

  • Members
  • *
Re: invisable targets to appear and dissapear
« Reply #11 on: 06 Oct 2007, 15:49:21 »
right o i will give it a go cheers

Offline Chrispy

  • Members
  • *
  • You never saw me! ;)
    • Delta Zero
Re: invisable targets to appear and dissapear
« Reply #12 on: 07 Oct 2007, 03:37:38 »
Oh, my bad, lol. It's just that I never saw it in CMDREFv104 or the Command Reference (under OFP) over here.

Chris
Need proof-reading for anything? Need a banner for your upcoming mod? Need a pic for your mission? Hit me up with a message. I have a bit of knowledge in Photoshop and formal/military writing.
Be sure to provide sufficient details when posting what you want requested. Thanks guys!