odyseus 19 Posted December 25, 2012 Hello guys i m trying to get a helicopter to move to a marker when its fuel is low. Any ideas? Share this post Link to post Share on other sites
iceman77 14 Posted December 25, 2012 (edited) After a quick glance into Mr.Murrays editing guide it appears you can use: Fuel VehName == 0.2 as a condition vehName moveTo posName; // ie; invise named hpad waitUntil {vehName distance posName < 100}; vehName land "posName"; Edited December 25, 2012 by Iceman77 Share this post Link to post Share on other sites
odyseus 19 Posted December 25, 2012 Thank again Iceman. I m trying to do this by triggers. i can get it to move to the marker when fuel is low. My only problem is to make it land on the helipad. This line vehName land "posName" does not work! Happy Holidays! :D Share this post Link to post Share on other sites
iceman77 14 Posted December 25, 2012 okay 1 sec ---------- Post added at 23:24 ---------- Previous post was at 23:09 ---------- Try this. It literally creates a waypoint. And I know land works on the onact of wps. So this should work. Obviously I name the hpad "Fpad" & the helo I name "helo1" and the helos crew is raven1=group this _wp = (group raven1) addWaypoint [position Fpad, 0]; _wp setWaypointBehaviour "careless"; _wp setWaypointCombatMode "green"; _wp setWaypointSpeed "FULL"; _wp setWaypointStatements ["true","helo1 land "Fpad"]; _wp setWaypointTimeout [0, 0, 0]; _wp setWaypointType "move"; _wp showWaypoint "ALWAYS"; ---------- Post added at 23:29 ---------- Previous post was at 23:24 ---------- You may actually have to give the "driver" (pilot) of the helo the order to land instead of the helo itself. So if that doesn't work, try: _wp setWaypointStatements ["true","leader raven1 land "Fpad"]; or //name the pilot _wp setWaypointStatements ["true","man1 land "Fpad"]; ---------- Post added at 23:41 ---------- Previous post was at 23:29 ---------- Btw, if you don't want the helo to run out of fuel you can just give the helo a "fuel" eventhandler.Put this into the init of the helo: this addEventHandler ["Fuel", { (_this select 0) setFuel 1 }] Share this post Link to post Share on other sites
buliwyf 2 Posted December 25, 2012 I would change the code Fuel VehName == 0.2 to Fuel VehName <= 0.2 because sometimes for example if you have lag or something the condition runs over. Share this post Link to post Share on other sites
iceman77 14 Posted December 25, 2012 (edited) yeah, I figured the fuel value wouldn't change to quickly, so the chance of it never actually equaling the value is slim. But in any case, you're right;) Edited December 25, 2012 by Iceman77 Share this post Link to post Share on other sites
Deadfast 43 Posted December 25, 2012 You might be surprised to find out the chances of that evaluating as true are the ones that are slim. You should never exactly compare floating point numbers. Share this post Link to post Share on other sites
iceman77 14 Posted December 25, 2012 oh okay. Why is that? I didn't think the vehicles in this game consumed fuel that quickly, so I figured how could it not ever equal the value. Share this post Link to post Share on other sites