How to add weapon record of 10000 via Lua (Full Version)

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



Message


Hawaiiboy909 -> How to add weapon record of 10000 via Lua (8/17/2021 11:52:14 PM)

Wondering if there a way to add weapons to existing mount with count of 10000. Instead of using the GUI. Not sure if ScenEdit_UpdateUnit() has a way to specify weapon amount/count. I understand certain weapon record have a max cap of 10000 already, but not all. example AIM-260 doesn't. Is it possible to use ScenEdit_AddReloadsToUnit to modify the cap of weapon count?




KnightHawk75 -> RE: How to add weapon record of 10000 via Lua (8/18/2021 5:59:19 PM)

There is a way, but it's limiting. ;)

Last I recall for 10,000 entries that don't actually exist as weapon records you will need to make a delta for it and then can apply it via UpdateUnit() in delta mode. The down side is it restricts you to a pre-defined units\guids (unless you have pro and can use io to change that, but in that case might as well just add your own weapon record if that's the case). It's the only method I know dating back to cmano for this specific case and wish it wasn't the case (wish updateunit had some of the logic of delta parser for weaponrecid==0). After it's added with the 10k capacity via delta you can then change the current count via normal means (updateunit or addreloadstounit).
the entries you're looking for will look like
 
<WeaponRecAdd_0_3567 />  --this is the 10k cap add. 
--The 0 for weaponrecid invokes a separate code path avoiding the database check on the weaponrec id and adding a 10k cap unit.
<!--AIM-260 JATM-->
<WeaponEdit_3567_10000 /> --this updates the current count to 10k (just a default)
<!--AIM-260 JATM-->




jkgarner -> RE: How to add weapon record of 10000 via Lua (8/23/2021 12:41:59 PM)

OK Knigthhawk, this is some XML stuff... which XML file are you modding?




KnightHawk75 -> RE: How to add weapon record of 10000 via Lua (8/23/2021 3:21:11 PM)

a standard .ini delta\sbr file it doesn't have to contain the whole scene it can contain just a single unit and what you want done to that unit specifically at given moment, you then apply it via UpdateUnit(mode="delta", filename=""...).

Since you jk have Professional and access to .io namespace you could even generate them on the fly as needed, run them, and then remove them, non-pro have no such luxury so stuck with more restricted use to units that pre-exist or match a known guid at the moment of time of the delta running.




jkgarner -> RE: How to add weapon record of 10000 via Lua (8/23/2021 8:06:44 PM)

Pointing at self --RTFM!
Chapter 7 of the manual discusses the scenario ini files.
I need to read over this section before I ask any more questions.




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.03125