• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

Yeach

First Lieutenant
2 Badges
Mar 1, 2018
220
0
  • BATTLETECH
  • Shadowrun Returns
While modding in mechs (that had same name/chassis) and adding in hardpoints for each variant, here is my progress so far.
Note: I am only editing the Json files only.

The idea was started by ronhatch
@ronhatch
https://forum.paradoxplaza.com/foru...scussion-thread.1091249/page-16#post-24439731

With the Locust example
The first thing was on the mechdef files for LCT-1V, -1S, -1M, I have them all referenced to the chassidef_locust_LCT_1V file; I change variantname from "LCT-1V" to just "LCT-1" because that is the name displayed on the mech selection screen (along with the c-bill cost)
The preview screen however does not display the variant;
I changed the mechdef_locust_LCT-1S "name" from just "Locust" to "Locust LCT-1S" to show the correct variant
Simply the LCT-1S, LCT-1M are all variants of LCT-1V; if you put the preview for stock configuration, it will show the LCT-1V config with MGs and a medium laser.
(Don't mind the +SRM2, its just a plugged-in regular SRM2_1_Holly for lore)

LCT-1S mechlab.jpg

lct-1S stock.jpg


And as you can see the fun when you encounter the mech in the field
it will display the "name" followed by the "variant" so from above it would show it as
"Locust LCT-1S LCT-1"
LCT-1S Locust.jpg


When you salvage the mech for parts, they will be the basic LCT-1V parts. (forgot to take a screenshot)
I haven't gotten far enough to see if the market sells the LCT-1S mech in whole (or parts) yet.
 

ronhatch

Lt. General
5 Badges
Feb 23, 2018
1.304
2
  • Stellaris
  • BATTLETECH
  • BATTLETECH - Beta Backer
  • BATTLETECH - Backer
  • Crusader Kings III
The problem I ran into when I tried this with just JSON edits is that the parts from different variants were still treated as distinct even though they all had the same name. So if I salvaged an LCT-1 part from an LCT-1S as well as two LCT-1 parts from LCT-1Vs, I ended up with two different stacks of mech parts... and not a complete mech.

I haven't spent time on trying to write code for the preferred behavior yet, but if anyone else takes a stab at it I'd be happy to help and/or playtest it.

Oh, and perhaps it makes sense to name the chassis "Locust" and use just the variant designation as the starting name? Might cause some odd glitches in the parts of the display that expect the chassis to have a very short name, but worth a try.
 

Yeach

First Lieutenant
2 Badges
Mar 1, 2018
220
0
  • BATTLETECH
  • Shadowrun Returns
The problem I ran into when I tried this with just JSON edits is that the parts from different variants were still treated as distinct even though they all had the same name. So if I salvaged an LCT-1 part from an LCT-1S as well as two LCT-1 parts from LCT-1Vs, I ended up with two different stacks of mech parts... and not a complete mech.

I haven't spent time on trying to write code for the preferred behavior yet, but if anyone else takes a stab at it I'd be happy to help and/or playtest it.

Oh, and perhaps it makes sense to name the chassis "Locust" and use just the variant designation as the starting name? Might cause some odd glitches in the parts of the display that expect the chassis to have a very short name, but worth a try.

You are right
Just had the two piles of LCT-1 Salvage :(

Probably why I didn't notice was because I changed the name to all LCT-1

2 LCT-1 parts.jpg
 

Yeach

First Lieutenant
2 Badges
Mar 1, 2018
220
0
  • BATTLETECH
  • Shadowrun Returns
The problem I ran into when I tried this with just JSON edits is that the parts from different variants were still treated as distinct even though they all had the same name. So if I salvaged an LCT-1 part from an LCT-1S as well as two LCT-1 parts from LCT-1Vs, I ended up with two different stacks of mech parts... and not a complete mech.

I haven't spent time on trying to write code for the preferred behavior yet, but if anyone else takes a stab at it I'd be happy to help and/or playtest it.

Oh, and perhaps it makes sense to name the chassis "Locust" and use just the variant designation as the starting name? Might cause some odd glitches in the parts of the display that expect the chassis to have a very short name, but worth a try.

I am guessing salvage parts is based on mechdef file and NOT the chassisdef file?
The description for both LCT-1 still refers to the same description from the LCT-1V chassidef file.
 

ronhatch

Lt. General
5 Badges
Feb 23, 2018
1.304
2
  • Stellaris
  • BATTLETECH
  • BATTLETECH - Beta Backer
  • BATTLETECH - Backer
  • Crusader Kings III
I am guessing salvage parts is based on mechdef file and NOT the chassisdef file?
As far as I can tell, that's exactly it. Not what I was expecting at all, and I was very disappointed when I ran across it.

Edit: Although it does make at least SOME sense when mechs come fully equipped... the system needs to know which mechdef file to use to equip it. (Which just makes me hate the decision to salvage fully equipped mechs that much more, really.)
 

SimulatedKnave

Corporal
19 Badges
Sep 17, 2016
26
1
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sword of Islam
  • Europa Universalis III
  • Europa Universalis III: Chronicles
  • Divine Wind
  • Heir to the Throne
  • Rome Gold
  • Crusader Kings II
  • Crusader Kings III: Royal Edition
  • Crusader Kings III
  • Stellaris: Humanoids Species Pack
  • Stellaris: Synthetic Dawn
  • Stellaris - Path to Destruction bundle
  • Stellaris: Leviathans Story Pack
  • Stellaris
  • Crusader Kings II: Conclave
  • Crusader Kings II: Way of Life
  • Rome: Vae Victis
The MechAssembly mod combined with this might work well - MechAssembly will build you a mech out of parts of different variants. Would get you past the issue you're encountering, at least to some extent.
 

ronhatch

Lt. General
5 Badges
Feb 23, 2018
1.304
2
  • Stellaris
  • BATTLETECH
  • BATTLETECH - Beta Backer
  • BATTLETECH - Backer
  • Crusader Kings III
The MechAssembly mod combined with this might work well - MechAssembly will build you a mech out of parts of different variants. Would get you past the issue you're encountering, at least to some extent.
Yeah... not ideal, since the salvage selection screen often wouldn't show how close you really are to finishing a mech.

It's at least a good starting point for figuring how to code what I really want.
 

SimulatedKnave

Corporal
19 Badges
Sep 17, 2016
26
1
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sword of Islam
  • Europa Universalis III
  • Europa Universalis III: Chronicles
  • Divine Wind
  • Heir to the Throne
  • Rome Gold
  • Crusader Kings II
  • Crusader Kings III: Royal Edition
  • Crusader Kings III
  • Stellaris: Humanoids Species Pack
  • Stellaris: Synthetic Dawn
  • Stellaris - Path to Destruction bundle
  • Stellaris: Leviathans Story Pack
  • Stellaris
  • Crusader Kings II: Conclave
  • Crusader Kings II: Way of Life
  • Rome: Vae Victis
Logically, there's code in there somewhere that says "produce a mech part based off the chassisdef". Switch it to using "mechdef" and you're all set.

I look forward to hearing how much more complicated it is than that. ;)

EDIT: As a suggestion, if you DO manage it in the way I have suggested above - keep the mods separate from each other as much as possible, coding-wise. That way, there will also be the option to have two or three base chassis per mech (like the different speeds of the Banshee, or the way there are some Victor variants that just add machine guns) while still keeping the major variations distinct (the K2 Catapult is pretty distinct from all the missile variants, for example).
 

ronhatch

Lt. General
5 Badges
Feb 23, 2018
1.304
2
  • Stellaris
  • BATTLETECH
  • BATTLETECH - Beta Backer
  • BATTLETECH - Backer
  • Crusader Kings III
Logically, there's code in there somewhere that says "produce a mech part based off the chassisdef". Switch it to using "mechdef" and you're all set.

I look forward to hearing how much more complicated it is than that. ;)
Heh... yeah, I suspect the complicated bit is simply understanding how the game works well enough to write a mod that changes the code at all. And the existing mods help a lot in that regard. I'll get to it sooner or later.
 

