Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

How to add weapon record of 10000 via Lua

 
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 >> How to add weapon record of 10000 via Lua Page: [1]
Login
Message << Older Topic   Newer Topic >>
How to add weapon record of 10000 via Lua - 8/17/2021 11:52:14 PM   
Hawaiiboy909

 

Posts: 1
Joined: 8/23/2020
Status: offline
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?
Post #: 1
RE: How to add weapon record of 10000 via Lua - 8/18/2021 5:59:19 PM   
KnightHawk75

 

Posts: 1450
Joined: 11/15/2018
Status: offline
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-->

(in reply to Hawaiiboy909)
Post #: 2
RE: How to add weapon record of 10000 via Lua - 8/23/2021 12:41:59 PM   
jkgarner

 

Posts: 174
Joined: 4/30/2020
Status: offline
OK Knigthhawk, this is some XML stuff... which XML file are you modding?

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

 

Posts: 1450
Joined: 11/15/2018
Status: offline
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.

< Message edited by KnightHawk75 -- 8/23/2021 3:30:33 PM >

(in reply to jkgarner)
Post #: 4
RE: How to add weapon record of 10000 via Lua - 8/23/2021 8:06:44 PM   
jkgarner

 

Posts: 174
Joined: 4/30/2020
Status: offline
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.

(in reply to KnightHawk75)
Post #: 5
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Legion >> How to add weapon record of 10000 via Lua 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

1.313