Jump to content

Weapons to all classes


zeye

Recommended Posts

Some things could be modded to require a certain weapon while others can't.

 

In general the availability of abilities isn't something I've figured out yet how to mod. This is determined by the XGUnit.BuildAbilities native function. It builds a dynamic array of available abilities for the unit depending on a whole bunch of particular circumstances. The only way I can think of to try and limit abilities would be to mod the UITacticalHUD_AbilityContainer to prevent the ability from showing up and being selectable.

 

However, many passive abilities are tied to weapons in accessible places in the UPK code. This is how I unlocked Bullet Swarm from Heavy and Double Tap from Sniper.

 

One way to lock a perk to an weapon is to remove it from the perk tree and make the weapon grant the perk when equipping it (this requires the new item mod, which is up on the wiki but not exactly 100% yet, although it's now getting a lot of testing in the Long War 1.9 Alpha and Merciless 1.5 Beta). It is also limited to only one perk per item ... "limited" ... :)

Link to comment
Share on other sites

Aye, both Merciless and Long War have certainly grown new limbs. I'm still dabbling with the less novel modlets, aiming for a magical balance of the (now) traditional and eclectic features. Part of that is my burning desire to actually understand what's here currently, and, being utterly illiterate with absolutely no experience in coding previously, that's quite an obstacle. Baby steps, though I'm soaking it up like a sponge.

 

Hmm. Interesting, Flush as built in for Heavy Weapons. . . which are only equipable by a Heavy. . . freeing a perk slot for the Heavy. . . interesting option.

 

As for passive perks and the potential for UPK edits thereby, I noticed that "Executioner" works with pistols in Vanilla (or LW 1.08) and now too with my Assault Rifle wielding Snipers. Would it be a simple matter to get that 'married' to the Sniper Rifle only or would that require a rewrite and some byte hijacks (well beyond me)?

Edited by Zybertryx
Link to comment
Share on other sites

Unfortunately the m_iHitChance value is one of the major values that is computed in the native code, so it is difficult to modify. In fact, the amount of to-hit bonus (+10) and HP Threshold (50%) were defined as constants and so ended up hard-coded into the native code as well and so haven't been moddable.

 

The only way to modify the hit chance is to change it after the fact. The function AdjustToHit does this (in vanilla it applied "cheat" bonuses for the player in Easy/Normal), but the values adjusted there aren't reflected by default in the UI (i.e. when the vanilla game cheated for the player by increasing the to-hit chance, it still displayed the old hit chance).

 

That is what made the Squadsight aim penalty so tricky to implement. I had to (a) adjust the to-hit value (b) trick the UI into using the adjusted value instead of the regular value © update the shot to-hit breakdown to include the squadsight amount.

 

Sooo.... I guess the answer is that Executioner would be possible to limit to Snipers only, but only in an awkward, roundabout manner.

 

-------------------

 

Of course, if someone works out how to mod the native code in the xcomgame.exe executable many more things will be possible. Apparently some settings in the executable end up customized per installation (as Yzaxtol has discovered), making exe mods a bit trickier.

Link to comment
Share on other sites

Apparently some settings in the executable end up customized per installation (as Yzaxtol has discovered), making exe mods a bit trickier.

I haven't heard about the issue of differing vanilla executables before. Is there a link to a discussion about this or where Yzaxtol mentioned it? Thanks :smile:
Link to comment
Share on other sites

Just 100% of the attempts of running the mod after an exe was completely overwritten turned out to be useless and wouldn't run. However, whenever I modded it manually and all the people who followed my instruction on how to mod the exe manually have it working.

Link to comment
Share on other sites

Umm. Not to be a wet blanket, but redistributing the EXE, modded or not, is a copyright violation and against Nexus policy. Patching it is another matter, because you are only affecting the copy of the game you purchased. So, be glad it didn't work, and don't try to make it work. (Or at the very least, don't talk about it here.)

 

-Dubious- (who would hate to lose you through careless chatter. And if you didn't actually try to distribute the EXE, be clearer next time.)

Edited by dubiousintent
Link to comment
Share on other sites

I meant every time I installed it on my machine using an installer that it failed to work and but it DID work when I manually went in to only change that single HEX byte to get it to import data from an external .ini file and with everyone else who followed my instructions.

Link to comment
Share on other sites

Umm. Not to be a wet blanket, but redistributing the EXE, modded or not, is a copyright violation and against Nexus policy. Patching it is another matter, because you are only affecting the copy of the game you purchased. So, be glad it didn't work, and don't try to make it work. (Or at the very least, don't talk about it here.)

 

-Dubious- (who would hate to lose you through careless chatter. And if you didn't actually try to distribute the EXE, be clearer next time.)

Not wanting to start a debate or anything... But where can I read more about this?

 

I have double checked the terms of service for this site and I can not find that a mod-installer is not allowed to replace an original game file (.exe or not) with a modded game file for the explicit and limited purpuse of implementing a mod. In fact it seems to be a very common way of mod-distribution.

Edited by Bertilsson
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...