Jump to content

Immortal On/Off Command - Disable after time or Trigger


Recommended Posts

Posted

Hi Fellow ME's,

I have Immortal set to on at mission start for an AI unit. What I want to be able to do is after some time, or by way of trigger entry of a different aircraft, remove the immortal from the other AI unit

Anyone know how I can achieve this without MOOSE or MIST, I have not cracked either yet

Thank you

Toni Carrera (Ice Rhino)

 

ThrustMaster HOTAS Warthog Throttle & A10C Stick, ThrustMaster F/A-18C Stick, ThrustMaster TFRP Pedals, ThrustMaster Cougars x 2, fitted to CubeSim USB Screens, TrackIR 4 Active LED & Cap Reflector, Stream Deck XL

Intel® Core™ i7-5820K 12 Core Processor, 32GB RAM, 1 x 500GB SSD, 2 x 256GB SSD, 1 x 1TB SSD 4 x 4TB Western Digital Mechanical. 2 x ASUS GTX 1080's SLI, ASUS 29" Ultrawide flanked by 2 x 22" IPS Monitors

Posted
local unit = Unit.getByName("unitNameThatYouWant")
if unit then
  local controller = unit:getController()
  if controller then
    local SetImmortal = {
      id = 'SetImmortal',
      params = {
        value = false
      }
    }
    controller:setCommand(SetImmortal)
  end
end

 

Posted

Thank you Chump. I assume this goes in a trigger script, or does it go in the LUA Predicate of advanced waypoint actions?

Toni Carrera (Ice Rhino)

 

ThrustMaster HOTAS Warthog Throttle & A10C Stick, ThrustMaster F/A-18C Stick, ThrustMaster TFRP Pedals, ThrustMaster Cougars x 2, fitted to CubeSim USB Screens, TrackIR 4 Active LED & Cap Reflector, Stream Deck XL

Intel® Core™ i7-5820K 12 Core Processor, 32GB RAM, 1 x 500GB SSD, 2 x 256GB SSD, 1 x 1TB SSD 4 x 4TB Western Digital Mechanical. 2 x ASUS GTX 1080's SLI, ASUS 29" Ultrawide flanked by 2 x 22" IPS Monitors

Posted

You could put this in a ONCE trigger, or an external LUA file. You could use timer.scheduleFunction() if written in LUA, or just set a condition in the mission editor trigger. Let me know if you need syntax help.

Posted

Hi Chump

Thank you, and yes, I would appreciate some help as offered

Thanks

Toni Carrera (Ice Rhino)

 

ThrustMaster HOTAS Warthog Throttle & A10C Stick, ThrustMaster F/A-18C Stick, ThrustMaster TFRP Pedals, ThrustMaster Cougars x 2, fitted to CubeSim USB Screens, TrackIR 4 Active LED & Cap Reflector, Stream Deck XL

Intel® Core™ i7-5820K 12 Core Processor, 32GB RAM, 1 x 500GB SSD, 2 x 256GB SSD, 1 x 1TB SSD 4 x 4TB Western Digital Mechanical. 2 x ASUS GTX 1080's SLI, ASUS 29" Ultrawide flanked by 2 x 22" IPS Monitors

Posted

There is no need to venture into .LUA land here unless you are already inclined to do so.

 

You can used the triggered actions tab to include a perform command -> immortal on/off trigger which can be activated by any standard means (TIME MORE, UNIT INSIDE ZONE, etc.) Use an AI TASK PUSH trigger to toggle the setting.

 

Posted

Thanks FFFF

Will give that a try later on

Thanking you

Toni Carrera (Ice Rhino)

 

ThrustMaster HOTAS Warthog Throttle & A10C Stick, ThrustMaster F/A-18C Stick, ThrustMaster TFRP Pedals, ThrustMaster Cougars x 2, fitted to CubeSim USB Screens, TrackIR 4 Active LED & Cap Reflector, Stream Deck XL

Intel® Core™ i7-5820K 12 Core Processor, 32GB RAM, 1 x 500GB SSD, 2 x 256GB SSD, 1 x 1TB SSD 4 x 4TB Western Digital Mechanical. 2 x ASUS GTX 1080's SLI, ASUS 29" Ultrawide flanked by 2 x 22" IPS Monitors

  • Recently Browsing   0 members

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