Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

LUA to Add Weapons to Magazine

 
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 >> LUA to Add Weapons to Magazine Page: [1]
Login
Message << Older Topic   Newer Topic >>
LUA to Add Weapons to Magazine - 3/30/2020 2:35:02 PM   
tmoilanen

 

Posts: 26
Joined: 10/19/2011
Status: offline
Good morning - I'm trying to add weapons to a magazine...syntax and error message are shown below. Any help would be appreciated.

>> local a = ScenEdit_QueryDB('weapon',51)
print(a)

ScenEdit_AddWeaponToUnitMagazine({unitname='Eareckson Air Station Ammo Revetment #1', dbid='51'})

weapon {
name = 'AIM-120D AMRAAM P3I.4',
dbid = '51',
type = '6',
subtype = 'Guided Weapon',
validTargetList = 'table',
}
ScenEdit_AddWeaponToUnitMagazine 0 : ,No weapon defined.
Post #: 1
RE: LUA to Add Weapons to Magazine - 3/30/2020 2:40:22 PM   
TitaniumTrout

 

Posts: 310
Joined: 10/20/2014
From: Michigan
Status: offline
You need more information.

quote:

ScenEdit_AddWeaponToUnitMagazine({side='Coalition',unitname='Bunker',wpn_dbid='51',number=10,maxcap=250}))


< Message edited by TitaniumTrout -- 3/30/2020 2:44:14 PM >


_____________________________


(in reply to tmoilanen)
Post #: 2
RE: LUA to Add Weapons to Magazine - 3/30/2020 4:24:31 PM   
Randomizer


Posts: 1353
Joined: 6/28/2008
Status: offline
For The V-Bombers I used the following script to add weapons to magazines at random times.

ScenEdit_AddWeaponToUnitMagazine({name='Ammo Pad', guid='760ad4e1-064b-44e6-831e-
4e9ffa24c146', wpn_dbid='727', number='4'})
ScenEdit_AddWeaponToUnitMagazine({name='Ammo Pad', guid='760ad4e1-064b-44e6-831e-
4e9ffa24c146', wpn_dbid='1161', number='8'})
ScenEdit_AddWeaponToUnitMagazine({name='Ammo Pad', guid='760ad4e1-064b-44e6-831e-
4e9ffa24c146', wpn_dbid='90', number='6'})
ScenEdit_AddWeaponToUnitMagazine({name='Ammo Pad', guid='760ad4e1-064b-44e6-831e-
4e9ffa24c146', wpn_dbid='615', number='1'})

One of the Lua gods out there (forget which) later advised that the unit name is superfluous if the GUID is used, which simplifies the script slightly.

-C

< Message edited by Randomizer -- 3/30/2020 4:28:26 PM >

(in reply to TitaniumTrout)
Post #: 3
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Legion >> LUA to Add Weapons to Magazine 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.109