Two questions regarding LW2

Post Reply
John Luke Pack Hard
Posts: 11
Joined: Mon Mar 20, 2017 9:05 am

Two questions regarding LW2

Post by John Luke Pack Hard »

So here's what I have so far for my Technical Heavy Weapon Reload script: https://pastebin.com/e6dzqBnP

Built only once, had two unique errors, fixed presumably, not tested yet. If you help me go through it I'll credit you.

My question is, how does one add abilities to a class without explicitly listing it in the ClassData config, which causes it to show up in the class abilities display, similar to how Pavonis added the LWRocketLauncher ability and the LWFlamethrower ability to the technical without explicitly listing it in the class ability configs. As far as I can tell the Technical ability listed "Heavy Armaments" is a PurePassive meaning it is a cosmetic ability that is used as a placeholder and, while can be used as a trigger, does nothing functional.

Second, I figure I might as well test out something smaller, so one of my original ideas was to remove the weaker continent bonuses from LW2's continent bonus pool and re-implement the removed ones as proving grounds projects costing 200 supplies and 300 intel a la Advanced Modular Weapons, since said mod is incompatible with LW2. The prices are similar to what one would spend conventionally contacting a continent and constructing relays across it.

Where does one find the script on adding and removing continent bonuses for LW2, seeing as how mods that work with vanilla that specify starting continent bonii don't work with Long War 2? I have trawled through the LW scripts multiple times and have not found a single reference to modified continent bonii other than the new "Wired" bonus.

Further down the line, how would one hypothetically activate removed continent bonuses as an implementable Proving Ground project that unlocks after researching Resistance Radio?
tracktwo
Long War Dev
Posts: 241
Joined: Sat Jan 07, 2017 7:43 pm

Re: Two questions regarding LW2

Post by tracktwo »

As for the first question, the rocket launcher and flame thrower abilities are not attached to the technical class, they're attached to the gauntlet secondary weapon. Look in X2Item_LWGauntlet.CreateTemplate_Gauntlet_Conventional() (for example):

Code: Select all

	Template.Abilities.AddItem('LWRocketLauncher');
	Template.Abilities.AddItem('RocketFuse');
	Template.Abilities.AddItem('LWFlamethrower');
For the second, I am not super familiar with that code but I believe the continent bonuses are removed from the deck by X2DownloadableContentInfo_LW_Overhaul.UpdateLockAndLoadBonus(). Not the best named function, presumably it started out as just changing lock n load but more stuff was added to it over time and it was never renamed.
John Luke Pack Hard
Posts: 11
Joined: Mon Mar 20, 2017 9:05 am

Re: Two questions regarding LW2

Post by John Luke Pack Hard »

Oh cool, I looked it up. I see it. I think I understand it. So to override it with the reload abilities added do I completely replace the whole function, code and all, or do I just create a function with the additional reload abilities added only?

Also, where do I find an example of a reload condition? Apparently I need to manually code a condition to prevent the player from overloading the gauntlet by coding in a condition checking if the gauntlet is at max ammo or max charges via Xmodbase. Where can I access the variable on rocket ammo?

As an extra aside to that, how does one access the exact template on the flamethrower/rocket launcher tied to the soldier? Do I access the soldier object first and then get the flamethrower like "XComGameState_Unit(AffectState).getSecondaryWeapon.getAbility('LWFlamethrower')", or do I get the flamethrower directly a la "class'LWFlamethrower'"?

EDIT: I also read through the referenced function on replacing continent bonii. It seems that function replaces lock and load, fire when ready, and suit up with other continent bonii that are more compatible, am I correct? If so it shouldn't affect how other mods interact with the continent bonuses of LW2. Why do mods like fewer weaker continent bonuses fail to affect Long War 2's starting continent bonuses?
Post Reply