Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

Adding Weapons to Magazines

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Legion >> Adding Weapons to Magazines Page: [1]
Login
Message << Older Topic   Newer Topic >>
Adding Weapons to Magazines - 8/16/2019 8:57:41 AM   
obrien979

 

Posts: 29
Joined: 5/18/2018
Status: offline
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

_____________________________

BOB
Post #: 1
RE: Adding Weapons to Magazines - 8/16/2019 4:17:24 PM   
Whicker

 

Posts: 664
Joined: 6/20/2018
Status: offline
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})

(in reply to obrien979)
Post #: 2
RE: Adding Weapons to Magazines - 8/18/2019 12:34:54 PM   
obrien979

 

Posts: 29
Joined: 5/18/2018
Status: offline
Thank You for your response. I am such a novice at LUA but I will play around with this coding.

Thanks

_____________________________

BOB

(in reply to Whicker)
Post #: 3
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Legion >> Adding Weapons to Magazines Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

0.891