Jump to content

Recommended Posts

Posted

I need help. I want make a mission for refueling. I like a trigger to use when the air refueling get X amount then make a kind of text message to direct the attack, but only after a specific fuel quantity. I was looking into Unit's cockpit argument or Unit's argument. How can I do this? I will use Su-33

[sIGPIC][/sIGPIC]

Posted (edited)

Ok. To make a simple example I will start with a Su-33 IA (I guess is the same script fur human) ready to air-refuel. With 15% internal fuel. (I want a message action when get 20% fuel)

 

I will like a trigger like. Initiator: Switched/on refuel, Condition: fuel unit (Su-33 # 001) more than 20%, action: text message: (e.g.) you got more than 20% fuel.

 

I understand that in triggers action I need set two LUA predicate:

 

1- Unit.RefuelingSystem = {

PROBE_AND_DROGUE

}

for i, unitObject(Unit.getByName(Su-33 #001))

end

 

2- local flightFuel = {0.20}

for i, unitObject(getUnits(Su-33 #001) do

flightFuel = Unit.getFuel(unitObject)

end

Su-33 Script refueling.miz

Edited by pepin1234

[sIGPIC][/sIGPIC]

Posted

Unfortunately lua predicate is still not functional. You are gonna have to do it completely with a lua script.

 

Assuming you just want to display the message once, you can do something like this...

 

Continous> Time More than 0 and Flag 1 is False> Do script

 

if Unit.getByName('Su-33 #001') then
if Unit.getByName('Su-33 #001'):getFuel() > 0.2 then
	trigger.action.outText('Congrats your fuel load is greater than 20%', 30)
	trigger.action.setUserFlag(1, true)
end
end

  • Like 1

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

  • Recently Browsing   0 members

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