Jump to content

RN-24/28 Classnames?


Kocrachon

Recommended Posts

Hey All,

 

I'm trying to write a script that detects if an aircraft has specific munitions equiped.

 

Right now here is what I have

 

weapRestrict.weapon2BAN={"AIM-120C","AIM-120B","R-77"} (Example Munitions)

 

With

 

if weapRestrict.weapon2BAN[bwCount] == checkPayload[bCount].desc.typeName then
   trigger.action.outText("Restricted Weapon detected: " .. checkPayload[bCount].desc.typeName .. ", this weapon is BANNED,  ".. e.initiator:getPlayerName() .. " kicking to spectator", 120)

 

But I can't seem to figure out the name of the "Nukes" to add to my weapon2Ban list. I checked the Weapons Database file but I couldn't find them obviously as RN-28 or RN-24.

 

Im doing this instead of setting warehouse limits because warehouse limits break with patches frequently, so I wanted a more stable solution so I can leave on unlimited weapons.

Link to comment
Share on other sites

Its a little weird.

 

"weapons.bombs.RN-24" and "weapons.bombs.RN-28" for the type name

 

For display name it is more normal as "RN-24" and "RN'-28".

 

A good way to figure it out is to iterate through Unit.getAmmo() for a given unit.

 

So something like:

 

local ammo = Unit.getByName('whatever'):getAmmo()
for i = 1, #ammo do
 env.info(ammo[i].desc.typeName)
 env.info(ammo[i].desc.displayName)
end

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

Link to comment
Share on other sites

No its just an itemized list of how many of each type of ammunition are onboard. It gives no information for what is on each pylon. getFuel() can sort of be used if working under the assumption that a player will take full internal fuel + bags as getFuel represents internal fuel only. So if it is greater than 1 then fuel tanks are used.

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

Link to comment
Share on other sites

  • 4 weeks later...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...