Jump to content

Recommended Posts

Posted

New to scripting, I've been searching through forums and other sources and can't string together the solution.

Trying to effectively activate a group when condition is met, deactivate when next condition is met, but then (re)activate the same group when the original condition is met.  

Starting group in late activation. Testing conditions with flag equals and add radio item for group to initiate the flag. Eventually would like condition to be part of group/unit in zone1, second condition part of group/unit in zone2. (generator lights on in FARP when landing, off after takeoff)

Tried MIST - but there is no de-spawn script that I could find, and multiple uses of the respawn don't seem to activate and deactivate. But tried respawn (worked) DCS action Group Deactivate (worked) then respawn again (doesn't work)

Tried MOOSE - used group.activate (worked), group.deactivate (worked), group.activate agan (doesn't work)

used group.activate (worked), group.destroy (worked), group.activate (doesn't work)

 

Any help would be much appreciated.

Posted (edited)

I'm not where I can test this, but here is my suggestion.

 

Use MIST function mist.teleportInZone() to spawn the group.  You will need to create a template of tge group you want to spawn and put it somewhere out telephoned.  I have used this to respawn tge same group once it has been destroyed.

https://wiki.hoggitworld.com/view/MIST_teleportInZone

 

 

I think you can then use DCS API group.destroy () to destroy the group you teleported.  I haven't used this myself, so am a little unsure.

https://wiki.hoggitworld.com/view/DCS_func_destroy

 

Good luck.

 

Clutter

Edited by AKA_Clutter

----------------

AKA_Clutter

 

Win 10 Pro, Intel i7 12700k @4.6 GHz, EVGA RTX 3080  FTW, Ultra 64 GB G.Skill DDR4 3600 RAM, Acer 27" flat screen, HP Reverb G2, TM Warthog HOTAS with Virpil warBRD base, MFG Rudder Pedals, Virpil TCS Rotor Base with AH-64Dcollective, TrackIR 5 Pro w/Vector Expansion, PointCTRL.

Posted
17 hours ago, toutenglisse said:

I would use dynAdd or addGroup and destroy when conditions met.

Thank you.  I secretly hoped that the group.deactivate wouldn't "destroy"

 

2 hours ago, AKA_Clutter said:

I'm not where I can test this, but here is my suggestion.

 

Use MIST function mist.teleportInZone() to spawn the group.  You will need to create a template of tge group you want to spawn and put it somewhere out telephoned.  I have used this to respawn tge same group once it has been destroyed.

https://wiki.hoggitworld.com/view/MIST_teleportInZone

 

 

I think you can then use DCS API group.destroy () to destroy the group you teleported.  I haven't used this myself, so am a little unsure.

https://wiki.hoggitworld.com/view/DCS_func_destroy

 

Good luck.

 

Clutter

 

Thank you too.  I will look into this and test it.  

What about clone group? Will clone place the group in the late activation state or does it only clone into an active state?  If there was a way to clone into late activation then I could clone before deactivate/destroy.  

Posted
26 minutes ago, AresShadow said:

..

 

What about clone group? Will clone place the group in the late activation state or does it only clone into an active state?  If there was a way to clone into late activation then I could clone before deactivate/destroy.  

I haven't used mist.cloneGroup before so I don't know.

 

I know that mist.teleportInZone will make the cloned, teleported in group active.  When I used it, my template group was "late activation" and was "active" after execution of the function.

----------------

AKA_Clutter

 

Win 10 Pro, Intel i7 12700k @4.6 GHz, EVGA RTX 3080  FTW, Ultra 64 GB G.Skill DDR4 3600 RAM, Acer 27" flat screen, HP Reverb G2, TM Warthog HOTAS with Virpil warBRD base, MFG Rudder Pedals, Virpil TCS Rotor Base with AH-64Dcollective, TrackIR 5 Pro w/Vector Expansion, PointCTRL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...