johnv2pt0 Posted October 30, 2013 Posted October 30, 2013 Hey all, Anyone know where the names for missiles can be found for lines like ordanace.bombs.(name) and ordanance.nurs.(name)? The missiles.lua only has agm_65D and vikhr m. I tried using the names from the warheads.lua, but they aren't working. Thanks ~
Grimes Posted October 30, 2013 Posted October 30, 2013 Unit.getAmmo() returns a table of all of the ammo carried on that unit and information about that specific piece of ammo. One of the table values for each entry is the "displayName" Below is a selection of a table from an A-10C's payload. Note it doesn't return which pylons weapons are on, only how many weapons there are. [4] = { ["count"] = 2, ["desc"] = { ["missileCategory"] = 6, ["rangeMaxAltMax"] = 24076, ["rangeMin"] = 500, ["displayName"] = "AGM-65D", 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
johnv2pt0 Posted October 30, 2013 Author Posted October 30, 2013 Thanks Grimes, I appreciate your patience here. So if I call this function via do script, is the table created within the .miz file? How do I access the information?
Grimes Posted October 30, 2013 Posted October 30, 2013 You have declare a variable to be assigned the table. local ammo = Unit.getByName('whatever'):getAmmo() If you make it a global variable (remove "local") it would be accessible throughout any script used in a mission. To get the name of the weapon used in this example you would simply use: ammo[4].desc.displayName 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
Recommended Posts