Adding Weapons to Magazines (Full Version)

All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Legion



Message


obrien979 -> Adding Weapons to Magazines (8/16/2019 8:57:41 AM)

I am trying to use a LUA script to represent delivering ammo resupply to ground units. I have tried the following code:
ScenEdit_AddWeaponToUnitMagazine({unitname='3-82 FA', w_dbid=7443, new="true",number=1, w_max=10})

Despite my numerous attempts using what I thought was the correct w_dbid number, I have had no success.
For example I am trying to add 155mm/39 HE rounds to the unit. When you search in the DB Viewer you get an ID# 2243, that number didnt work in the script. Then I looked under in the ADD WEAPON RECORD menu in the MAGAZINES SELECTION for the unit and found the same munition type but with ID# 7343, that number didnt work as well.

My question is two part, Am I using the right script and correctly? and what is the correct w_dbid to use?

Thank You




Whicker -> RE: Adding Weapons to Magazines (8/16/2019 4:17:24 PM)

I just struggled with this as well. The dbid is the one from the Weapons db - not from the magazine >> add weapon screen.

I was adding it to a base or an ammo pad, here is what I did - I did not need the new part for some reason:

quote:


local u = SE_GetUnit({name='Ammo Pad', guid='01563bf0-12c5-4ce4-bdd7-e370c449c77f'})
print(u.magazines)
ScenEdit_AddWeaponToUnitMagazine({unitname=u.name, wpn_dbid=2983, number=12, w_max=48})




obrien979 -> RE: Adding Weapons to Magazines (8/18/2019 12:34:54 PM)

Thank You for your response. I am such a novice at LUA but I will play around with this coding.

Thanks




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.8427734