pepin1234 Posted July 16, 2016 Posted July 16, 2016 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]
FSFIan Posted July 16, 2016 Posted July 16, 2016 Take a look at Unit.getFuel(). I don't think that cockpit arguments are the way to go here. I don't know if those triggers even work for aircraft without a clickable cockpit, and it would also only work in single player (or possibly for the host in MP). DCS-BIOS | How to export CMSP, RWR, etc. through MonitorSetup.lua
pepin1234 Posted July 17, 2016 Author Posted July 17, 2016 I gonna give it a try. Probably I need some extra help, because I never ever been touch scripts. [sIGPIC][/sIGPIC]
pepin1234 Posted July 17, 2016 Author Posted July 17, 2016 (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) endSu-33 Script refueling.miz Edited July 17, 2016 by pepin1234 [sIGPIC][/sIGPIC]
pepin1234 Posted July 17, 2016 Author Posted July 17, 2016 Come on Guys... Any idea to make this script work? [sIGPIC][/sIGPIC]
Grimes Posted July 18, 2016 Posted July 18, 2016 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 1 The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
pepin1234 Posted July 18, 2016 Author Posted July 18, 2016 (edited) Thank you so much! This script make me see better the know how of the script work. Edited July 18, 2016 by pepin1234 [sIGPIC][/sIGPIC]
Recommended Posts