Jump to content

Group activation and deactivation


ickyline

Recommended Posts

Hi all,

 

In my new mission i try to do some tips with activation and deactivation trigger.

 

For now, I can activate a group when my airplane is on the trigger zone and deactivate this group when my airplane is not in the trigger zone.

 

For that i use something like this :

 

Trigger 1 : Do Once: Time +1 : activate flag 1.1

Trigger 2 : Condition : "If flag is 1.1" "unit myplane is in park triggerzone" : "set flag 1.2"

Trigger 3 : Condition : "If Flag is 1.2" : "Activate group 1 "/ "set flag 1.1"

Trigger 4 : Condition : "If flag is 1.1" "unit myplane is not in park triggerzone" : "set flag 1.3"

Trigger 5 : Condition : "If flag is 1.3" : "Deactivate group 1"/ "set flag 1.1"

 

It works fine at the moment.

 

But my problem is, if i spawn on the trigger zone the group is activate, when i move out of the trigerzone the group deactivate. But if i go back in the trigger zone the group don't activate anymore.

 

How can i create a cycle for entering and exit a trigger zone with activation and deactivation works each time i enter or exit?

Link to comment
Share on other sites

Use "SWITCHED CONDITION" trigger type, rather than "ONCE"

 

For work: iMac mid-2010 of 27" - Core i7 870 - 6 GB DDR3 1333 MHz - ATI HD5670 - SSD 256 GB - HDD 2 TB - macOS High Sierra

For Gaming: 34" Monitor - Ryzen 3600X - 32 GB DDR4 2400 - nVidia GTX1070ti - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar - Oculus Rift CV1

Mobile: iPad Pro 12.9" of 256 GB

Link to comment
Share on other sites

Unfortunately using a "SWITCHED" or now labelled "REPETITIVE ACTION" will not help here. The OP is deactivating a unit which will remove it from the mission entirely.

 

Essentially there is nothing available to activate once deactivation has taken place. I hope that makes sense. Cheers.

Callsign: NAKED

My YouTube Channel

 

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

Unfortunately using a "SWITCHED" or now labelled "REPETITIVE ACTION" will not help here. The OP is deactivating a unit which will remove it from the mission entirely.

 

Essentially there is nothing available to activate once deactivation has taken place. I hope that makes sense. Cheers.

 

There is no script for this? like "mist" or something?

Link to comment
Share on other sites

yeah you can use mist or moose to do what you want ickyline but you didn't ask that..

 

with moose for example you'd do something like this (note this isn't 100% it's just quick code)

myZone = ZONE:New("Zone1") -- store our zone
myPlayergroup = GROUP:FindByName("myPlayerGroup") -- store our player group
Group1 = nil -- for our spawn
isinzone = false -- so we don't' trigger multiple times below

-- our function checker
function checker()
if myPlayergroup:IsAnyInZone(myZone) then
 if isinzone == false then
  Group1 = SPAWN:New("MyAIGroup"):Spawn() -- make our group save it in Group1 so we can kill it later
  isinzone = true  -- we are in the zone so set this true and don't trigger again for now.
 end
else
 if isinzone == true then
     if Group1 ~= nil then -- if our group isn't nil eg it did actually spawn
        Group1:Destroy()  -- then destroy it.
     end
     isinzone = false -- we arne't in the zone no more so we can set this false
 end
end
end

SCHEDULER:New(nil,checker,{},1,1) --  create a new scheduler for checker run it every second

  • Like 2

i7 13700k, 64gb DDR5, Warthog HOTAS, HP Reverb G2 VR, win 11, RTX 3070

TGW Dedicated Server Admin, Australian PVE/PVP gameplay. (taskgroupwarrior.info/2020)

Link to comment
Share on other sites

  • 1 year later...
On 11/17/2019 at 1:44 PM, robgraham said:

yeah you can use mist or moose to do what you want ickyline but you didn't ask that..

 

with moose for example you'd do something like this (note this isn't 100% it's just quick code)

 

myZone = ZONE:New("Zone1") -- store our zone
myPlayergroup = GROUP:FindByName("myPlayerGroup") -- store our player group
Group1 = nil -- for our spawn
isinzone = false -- so we don't' trigger multiple times below

-- our function checker
function checker()
if myPlayergroup:IsAnyInZone(myZone) then
 if isinzone == false then
  Group1 = SPAWN:New("MyAIGroup"):Spawn() -- make our group save it in Group1 so we can kill it later
  isinzone = true  -- we are in the zone so set this true and don't trigger again for now.
 end
else
 if isinzone == true then
     if Group1 ~= nil then -- if our group isn't nil eg it did actually spawn
        Group1:Destroy()  -- then destroy it.
     end
     isinzone = false -- we arne't in the zone no more so we can set this false
 end
end
end

SCHEDULER:New(nil,checker,{},1,1) --  create a new scheduler for checker run it every second
 

 

Hi, thanks works perfect.
Can you help me?
I'm trying to set myPlayergroup as a coalition, so every time some of them inside the zone trigger the spawn.
I cannot find the argument for that.

Thanks in advance

[sIGPIC][/sIGPIC]

Intel(R) Core(TM) i9-10900KF CPU @ 3.70GHz   3.70 GHz ROG STRIX Z490-E GAMING
RAM 128 M.2*2 2T total SSD*3 2.5T total
GeForce RTX 3090   Orion2 HOTAS F-16EX  Saitek Pro Rudder

Link to comment
Share on other sites

On 8/19/2021 at 6:51 AM, Colmillo said:

Hi, thanks works perfect.
Can you help me?
I'm trying to set myPlayergroup as a coalition, so every time some of them inside the zone trigger the spawn.
I cannot find the argument for that.

Thanks in advance

For a coalition you'd do it a diffrent way around you'd look at the zone or do a set and then trigger off that.

so something like.

mz = ZONE:New("Test") -- Test would be the zone in ME.

SCHEDULER:New(nil,function() 
  if mz:IsSomeInZoneOfCoalition(coalition.side.BLUE) then
  -- code for spawning here
  
  end
end,{},60,60) -- run this starting 1 minute in and every 1 minute after.

 

i7 13700k, 64gb DDR5, Warthog HOTAS, HP Reverb G2 VR, win 11, RTX 3070

TGW Dedicated Server Admin, Australian PVE/PVP gameplay. (taskgroupwarrior.info/2020)

Link to comment
Share on other sites

On 8/23/2021 at 12:04 PM, robgraham said:

For a coalition you'd do it a diffrent way around you'd look at the zone or do a set and then trigger off that.

so something like.

mz = ZONE:New("Test") -- Test would be the zone in ME.

SCHEDULER:New(nil,function() 
  if mz:IsSomeInZoneOfCoalition(coalition.side.BLUE) then
  -- code for spawning here
  
  end
end,{},60,60) -- run this starting 1 minute in and every 1 minute after.

 

Thank you so much for taking time to help me.
Cheers!

[sIGPIC][/sIGPIC]

Intel(R) Core(TM) i9-10900KF CPU @ 3.70GHz   3.70 GHz ROG STRIX Z490-E GAMING
RAM 128 M.2*2 2T total SSD*3 2.5T total
GeForce RTX 3090   Orion2 HOTAS F-16EX  Saitek Pro Rudder

Link to comment
Share on other sites

  • Recently Browsing   0 members

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