RN-24/28 Classnames? - ED Forums
 


Notices

Reply
 
Thread Tools Display Modes
Old 07-11-2019, 06:14 PM   #1
Kocrachon
Member
 
Kocrachon's Avatar
 
Join Date: Apr 2011
Posts: 131
Default RN-24/28 Classnames?

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

Code:
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.
Kocrachon is offline   Reply With Quote
Old 07-11-2019, 11:00 PM   #2
Grimes
ED Testers Team
 
Grimes's Avatar
 
Join Date: Jan 2006
Location: Black Mesa
Posts: 7,936
Default

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:

Code:
local ammo = Unit.getByName('whatever'):getAmmo()
for i = 1, #ammo do
  env.info(ammo[i].desc.typeName)
  env.info(ammo[i].desc.displayName)
end
__________________
You can only tie the world record for lowest flight.
Current Projects: Scripting Wiki, Something...
Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread), SLMOD for DCS 1.5/2.0, IADScript, Mission Editing Wiki!, Mission Building Forum
Grimes is offline   Reply With Quote
Old 07-12-2019, 12:41 AM   #3
Hardcard
Member
 
Hardcard's Avatar
 
Join Date: May 2013
Posts: 528
Default

Does Unit.getAmmo() detect external fuel tanks as well?
Hardcard is offline   Reply With Quote
Old 07-12-2019, 01:13 AM   #4
Grimes
ED Testers Team
 
Grimes's Avatar
 
Join Date: Jan 2006
Location: Black Mesa
Posts: 7,936
Default

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.
__________________
You can only tie the world record for lowest flight.
Current Projects: Scripting Wiki, Something...
Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread), SLMOD for DCS 1.5/2.0, IADScript, Mission Editing Wiki!, Mission Building Forum
Grimes is offline   Reply With Quote
Old 07-12-2019, 03:01 AM   #5
Kocrachon
Member
 
Kocrachon's Avatar
 
Join Date: Apr 2011
Posts: 131
Default

Thanks grimes!
Kocrachon is offline   Reply With Quote
Old 07-12-2019, 05:15 PM   #6
Hardcard
Member
 
Hardcard's Avatar
 
Join Date: May 2013
Posts: 528
Default

@Grimes

Thanks for the answer.

Yes, I used the getFuel() check that you mentioned when I wrote my air refueling script. It works as intended, but I was hoping for a better way of doing it.

Isn't there a way of detecting the presence of external fuel tanks more directly?
Hardcard is offline   Reply With Quote
Old 07-12-2019, 10:37 PM   #7
Grimes
ED Testers Team
 
Grimes's Avatar
 
Join Date: Jan 2006
Location: Black Mesa
Posts: 7,936
Default

Nope.
__________________
You can only tie the world record for lowest flight.
Current Projects: Scripting Wiki, Something...
Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread), SLMOD for DCS 1.5/2.0, IADScript, Mission Editing Wiki!, Mission Building Forum
Grimes is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 08:36 AM. vBulletin Skin by ForumMonkeys. Powered by vBulletin®.
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.