Jump to content

Recommended Posts

Posted

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 ~

Posted

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 ServerScripting Wiki

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

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

Posted

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?

Posted

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 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...