wolle Posted September 23, 2013 Share Posted September 23, 2013 Hi, Is there a way, using the scripting engine, to inquire whether or not a unit is out of ammo? [sIGPIC][/sIGPIC] Intel Core I7 4820K @4.3 GHz, Asus P9X79 motherboard, 16 GB RAM @ 933 MHz, NVidia GTX 1070 with 8 GB VRAM, Windows 10 Pro Link to comment Share on other sites More sharing options...
Grimes Posted September 23, 2013 Share Posted September 23, 2013 http://wiki.hoggit.us/view/Part_2#Unit Unit.getAmmo() returns a table of the ammunition. If all ammunition has been expended then it will simply return an empty table. Consider it 100% accurate for aircraft, however ground vehicles can get a little confusing due to how ammunition storage works with them. For instance a Bradley will show that is has 7 or 8 Tows available even though only 2 are loaded into a launcher at a time. So ground vehicles count weapons in "storage" even though a weapon isn't completely ready to fire at that moment. Sams suffer the most from this issue as they have twice the number of missiles in storage pretty much all of the time. 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 Link to comment Share on other sites More sharing options...
wolle Posted September 24, 2013 Author Share Posted September 24, 2013 Hi Grimes, Great thanks! [sIGPIC][/sIGPIC] Intel Core I7 4820K @4.3 GHz, Asus P9X79 motherboard, 16 GB RAM @ 933 MHz, NVidia GTX 1070 with 8 GB VRAM, Windows 10 Pro Link to comment Share on other sites More sharing options...
chromium Posted September 24, 2013 Share Posted September 24, 2013 Unit.getAmmo() returns a table of the ammunition. If all ammunition has been expended then it will simply return an empty table. Hi, is there a way to include this sentence in a script that returns "TRUE" if a defined unit (or more than one of the same type) in a named group is out of ammo? I was thinking to create "re-ammo" small area about 3 km to the FLOT, made of M818 vehicles, and since one group (IE. tanks, 3xAbrams platoon) is out of big-bullet ammo he will execute a pre-inserted route that move to the re-ammo area, holds for 5 min and then go back to the original position. The routing part it would be realized with your patrol script and an "hold" function, while I need the "out-of-ammo" script to interrupt the "hold" action. Author of DSMC, mod to enable scenario persistency and save updated miz file Stable version & site: https://dsmcfordcs.wordpress.com/ Openbeta: https://github.com/Chromium18/DSMC The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously. Link to comment Share on other sites More sharing options...
Recommended Posts