I'm creating multiple versions of all Terran units, including the Liberator, Siege Tank, and Viking. I was able to duplicate the Liberator and Liberator AG units without an issue. I was also able to duplicate the Siege Tank (Tank Mode) and Viking (Fighter Mode) units without issues.
However... for some reason I'm having trouble duplicating the Siege Tank (Siege Mode) and Viking (Assault Mode) units.
The dependency the editor makes me copy them from is Coop. Whenever I try to duplicate either of these units it not only creates the new unit (ex:) "Siege Tank Copy (Siege Mode)," but will also change the name of the Coop unit I duplicated it from to "Siege Tank Copy (Siege Mode)." I find this really odd because the editor doesn't usually let me make changes to units from a dependency, only the duplicated ones that are part of my mod. I've also tried making a duplication from the custom duplicated unit, but then it changes all three names to this same thing. At that point the editor treats them as the same unit, so even if I separately change their leader aliases to make the editor distinguish between them, it'll change all of their leader aliases to the same thing simultaneously.
I'm able to attach separate (duplicated) versions of the "Siege Tank" and "Siege Tank Sieged" actors as well as separate (duplicated) versions of the morphing abilities to these units I've created, but even though the editor will recognize that they have different actors and abilities, it'll still change their names to be the same thing.
What I've tried:
I thought the issue might be because morph abilities, like "Siege Mode" and "Tank Mode" in the editor might be coded to require an exact 1:1 correlation between units before and after the ability is used (otherwise the morph ability wouldn't know which of the multiple units to morph the original unit into), and thus automatically changes the names of units which have that ability to fit that rule, but... then why was I able to duplicate those other units successfully? Regardless, I tried "unlinking" the units from one another by unattaching them from all of their abilities and from their main "Siege Tank" actor, to then afterwards reattach them to separate, successfully duplicated versions of those actors and abilities. Still, even after I did this, they automatically changed their unit names to match one another.
In the past, sharing other actors aside from the main ones--such as "attack" or "sound" actors--hasn't been an issue because either they don't have a token they need to be attached to or their token is something that (I assume) can be shared between units like a weapon or turret.
I can't think of any other way to make these units than to create them from scratch and then manually going in to change the necessary fields to what I need, but that seems like it would be a huge pain (especially when it comes to having to manually create/link the effects).
Does anyone know what the issue is or how I can fix this?
Turns out the issue is due to how the editor stores these units in the text module.
The 'unsieged' versions of unit such as the "Siege Tank (Tank Mode)" and "Viking (Fighter)" mode are given their own entries in the text module, whereas the 'sieged' versions of the units such as the "Siege Tank (Siege Mode)" and "Viking (Assault)" use the entries of their 'unsieged' counterparts. Being linked like this makes it so if you change the name of one in the data module, the other will automatically change its name to the same thing.
If you duplicate the 'unsieged' version of the unit, the new unit will be given a new entry in the text module (ex ID: Unit/Name/Viking2). If you duplicate the 'sieged' version of the unit, the new unit will use the existing entry for the unit it was duplicated from (ex: Unit/Name/Viking).
To fix it, create the 'unsieged' version first. Then, after creating the 'sieged' version, go to the new 'sieged' unit in the data module and open the "Name" field. Change the end of the "Text Key" to match that of the 'unsieged' version you created.
Ex: Unit/Name/Viking change it to Unit/Name/Viking2