Yeach

First Lieutenant
2 Badges
Mar 1, 2018
220
0
  • BATTLETECH
  • Shadowrun Returns
As far as I can tell, that's exactly it. Not what I was expecting at all, and I was very disappointed when I ran across it.

Edit: Although it does make at least SOME sense when mechs come fully equipped... the system needs to know which mechdef file to use to equip it. (Which just makes me hate the decision to salvage fully equipped mechs that much more, really.)

The game has alot of different variants of mechs that use ONE chassis.
example: Victoria's Kingcrab KGC-V-0000 uses the regular Kingcrab chassis. (okay okay the rest centurion, panther, urbanmech are targetdummies)
But how (or has anyone) been able to use it as a functional mech (since you can't headshot her in the game)?
 

ronhatch

Lt. General
5 Badges
Feb 23, 2018
1.304
2
  • Stellaris
  • BATTLETECH
  • BATTLETECH - Beta Backer
  • BATTLETECH - Backer
  • Crusader Kings III
The game has alot of different variants of mechs that use ONE chassis.
example: Victoria's Kingcrab KGC-V-0000 uses the regular Kingcrab chassis. (okay okay the rest centurion, panther, urbanmech are targetdummies)
But how (or has anyone) been able to use it as a functional mech (since you can't headshot her in the game)?
Don't know... but I've heard that salvaging her mech doesn't always work (and I know I didn't get any King Crab parts from her mech), so maybe there's a bug in that part of the code.
 

SimulatedKnave

Corporal
19 Badges
Sep 17, 2016
26
1
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sword of Islam
  • Europa Universalis III
  • Europa Universalis III: Chronicles
  • Divine Wind
  • Heir to the Throne
  • Rome Gold
  • Crusader Kings II
  • Crusader Kings III: Royal Edition
  • Crusader Kings III
  • Stellaris: Humanoids Species Pack
  • Stellaris: Synthetic Dawn
  • Stellaris - Path to Destruction bundle
  • Stellaris: Leviathans Story Pack
  • Stellaris
  • Crusader Kings II: Conclave
  • Crusader Kings II: Way of Life
  • Rome: Vae Victis
Havingchecked the files, her version is Blacklisted. Two things may occur from that, I think: it may default to using the chassisdef if the variant you're trying to salvage is blacklisted. Or it may just not be salvageable.

Looking at the 1b Shadow Hawk (which I think is the one you face in Majesty Metals, though I may be mistaken) it's also blacklisted...
 

ronhatch

Lt. General
5 Badges
Feb 23, 2018
1.304
2
  • Stellaris
  • BATTLETECH
  • BATTLETECH - Beta Backer
  • BATTLETECH - Backer
  • Crusader Kings III
Oh, I didn't phrase it well... her King Crab didn't show up in salvage for me, but I've heard that for some people it does show up. (Turns out "salvaging [...] doesn't always work" is not a good summary of that.) If that rumor is true, that means it's intermittent, which would point to a likely bug.