Reloading Weapons for Land Units (Full Version)

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



Message


tmoilanen -> Reloading Weapons for Land Units (7/30/2020 12:39:57 PM)

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})




KnightHawk75 -> RE: Reloading Weapons for Land Units (7/30/2020 3:22:31 PM)

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).






Durendal28 -> RE: Reloading Weapons for Land Units (7/30/2020 3:25:22 PM)

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})





tmoilanen -> RE: Reloading Weapons for Land Units (7/30/2020 3:32:59 PM)

That worked! Thank you, gentlemen!




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.734375