Home » MODDING HQ 1.13 » Flugente's Magika Workshop » New Feature: gear templates
New Feature: gear templates[message #350497] Mon, 07 August 2017 00:03 Go to next message
Flugente

 
Messages:3507
Registered:April 2009
Location: Germany
While equipping your mercs, using said equipment to murder people and then using that newly gained loot to further improve our equipment is fun, it can also become tedious. Especially with teams of a larger size, making sure everybody has what they need can take some time, especially after combat.
Armour might be damaged and needs replacement. Medkits are low. Grenades and ammo has been used. You get the idea.

To make that easier, smeagol and DepressivesBrot enthusiastically promoted an idea for several years I just as enthusiastically denied. But you know the saying: when in Bremen, do as the smeagol says. Unless his wife says otherwise big grin . But she didn't, so after this years con, we're here.
Anyway, this feature allows you to create a template from the gear the current merc has equipped. Such a template can than be loaded at anytime - the game will try to recreate the saved equipment template with items found in the sector inventory.
Depending on how elaborate these templates are, this could save you quite a bit of time.

A small demonstration:



  • As seen in the above video, we can simply create a template that stores the current merc's inventory via a button in the strategic inventory.
  • Templates are stored in \Profiles\UserProfile_whatever folder according to your vfs\GearTemplate. They are stored as .txt files. I've added an advanced template to SVN, too.
  • Templates are savegame-independent. You can create or use them whenever you like. You can also share them with others. Perhaps you have neat equipment ideas others would benefit from?
  • When we load a template, roughly the following happens:

    • 1. We drop any existing item in our merc inventory that would block a template item for that slot if the item exists in the sector in the first place. If the item is in an LBE slot, we drop all items in the slots of that LBE too.
    • 2. For each template entry, if the corresponding slot is empty, we pick the best item (best is determined by item status) from the sector inventory. If that fails for ammo, we search for other items in the sector containing the same bullets and create mags from that. So equipping from crates is not a problem. We also add attachments to LBE items at this point.
    • 3. We loop over our inventory, and for every item (not just those from the template) we try to find a better version from the sector, and exchange the two (this is similar to the Update gear function). If this is a stack of kits or ammo, we merge them before that. If the stack is not full, we add more items from the sector. We also try to improve all attachments with better versions (status) from the sector.
    • 4. We try to add attachments from the sector in the order they appear in the template if the template item is the same as is currently equipped, or if the template item is 0. This effectively allows us to use a wildcard, more on that later.
    • 5. We reload any gun and fill up any magazine. If the ammo is specified in the template, we try to use that. If the ammo does not fit (e.g. due to mag size modifiers), we use a more fitting ammo item.
  • Even if the template is empty (the game will create a Update Gear template), the above functions still run. An empty template will still try to replace all items with better versions, refill kits and fill up mags. Which is already kinda useful.
  • Note that if searching for a better item, only the status of the item is taken into account. Temperature, dirt, jams, fingerprint IDs etc. are ignored.
  • Attachments that require skill checks (Rod&Spring, Barrel Extender...) are not attached by this. Otherwise the current merc, who might be a klutz, might accidentally ruin your gun. You have to do those attachments yourself.
  • Note that no attachments are removed from items you drop. I advise using the sector inventory buttons to remove attachments prior to starting the process.
  • There is no limit on how many templates you can have. As you will be the one using it, having a thousand will only hurt yourself.
  • You can comment inside templates by starting a line with # or /.
  • For some tricks with templates, see the next post.
  • As the buttons won't exist in 640x480 due to no space being left, this feature won't be there in that resolution.

This feature is savegame compatible.
This has been added to the trunk in r8440 & GameDir r2384. The GameDir data is required. Using the new exe without the new GameDir will set in motion an unlikely chain events, ultimately leading to a horrifying (yet undeniably entertaining) autumn of 2022 for the residents of Osaka.

[Updated on: Mon, 07 August 2017 02:07]




I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.

If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.

Report message to a moderator

Captain

Re: New Feature: gear templates[message #350498 is a reply to message #350497] Mon, 07 August 2017 00:03 Go to previous messageGo to next message
Flugente

 
Messages:3507
Registered:April 2009
Location: Germany
Advanced shenanigans

The first step in setting up a template is to equip a merc with the gear you want, and then save that. But by editing these template, you can create pretty neat (at least in my view) templates to further speed up the equipment process.

First, remember that if templates include attachments, the game will try to find and attach all those attachments in that order. So the entry
5 12 94 1007 1030 1029

means the following: In our hands (slot 5) equip an M4 (item 12) and load it with a 30-rnd 5.56 AP mag (item 94). Try to attach 7x scope (item 1007), if that fails, a 4x scope (item 1030), if that fails a 2x scope (item 1029).

This means that we effectively provide alternatives for the game - if one attachment cannot be found, equip the next best one - according to what data we provided.

It doesn't stop there. By removing the explicit requirement of the item being a M4 and replacing it with 0, we get this:
5 0 0 1007 1030 1029


This will cause the game to try the above-explained scope attachment list on any item in our hand. We can of course extend that -
5 0 0 208 1000 1007 999 1030 1029 209 947 1011 902 1001 1006 1003 1012 950 1005 241 1525 307 322


would try to outfit any gun with a number of attachments (as seen in the video). Provided you enter all attachments according to your liking, you can shorten the entire process of attaching things to a few templates. In some instances these might vary - you would want scopes with less magnification on CQB, or prioritize suppressors in a 'stealth template' only. It's up to you.

The same goes for armour -
1 0 0 183 837


attaches plates to any worn armour.

Templates can of course be combined - in the video, I applied a 'Set - Standard gear' and then applied small changes for doctors, repair guys or radio operators.

You can even move the gun selection to this, as also seen in the video:
5 1066
5 347
5 12 
5 13
5 14

This provides several guns for the main hand, we pick the best item of the highest entry.

Meanwhile, you can also force the use of a certain ammotype, even if the gun (and thus the caliber) won't be fixed:
5 0 1400

This forces any gun kept in our hands to try to use item 1400 (9x19mm Box, Ball rounds). If that isn't possible, due to wrong calibre or magsize, we try to equip a better fitting one. So you can now force any gun you use to use mags of a specified calibre.

The main drawback to remember for this is that what is 'best' is only determined via status. If there is an item 1066 with 1% status, we will always pick up that before we try pick up a 100% 347. That's just the way it is. Any attempt to create a function to determine which gun with which attachments will be better than another gun seems like a surefire way to needless debate, so we're not having that.

This is my current, not-at-all-finished Set - Standard Gear:
Toggle Spoiler


Anyway, go nuts with this, people. happy

[Updated on: Sat, 12 August 2017 15:51]




I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.

If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.

Report message to a moderator

Captain

Re: New Feature: gear templates[message #350510 is a reply to message #350497] Tue, 08 August 2017 21:21 Go to previous messageGo to next message
smeagol is currently offline smeagol

 
Messages:2705
Registered:June 2008
Location: Bremen, Germany
Flugente wrote on Sun, 06 August 2017 23:03


To make that easier, smeagol and DepressivesBrot enthusiastically promoted an idea for several years I just as enthusiastically denied. But you know the saying: when in Bremen, do as the smeagol says. Unless his wife says otherwise big grin . But she didn't, so after this years con, we're here.


That's exactly what happened. Nice to see you expanded on the basic idea.

Report message to a moderator

Lieutenant

Re: New Feature: gear templates[message #351624 is a reply to message #350510] Mon, 04 December 2017 17:24 Go to previous messageGo to next message
Penta is currently offline Penta

 
Messages:60
Registered:May 2008
Is there a list anywhere of what numbers go with which inv slots? (Like 5 is hands, etc) Item numbers are easier to figure out, but.

Report message to a moderator

Corporal
Re: New Feature: gear templates[message #351625 is a reply to message #351624] Mon, 04 December 2017 18:33 Go to previous messageGo to next message
silversurfer

 
Messages:2791
Registered:May 2009
All items use classes which then have additional classes and properties. There is no simple list. For example armour has an item class of 2048 in Items.xml. It also has a class index which refers to the uiIndex in Armours.xml which then refers to an armour class (0=helmet, 1=vest, 2=leggings, 3=plates).


Wildfire Maps Mod 6.07 on SVN: https://ja2svn.mooo.com/source/ja2/branches/Wanne/JA2%201.13%20Wildfire%206.06%20-%20Maps%20MOD

Report message to a moderator

Lieutenant
Re: New Feature: gear templates[message #351627 is a reply to message #351624] Mon, 04 December 2017 20:22 Go to previous messageGo to next message
DepressivesBrot is currently offline DepressivesBrot

 
Messages:3653
Registered:July 2009
Penta wrote on Mon, 04 December 2017 16:24
Is there a list anywhere of what numbers go with which inv slots? (Like 5 is hands, etc) Item numbers are easier to figure out, but.
To nobodies surprise, this is both unintuitive and undocumented, so I made this work of art:
https://i.imgur.com/44sRCPj.png



Chat with us!
#bearpit on IRC
Discord
Get your latest 1.13 Builds
(Pls don't use my forum PMs for general game queries)

Report message to a moderator

Captain

Re: New Feature: gear templates[message #351631 is a reply to message #350497] Wed, 06 December 2017 02:11 Go to previous messageGo to next message
Kugelblitz is currently offline Kugelblitz

 
Messages:7
Registered:April 2017
Flugente wrote on Mon, 07 August 2017 00:03

This feature is savegame compatible.
This has been added to the trunk in r8440 & GameDir r2384. The GameDir data is required. Using the new exe without the new GameDir will set in motion an unlikely chain events, ultimately leading to a horrifying (yet undeniably entertaining) autumn of 2022 for the residents of Osaka.


Newbie Question - Where can I download the "trunk in r8440 & GameDir r2384" ?

Thank you for the very cool features you add all the time!

Report message to a moderator

Private
Re: New Feature: gear templates[message #351632 is a reply to message #351631] Wed, 06 December 2017 10:02 Go to previous messageGo to next message
silversurfer

 
Messages:2791
Registered:May 2009
Kugelblitz wrote on Wed, 06 December 2017 01:11

Newbie Question - Where can I download the "trunk in r8440 & GameDir r2384" ?

Easiest solution is to download the single click installer -> here.



Wildfire Maps Mod 6.07 on SVN: https://ja2svn.mooo.com/source/ja2/branches/Wanne/JA2%201.13%20Wildfire%206.06%20-%20Maps%20MOD

Report message to a moderator

Lieutenant
Re: New Feature: gear templates[message #352128 is a reply to message #350497] Mon, 22 January 2018 18:31 Go to previous messageGo to next message
newtomod is currently offline newtomod
Messages:3
Registered:January 2018
currently using 8507~8508 (the changelog txt said 8508,but loading screen said 8507??!?)

Frist ,thank you for the gear templates it save me countless hour resupply my guys
I got a bit of bug thing on the new template function,it could also be not a bug just i do't know how to us it correctly big grin

first i post one of the gear template i got problem on

0 801 0 1025
1 803 0 837
2 802 0
3 210 0
4 212 0
5 791 97 1003 949 1006 1030 1746 1026 1525 921 147
7 1667 0 1680 1696 1664 1656 1678 1678 1664 1652 1650
8 1666 0 1681 1684 1658 1662
9 1666 0 1656 1696 1658 1662
10 1708 0 1678 1655 1664 1664 1652
12 342 387 207 1005 1006 1029 1748 1002 307 1525 1011
13 600 0
16 387 0
23 202 0
24 202 0
25 97 0
26 135 0
27 146 0
29 213 0
30 134 0
32 147 0
33 995 0
35 1576 0
37 201 0
38 235 0
39 214 0
40 131 0
41 201 0
42 222 0
43 150 0
44 377 0

the above set mp5 using C-mag but I want to carry some AP round. the problem slot is # 44 which is a 9 mm SMG ammo AP cold,i cannot make it 2 stack when the LBE pocket is a 2 mag SMG .If the sector invt had the 30 round ammo the template work perfectly fine ,it will fill the # 44 with 2 SMG mag,if there only ammo cache on map it will only fill 1 SMG mag.

maybe I doing something wrong here?because I read the top ,it said the template work on ammo cache .however the I know the forum have many modding term so I maybe getting the wrong idea >..< big grin

Here another template with similar problem
0 825 0 1025
1 827 0 837
2 826 0
3 210 0
4 212 0
5 735 127 999 209
7 1176 0
8 1690 0 1695 1681 1658 1654 1650
9 1665 0 1664 1659 1662
10 1706 0 1656 1663 1671 1718 1652
11 1705 0 1684 1658 1680 1684 1652
12 621 561 244 1005 1006 1029 1750
13 600 0
16 127 0
17 1715 0
18 1709 0
20 1477 0
25 561 0
26 561 0
31 1575 0
35 213 0
36 1576 0
37 201 0
38 134 0
39 722 515 207 1005 1006
41 515 0
42 235 0
43 214 0
44 1730 0
45 1627 1628
46 127 0
47 561 0
48 201 0
51 515 0

the molle slot at #16 is an 3.11 ammo belt I would like to fill it with 8 x 7.62 mag,same problem only fill 1 mags.
another problem is #18 is a sleep bag ,it will always fill 2 sleeping bag which actually a bit useless weight.
the same problem happen on repair box and other big item that not need to carry two max ,is there anyway to reduce so I could save some weight?

there also a bit of small annoying bug happen if you have a lot of molle LBE template and switch around template ,the process sometime fail to clear the molle LBE item first and try to install the new template ,resulting combined molle LBE layout.If the sector having insufficient extra molle this problem happen more often.
I cannot reproduce this bug too often.

Another lesser problem was the helmet which allow sun-glass and NVG inside my normal setup was slot #3 Ear and #4 NVG/sun-glass,#0 helmet sun-glass/NVG
there some change that the game will put both sun-glass and NVG inside a helmet and another nvg/sun-glass at slot #4.in the end i will carry 1 extra sun-glass most game,a bit annoying ,not very heavy tho.
this bug also happen sometime, I try to reproduce it more often and report again big grin

In addition to above report I would like to have some suggestion to this great feature.(One again thx for this new feature saving me a lot of time)
I would like a hotkey or some way to drop all item and all LBE attachment on a mercs,Sometime I was trying to rearrange thing...the bet way is to clear all LBE ITEM and all small small into sector ,the sector invt hotkey only remove all gun ammo and attachment.to remove some LBE attachment I have to click on each of them and drag every 3.11 molle out /ctrl click,anyway a painful job when I did something wrong and want to redo.
A simply way to clear 1 LBE item will be great like ctrl + ALT +shift and right click on a LBE >drop and remove all molle on that item
maybe there some hotkey for that,I still new to this 1.13 mode i might mistake missing it somewhere.

another feature I would like to add is a message to warn player the gear template cannot complete fully
for example if your templates have a Rod & spring inside a gun,the game will not auto merge item for you coz there change to fail.It would be nice to give a small message at bottom text box tell us something like that cannot be done
some gun require EBR(m-14 ,m21) ability to change barrel (SCAR-L,H) would also benefit from a little message as a reminder.
some message like (templates name XYZ SCAR-H WP soldiers ,the weapon slot request an weapons SCAR-H WP plz manually combine the item and try again)

my first post if there any problem break forum rule plz let me know hahaha
pardon me for poor English

Report message to a moderator

Civilian
Re: New Feature: gear templates[message #352129 is a reply to message #352128] Mon, 22 January 2018 23:55 Go to previous messageGo to next message
Flugente

 
Messages:3507
Registered:April 2009
Location: Germany
Hi newtomod, welcome to the pit!

Great to see someone using this. The version number is only updates sporadically, trust whatever the SCI says.

As to your ammo problem, there is indeed a problem when feeding purely from crates it seems. I've fixed this in r8518, so this will in the next SCI.

The code always tries to fill up any slots as much as possible, which is the reason you get 2 sleeping bags. I see no easy workaround - how would the game know that sometimes you only want 1 item. The exact number could be written into the template, but then the thing gets way more complicated, with the player essentially having to create the template with the exact number of items they want, which gets muddled if one uses templates with different items with different item sizes and so on... I'd rather not alter that. If it is that bothersome, you could alter how many sleeping bags can be stacked in that LBE slot for example.

Sunglasses and NVG are a problem insofar as they are can be worn in a slot and as an attachment otherwise. It's obvious you only need one of each, but that would require me telling the code basically 'if A already exists somewhere else, don't create another A'. Which can be done, but would, again, make the entire template much more complicated to create and edit (as modders can put the tags that define sunglasses/NVG in other places, it isn't safe to always assume there will only be one required).

https://i.imgur.com/bNxKbX3.png
This button removes all attachments, including those on LBE, so no new hotkeys needed.

I had messages when an attachment could not be added, or no item was found etc., but on bigger templates that quickly turned into spam, so I turned that off.



I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.

If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.

Report message to a moderator

Captain

Re: New Feature: gear templates[message #352136 is a reply to message #350497] Tue, 23 January 2018 03:23 Go to previous messageGo to next message
newtomod is currently offline newtomod
Messages:3
Registered:January 2018
omg so quick reply !!

thx so much for the help,i don't notice the right click LBE remove thing.....

Flugente wrote on Mon, 07 August 2017 00:03

[*] There is no limit on how many templates you can have. As you will be the one using it, having a thousand will only hurt yourself.

someone got 20+ template it helpful lol heart

Report message to a moderator

Civilian
Re: New Feature: gear templates[message #352504 is a reply to message #352128] Wed, 21 February 2018 21:05 Go to previous message
Flugente

 
Messages:3507
Registered:April 2009
Location: Germany
newtomod wrote on Mon, 22 January 2018 16:31
...
another feature I would like to add is a message to warn player the gear template cannot complete fully
for example if your templates have a Rod & spring inside a gun,the game will not auto merge item for you coz there change to fail.It would be nice to give a small message at bottom text box tell us something like that cannot be done
some gun require EBR(m-14 ,m21) ability to change barrel (SCAR-L,H) would also benefit from a little message as a reminder.
some message like (templates name XYZ SCAR-H WP soldiers ,the weapon slot request an weapons SCAR-H WP plz manually combine the item and try again)
...

I've thought about this a bit... as of r8522, you will get a warning along the lines of We cannot attach XXX (item XXX_Nr) as that might damage items.. You will only receive one warning though, in order not to spam the player to death.



I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.

If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.

Report message to a moderator

Captain

Previous Topic: New (unofficial) merc: Lara Croft (Tomb Raider)
Next Topic: Not a feature: roleplay facts
Goto Forum:
  


Current Time: Mon Dec 02 10:37:18 GMT+2 2024

Total time taken to generate the page: 0.01145 seconds