Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

Reloading Weapons for Land Units

 
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 >> Reloading Weapons for Land Units Page: [1]
Login
Message << Older Topic   Newer Topic >>
Reloading Weapons for Land Units - 7/30/2020 12:39:57 PM   
tmoilanen

 

Posts: 72
Joined: 10/19/2011
Status: offline
Good morning - I'm attempting a LUA function to reload weapons to an Iskander SSM battalion.

I'm getting the error "No weapon defined" when running the command below.

Any assistance would be appreciated. I'm running 1147.7


local myunit = ScenEdit_GetUnit({name='test',side='Russia'})
print ( myunit )

ScenEdit_AddReloadsToUnit({unitname='test', w_dbid=1235, number=1, w_max=2})
Post #: 1
RE: Reloading Weapons for Land Units - 7/30/2020 3:22:31 PM   
KnightHawk75

 

Posts: 1450
Joined: 11/15/2018
Status: offline
shouldn't it be when not specifying which mount:
ScenEdit_AddReloadsToUnit({guid=myunit.guid, wpn_dbid=1235, number=1})

The sample in the docs may be out of date (w_dbid etc).




< Message edited by KnightHawk75 -- 7/30/2020 3:23:18 PM >

(in reply to tmoilanen)
Post #: 2
RE: Reloading Weapons for Land Units - 7/30/2020 3:25:22 PM   
Durendal28

 

Posts: 6
Joined: 4/22/2020
Status: offline
Good morning tmoilanen

The example on the CommandLua Docs site is incorrect; "w_dbid" should be "wpn_dbid".

Try this:

ScenEdit_AddReloadsToUnit({unitname='test', wpn_dbid=1235, number=1, w_max=2})


(in reply to tmoilanen)
Post #: 3
RE: Reloading Weapons for Land Units - 7/30/2020 3:32:59 PM   
tmoilanen

 

Posts: 72
Joined: 10/19/2011
Status: offline
That worked! Thank you, gentlemen!

(in reply to Durendal28)
Post #: 4
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Legion >> Reloading Weapons for Land Units 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.703