Jump to content

R&D Inventory, Items & Weapons Overhaul


anUser

Recommended Posts

Here are some changes I'm planning, or I've already implemented or I'm simply considering regarding Items, Weapons and Inventory. I know the theme is quite miscellaneous, but I think it's good to consider them together. I just open this thread to discuss how useful and/or feasible is each one.

 

1- Equippable, Buildable & configurable items - status: Done

Smoke grenade, battle scanner and rocket or blaster launcher don't require a perk to be used, it's enough just equipping the item, which can be built like any other item.

 

2- Consumible items - status: wip

The aim is to make it so used items are truly spent. Alternatively, make it so every equipped item is spent at the end of each mission, despite being used or not.

Once it's done for grenades (it's the testing subject) the same can be done for rockets. The idea is to create a buildable rocket item, so the rocketeer would need the launcher plus as many rockets s/he can or want to carry.

Setting custom initial storage and making "infinite" item finite can both be done and it works, so once items become spendable that won't be a problem.

 

3- Increased Item slots up to 6 or 8 - status: ---

Idealy this would come with a graphic rework so each item looks nice; alternatively just make it work. A refined version could allow certain items like rockets to take 2 item slots. This takes special relevance if considering next two

 

4- Ammo cartridge Items - status: ---

Making several type of ammunition for Assault rifle, LMG, Sniper and Pistol ("bullet" weapons). The idea is to make them more circumpstancial, and thus more or less useful depending on the enemies faced, and also to give the chance of spending some money to have better ammo. Some ideas:

- explosive ammo: increased damage, removes critical chance. Or it could have the heat ammo effect of doubling damage to robotic units, or that could be 2 kind of ammunition.

- piercing armor: bypasses enemy's Damage Reduction

- tracer bullets: they grant holo-targeting bonus or lower if possible (+5 is ok)

- some sort of "dirty" bullets using chemical, biological or radioactive agents: causes poisoning, or nullifies alien regeneration for a turn, or for the rest of the map, etc

Obviously since the idea is to make them buildable/spendable items their price could vary to match their power.

 

As I've thought it, soldiers could use only 1 ammo item that would last for the whole map, and preferably they'd have to equip at least 1 ammo item (cheap regular ammo if not one of the cool ammo types), so a specific slot only for ammo items would be desirable.

 

As for balancing this with laser & plasma weapons my thought was to make standard, fire weapons could be upgraded in many ways right from the start, at some cost, while plasma require huge prior investigation and laser stays in between. Actualy in the game there are few tactical choices you can make to boost your tactical combat capabilities at the expense of some other things. Sure you can buy OTS upgrades and research for the best armor or weapon instead of building some facility, but with buildable items and this temporary upgrade that would be these special ammo you could actualy spend all your monthly budget equipping your soldiers with the best material. If instead the player priorizes laser weapon at the cost of some research time and moderate investment then s/he wouldn't need to spend in ammo each battle. But that's material for another post regarding techs, I just wanted to give a little background of what I've got in mind.

 

5- Finite plasma ammunition

It's just a thought. If units could have 6 or 8 item slots, and if we could control the ammo capacity (num of shots before reloading), and if we could make that reloading a plasma weapon would remove a plasma cartridge item in that soldier's inventory, then it could be nice to have to make the choice of either carring extra ammo just in case you're short of it or carring some grenades or other items in their place. Then there would still be the problem of what to do once the unit is out of ammo... an option could be moving plasma weapons to pistol slot (glitchy and a bit lame maybe, right), option b: do nothing, that's why soldiers carry pistols, option 3, once out of ammo every shot depletes the magazine so it requires reloading, ... and I'm pretty sure many other options can be found, but that's a secondary thing

 

6- make some items incur in movement limitation when equipped. Like chithing plating and rockets, since players would be able to equip several rockets

 

7- consumible armor if it gets damaged. That's it, destroying tne armor after mission if it gets seriusly damaged. This culd be randomized or estabished on consistent basis.

 

That's it for now :) Suggestions are welcome!

Edited by anUser
Link to comment
Share on other sites

  • Replies 129
  • Created
  • Last Reply

Top Posters In This Topic

Regarding 3 --

 

My initial thoughts along this line were to change the SoldierUI screen (it shows the Abilities, Psi Abilities, Loadout, Customize and Dismiss options) to instead provide up to six options. This menu is already dynamically controllable from the upk code (turning buttons on/off (i.e. greyed out) or removing entirely (PsiAbilities)). The six new options would be similar to before, but would split Loadout into Loadout Weapons/Armor (armor, main weapon, pistol slot) and Loadout Equipment (Small Items). Since each loadout UI screen is limited to 5 items, that would allow:

 

Weapons/Armor:

1 Main Weapon

1 Armor

1 Pistol

1 Rocket Launcher

1 ?? something ?? grenades?

 

Equipment:

Up to 5 small items, based on armor/character stats and Perks.

 

Unfortunately, the SoldierUI is currently size to 5 buttons, and I don't know if it will dynamically size up. If not, it would require an AS edit to be resize the window to allow room for the sixth button to fit.

 

-----

 

This is just my thoughts from looking at the code -- I haven't tested any implementations yet.

Link to comment
Share on other sites

In and of themselves individually, each of these sounds like interesting possibilities.

 

But, speaking as one more interested generally in trying out individual ideas rather than putting together a particular monolithic 'comprehensive overhaul' mod, the discouraging aspect of consumable munitions is two fold:

 

First that adding the necessity of purchasing standard munitions means the funding must be adjusted (an entire balancing act in it's own right) or other item costs decreased to accomodate the munitions expenditures (always priority one), and ...

 

Second that the loadout process has become more tedious, even once a 'standard loadout' concept is decided upon. Bad enough that currently it's necessary to manually add your standard second grenade/armor/scopes/what-have-you to recruits/new hires if you have initially empty inventory item slots. But now you have to track and load/unload limited supplies of munitions from wounded and healthy alike? Expending all munitions at the end of a mission may be a desirable option for an overhaul mod. But I'm guessing plenty of us will skip that option just to avoid fiddling with the funding amounts. And that's okay, that's why options are such great things. I would hate to see it as an 'all or nothing' mod.

 

I'd rather see the ability to have a 'standard loadout' that fills all the empty slots by class first. But that would take some major re-factoring, I expect. However, even the ability to set up a single customizable 'standard loadout' would be an improvement in playability.

 

I don't want to sound discouraging. Just that you also need to think a bit about how to make this avoid becoming a major time sink. Too many people already think of the strategy layer in that way as it is.

 

-Dubious-

Link to comment
Share on other sites

@Amineri:

that'd be perfect. I haven't looked at the code, it was just an idea, but that'd be even better than what I had in mind. If it's truly possible to customize slot type on the first screen so it can be choosen what items can be equipped there and what not, I'd spare one of them for either armor vest (so only 1 of them is equipped) or this ammo item.

 

@dubiousintent:

neither I do monolithic stuff nor even I do mods :p it's just a brainstorming of ideas to mix and match as each one pleases. You're right maybe that wasn't clear.

Indeed making items to be consumible would require a bit of a funding rebalance, but not that much if prices are kept low, which I intend.

I understand your point about the strategic game being sometimes more of a nuissance than a "strategic game" where you actualy take strategic decisions, but precisely this consumible items are aimed at fixing this a bit, by giving the player more choices and forcing him/her to priorize. Will you always buy the best weaponry available and the best upgrades or will you rush for satellites? I managed to play a couple of missions for which I had to buy the grenades, and the sense of investment is kind of nice. At 5$ the grenade I could have spared 20$ but I didn't, and man I was thankful I didn't when I got to use them :) The last thing I want is to create yet another obligatory "ritual mouse clicking", that is what optionless choices become. Maybe forcing the player to buy standard ammunition is a bit excessive, maybe special ammo could be just a "boost" so if you've got it equipped you get the bonus, otherwise you just don't get the bonus but are still able to shoot as usual; I thought of having to equip standard ammo as to compensate the fact that special ammo would take an item slot, while you'd had already payed to build them, so it'd be a double cost over standard ammo, hence the idea of having to equip standard ammunition as well. Another idea, as I've said, is making the player has to pay for the fact of not researching new weapons, so you devote your research to other things, not developing laser weaponry? then pay for the ammo you use. For me this is a small issue because there are many overcomes and because it's subject to prior creating distinct ammo types (otherwise it makes no sense, I may plan giving plasma weapons a limited num of shots, but not standard weapons) so I don't mind this so much now.

Regarding having to equip more items before each mission, that's a price I'll gladly pay for having better control over inventory. Also please notice that injured soldiers automaticaly "release" whatever they've got equipped. And if things aren't automaticaly equipped on soldiers then you don't have to go unequipping them either.

Link to comment
Share on other sites

@Amineri:

that'd be perfect. I haven't looked at the code, it was just an idea, but that'd be even better than what I had in mind. If it's truly possible to customize slot type on the first screen so it can be choosen what items can be equipped there and what not, I'd spare one of them for either armor vest (so only 1 of them is equipped) or this ammo item.

 

I thought about that, too. One issue revolves around the trade-offs. Currently there is a decision to be made when equipping -- do I equip an armor vest for more HP, or equip something else to help me in another way.

 

If there is a dedicated "armor vest" slot, this choice goes away, to be replaced with "which armor vest should I equip?" With the existing two armor vests in the game (both with no drawbacks) there is never any reason not to equip at least a nano-fibre vest. It might be necessary to give the vests some sort of negative in order to make it a truly "hard choice". Perhaps -1 movement for nanofibre and -2 movement for Chitin plating.

 

That said, the fifth slot could go for armor vest, from a technical perspective (balancing issues aside).

 

This all assumes that the two separate equipment screens can be built. I don't think that doing so will be particularly easy ...

Link to comment
Share on other sites

Yep, im ware of that, if those were consumible that could bring the coice back but its mot optimal. I guess the solution would be scripting those so only 1 armor vest is equipped. And ys, movement limitation would be great, specialy for rockets too
Link to comment
Share on other sites

Have you considered the option of making armor consumable? I mean, if a 6 HP soldier goes out wearing 10 HP Titan Armor, and comes back with 6 HP of health, the soldier is perfectly fine, and requires no recovery time. I'd think that this means that the armor is beat to crap. Ideally it would require some repair time of its own, but barring that there could be a random roll to see if the armor is destroyed from taking too much damage.

 

Maybe something like a 50% chance if the "armor HP" is completely gone?

Link to comment
Share on other sites

Yep I hd considered it but by now all this is just theoeticalwork, theres still no way to transfer tactical data into strategy game, youve made it the other way around.. well maybe this one wouldnt be particulary hard to implement, gonna add them to the main post, pobably this could be dealt same way as consumible items. Chance of loosing armor = percentage of armor remaining hp? So receiving 4 dam in a +10hp armor is 40% chance of loosing it?
Link to comment
Share on other sites

 

1- Equippable, Buildable & configurable items - status: Done

Smoke grenade, battle scanner and rocket or blaster launcher don't require a perk to be used, it's enough just equipping the item, which can be built like any other item.

 

 

Do Battlescanners really work without any other mod? I made them buildable (with just a DGC.ini edit), and then they were equippable without any other changes, but once in a mission there was no battlescanner ability.

 

There are only two references that I see that call SetBattleScannerCharges. One is in XGAbilityTree.ApplyActionCost() to decrement the number of charges remaining when the BattleScanner ability is used.

 

The other is in XGUnit.UpdateItemCharges. The reference there is:

 

if(GetCharacter().HasUpgrade(8 ))
{
SetBattleScannerCharges(XComGameReplicationInfo(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kGameCore.2);
}
which seems to require the perk in order to get the Battlescanner ability.
Has anyone already made a hex replacement to add Battlescanner charges just based on having one equipped?
Edited by Amineri
Link to comment
Share on other sites

I have an alternative approach to item numbers 1 and 3:

1- Equippable, Buildable & configurable items
3- Increased Item slots up to 6 or 8

One issue with increasing the item slot count is that the amount of micromanagement required goes up significantly. Even with the Long War mod and the 2 item slots, I still find it slightly cumbersome to go through and equip every single soldier with 2 frag grenades at the beginning of the game (The auto-equip function equips them with 1, and leaves the 2nd slot empty).

 

At first I thought that having more item slots would be good for customization, but I'm seriously reconsidering that. My current thinking is that having two small item slots max is fine. However, I would like to see some additional customization, but without all the equipping busy-work.

 

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

 

Here's what I've done. I mutated anUser's hex code that assigns ability charges (in XGUnit.UpdateItemCharges), so that now BOTH perks and equippable items apply. This modlet is designed around making both Smoke Grenades and Battle Scanners buildable by adding to the DGC.ini the following lines:

 

 

ItemBalance=(eItem=eItem_BattleScanner, iCash=3, iElerium=0, iAlloys=0, iTime=0, iEng=4)
ItemBalance=(eItem=eItem_SmokeGrenade, iCash=3, iElerium=0, iAlloys=0, iTime=0, iEng=4)
You can tweak the cost and number of engineers, naturally. By default I would make them very cheap. I've considered adding them to the "infinite items", but haven't gone that far yet. Adding those lines will make Battle Scanners and Smoke Grenades buildable, and equippable.

 

With this change there is no longer any mystery about where the smoke grenades and battlescanners "magically" come from once Support and Sniper classes (by default) get those perks. They've always been around. What the perks do is give those classes extra "free slots" that are dedicated to holding those particular items.

 

Even rookies can make use of these items now, though (although they can't carry as much stuff, not being as experienced), which opens up a much wider range of tactical choices in the early game, making that portion of a playthrough drag a little less. However, the specialist classes can carry more, and/or can carry them as well as other items.

 

Examples:

Rookie equips a Battle Scanner : In battle, rookie gets Battle Scanner ability with 1 charge

 

Rookie equips two Battle Scanners (if Kevlar has been modded to give two small item slots) : In battle, rookie gets Battle Scanner ability with 2 charges

 

Sniper with Battle Scanner perk equips no Battle Scanners : In battle, Sniper gets Battle Scanner ability with 2 charges

 

Sniper with Battle Scanner perk equips an additional Battle Scanner : In battle, Sniper gets Battle Scanner ability with 3 charges

 

The number granted by the perk and the number granted via equipping add together to give the total number of charges.

 

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

 

I made the medikit follow the same rules. The related Support skill grants 2 medikit charges regardless of items carried. Each medikit item carried grants one additional charge. This makes the Support class a bit more powerful, especially early on against Thin Men.

 

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

 

I deprecated the specific Perk "Smoke and Mirrors". The Grenadier perk now doubles the number of grenades of types : Frag, Alien, Smoke. (but not BattleScanners)

 

Examples:

Heavy with Grenadier equips Smoke Grenade : gets Smoke Grenade ability with 2 charges.

 

Support with Smoke Grenade Perk and Grenadier equips no Smoke Grenades : gets Smoke Grenade ability with 2 charges

 

Support with Smoke Grenade Perk and Grenadier equips a Smoke Grenade : gets Smoke Grenade ability with 4 charges. (1 perk + 1 equipped = 2, the 2 is doubled to 4)

 

Note that (by default) only the Support class will get Dense Smoke. This change allows moving the Smoke Grenade perk out of the squaddie choice, since now Dense Smoke should work if the Support equips a Smoke Grenade (not tested, however). Rather than being a new buildable item, I imagine Dense Smoke grenades to be the result of the Support soldier tinkering with the standard issue Smoke Grenades.

 

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

 

As with Battlescanners, Smoke Grenades and Medikits, it should be possible to take over an unused perk and make it a "Frag Grenade" perk, that would always give the unit 2 frag grenade charges. While not great for damage in the later game, frag grenades remain useful for clearing cover. This could become particularly powerful if the unit was given access to the Bombadier perk (which extends grenade throwing range out to sight range).

 

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

 

Rockets, Shredder Rockets, Ghost, and Arc thrower charges I didn't modify. For Rockets and Shredder Rockets there are no existing items, and Ghost and Arc thrower charges are already tied to specific items.

 

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

 

The hex code changes are all to a single function : XcomGame.upk >> XGUnit.UpdateItemCharges

 

 

 

XGUnit.UpdateItemCharges consolidated hex:
original hex:
5D B1 00 00 50 55 00 00 00 00 00 00 48 B1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 25 0C 00 00 E9 89 01 00 57 06 00 00 B7 04 00 00 07 B6 00 19 1B 7B 31 00 00 00 00 00 00 16 0C 00 EA A2 00 00 00 1B B8 36 00 00 00 00 00 00 2C 30 16 1B 4B 62 00 00 00 00 00 00 90 19 1B CC 32 00 00 00 00 00 00 16 0C 00 5D A6 00 00 00 1B A7 33 00 00 00 00 00 00 24 4C 16 19 19 2E FE 2C 00 00 19 12 20 4F FE FF FF 0A 00 D8 F9 FF FF 00 1C F6 FB FF FF 16 09 00 98 F9 FF FF 00 01 98 F9 FF FF 09 00 F0 2C 00 00 00 01 F0 2C 00 00 02 00 F0 2C 00 00 00 2C 03 16 16 06 E2 00 1B 4B 62 00 00 00 00 00 00 19 1B CC 32 00 00 00 00 00 00 16 0C 00 5D A6 00 00 00 1B A7 33 00 00 00 00 00 00 24 4C 16 16 07 D4 01 19 1B 7B 31 00 00 00 00 00 00 16 0C 00 EA A2 00 00 00 1B B8 36 00 00 00 00 00 00 2C 5D 16 1B AC 62 00 00 00 00 00 00 92 19 19 2E FE 2C 00 00 19 12 20 4F FE FF FF 0A 00 D8 F9 FF FF 00 1C F6 FB FF FF 16 09 00 98 F9 FF FF 00 01 98 F9 FF FF 09 00 F0 2C 00 00 00 01 F0 2C 00 00 01 00 F0 2C 00 00 00 26 19 19 2E FE 2C 00 00 19 12 20 4F FE FF FF 0A 00 D8 F9 FF FF 00 1C F6 FB FF FF 16 09 00 98 F9 FF FF 00 01 98 F9 FF FF 09 00 F0 2C 00 00 00 01 F0 2C 00 00 01 00 F0 2C 00 00 00 26 16 16 06 3D 02 1B AC 62 00 00 00 00 00 00 19 19 2E FE 2C 00 00 19 12 20 4F FE FF FF 0A 00 D8 F9 FF FF 00 1C F6 FB FF FF 16 09 00 98 F9 FF FF 00 01 98 F9 FF FF 09 00 F0 2C 00 00 00 01 F0 2C 00 00 01 00 F0 2C 00 00 00 26 16 07 6D 02 19 1B 7B 31 00 00 00 00 00 00 16 0C 00 EA A2 00 00 00 1B B8 36 00 00 00 00 00 00 2C 16 16 1B C8 62 00 00 00 00 00 00 26 16 07 ED 03 19 1B 7B 31 00 00 00 00 00 00 16 0C 00 EA A2 00 00 00 1B B8 36 00 00 00 00 00 00 2C 2C 16 07 84 03 19 1B 7B 31 00 00 00 00 00 00 16 0C 00 EA A2 00 00 00 1B B8 36 00 00 00 00 00 00 2C 5C 16 1B DA 62 00 00 00 00 00 00 92 19 19 2E FE 2C 00 00 19 12 20 4F FE FF FF 0A 00 D8 F9 FF FF 00 1C F6 FB FF FF 16 09 00 98 F9 FF FF 00 01 98 F9 FF FF 09 00 F0 2C 00 00 00 01 F0 2C 00 00 01 00 F0 2C 00 00 00 26 19 19 2E FE 2C 00 00 19 12 20 4F FE FF FF 0A 00 D8 F9 FF FF 00 1C F6 FB FF FF 16 09 00 98 F9 FF FF 00 01 98 F9 FF FF 09 00 F0 2C 00 00 00 01 F0 2C 00 00 01 00 F0 2C 00 00 00 26 16 16 06 ED 03 1B DA 62 00 00 00 00 00 00 19 19 2E FE 2C 00 00 19 12 20 4F FE FF FF 0A 00 D8 F9 FF FF 00 1C F6 FB FF FF 16 09 00 98 F9 FF FF 00 01 98 F9 FF FF 09 00 F0 2C 00 00 00 01 F0 2C 00 00 01 00 F0 2C 00 00 00 26 16 07 7C 04 19 1B 7B 31 00 00 00 00 00 00 16 0C 00 EA A2 00 00 00 1B B8 36 00 00 00 00 00 00 2C 08 16 1B 63 61 00 00 00 00 00 00 19 19 2E FE 2C 00 00 19 12 20 4F FE FF FF 0A 00 D8 F9 FF FF 00 1C F6 FB FF FF 16 09 00 98 F9 FF FF 00 01 98 F9 FF FF 09 00 F0 2C 00 00 00 01 F0 2C 00 00 02 00 F0 2C 00 00 00 2C 02 16 07 C0 05 19 1B 7B 31 00 00 00 00 00 00 16 0C 00 EA A2 00 00 00 1B B8 36 00 00 00 00 00 00 2C 18 16 1B E9 61 00 00 00 00 00 00 90 19 1B CC 32 00 00 00 00 00 00 16 0C 00 5D A6 00 00 00 1B A7 33 00 00 00 00 00 00 24 55 16 19 19 2E FE 2C 00 00 19 12 20 4F FE FF FF 0A 00 D8 F9 FF FF 00 1C F6 FB FF FF 16 09 00 98 F9 FF FF 00 01 98 F9 FF FF 09 00 F0 2C 00 00 00 01 F0 2C 00 00 02 00 F0 2C 00 00 00 2C 02 16 16 1B 40 61 00 00 00 00 00 00 90 19 1B CC 32 00 00 00 00 00 00 16 0C 00 5D A6 00 00 00 1B A7 33 00 00 00 00 00 00 24 58 16 19 19 2E FE 2C 00 00 19 12 20 4F FE FF FF 0A 00 D8 F9 FF FF 00 1C F6 FB FF FF 16 09 00 98 F9 FF FF 00 01 98 F9 FF FF 09 00 F0 2C 00 00 00 01 F0 2C 00 00 02 00 F0 2C 00 00 00 2C 02 16 16 06 18 06 1B E9 61 00 00 00 00 00 00 19 1B CC 32 00 00 00 00 00 00 16 0C 00 5D A6 00 00 00 1B A7 33 00 00 00 00 00 00 24 55 16 16 1B 40 61 00 00 00 00 00 00 19 1B CC 32 00 00 00 00 00 00 16 0C 00 5D A6 00 00 00 1B A7 33 00 00 00 00 00 00 24 58 16 16 1B FE 61 00 00 00 00 00 00 2C 04 16 1B 58 61 00 00 00 00 00 00 90 19 1B CC 32 00 00 00 00 00 00 16 0C 00 5D A6 00 00 00 1B A7 33 00 00 00 00 00 00 24 50 16 2C 02 16 16 04 0B 53
new hex:
5D B1 00 00 50 55 00 00 00 00 00 00 48 B1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 25 0C 00 00 E9 89 01 00 17 05 00 00 B7 04 00 00 07 31 00 19 1B 7B 31 00 00 00 00 00 00 16 0C 00 EA A2 00 00 00 1B B8 36 00 00 00 00 00 00 2C 30 16 1B 4B 62 00 00 00 00 00 00 2C 02 16 07 B2 00 97 19 1B CC 32 00 00 00 00 00 00 16 0C 00 5D A6 00 00 00 1B A7 33 00 00 00 00 00 00 24 4C 16 25 16 19 1B 7B 31 00 00 00 00 00 00 16 0C 00 EA A2 00 00 00 1B B7 35 00 00 00 00 00 00 2C 30 16 1B 4B 62 00 00 00 00 00 00 92 01 B2 30 00 00 19 1B CC 32 00 00 00 00 00 00 16 0C 00 5D A6 00 00 00 1B A7 33 00 00 00 00 00 00 24 4C 16 16 16 07 E6 00 19 1B 7B 31 00 00 00 00 00 00 16 0C 00 EA A2 00 00 00 1B B8 36 00 00 00 00 00 00 2C 5D 16 1B AC 62 00 00 00 00 00 00 2C 02 16 06 F2 00 1B AC 62 00 00 00 00 00 00 2C 01 16 07 23 01 19 1B 7B 31 00 00 00 00 00 00 16 0C 00 EA A2 00 00 00 1B B8 36 00 00 00 00 00 00 2C 16 16 1B C8 62 00 00 00 00 00 00 2C 01 16 07 54 01 19 1B 7B 31 00 00 00 00 00 00 16 0C 00 EA A2 00 00 00 1B B8 36 00 00 00 00 00 00 2C 08 16 1B 63 61 00 00 00 00 00 00 2C 02 16 07 D5 01 97 19 1B CC 32 00 00 00 00 00 00 16 0C 00 5D A6 00 00 00 1B A7 33 00 00 00 00 00 00 24 63 16 25 16 19 1B 7B 31 00 00 00 00 00 00 16 0C 00 EA A2 00 00 00 1B B7 35 00 00 00 00 00 00 2C 08 16 1B 63 61 00 00 00 00 00 00 92 01 AD 30 00 00 19 1B CC 32 00 00 00 00 00 00 16 0C 00 5D A6 00 00 00 1B A7 33 00 00 00 00 00 00 24 63 16 16 16 07 06 02 19 1B 7B 31 00 00 00 00 00 00 16 0C 00 EA A2 00 00 00 1B B8 36 00 00 00 00 00 00 2C 2C 16 1B DA 62 00 00 00 00 00 00 2C 01 16 07 87 02 97 19 1B CC 32 00 00 00 00 00 00 16 0C 00 5D A6 00 00 00 1B A7 33 00 00 00 00 00 00 24 56 16 25 16 19 1B 7B 31 00 00 00 00 00 00 16 0C 00 EA A2 00 00 00 1B B7 35 00 00 00 00 00 00 2C 2C 16 1B DA 62 00 00 00 00 00 00 92 01 AE 30 00 00 19 1B CC 32 00 00 00 00 00 00 16 0C 00 5D A6 00 00 00 1B A7 33 00 00 00 00 00 00 24 56 16 16 16 07 26 03 19 1B 7B 31 00 00 00 00 00 00 16 0C 00 EA A2 00 00 00 1B B8 36 00 00 00 00 00 00 2C 18 16 1B E9 61 00 00 00 00 00 00 90 19 1B CC 32 00 00 00 00 00 00 16 0C 00 5D A6 00 00 00 1B A7 33 00 00 00 00 00 00 24 55 16 2C 02 16 16 1B 40 61 00 00 00 00 00 00 90 19 1B CC 32 00 00 00 00 00 00 16 0C 00 5D A6 00 00 00 1B A7 33 00 00 00 00 00 00 24 58 16 2C 02 16 16 1B DA 62 00 00 00 00 00 00 90 01 AE 30 00 00 2C 02 16 16 06 7E 03 1B E9 61 00 00 00 00 00 00 19 1B CC 32 00 00 00 00 00 00 16 0C 00 5D A6 00 00 00 1B A7 33 00 00 00 00 00 00 24 55 16 16 1B 40 61 00 00 00 00 00 00 19 1B CC 32 00 00 00 00 00 00 16 0C 00 5D A6 00 00 00 1B A7 33 00 00 00 00 00 00 24 58 16 16 1B FE 61 00 00 00 00 00 00 2C 04 16 1B 58 61 00 00 00 00 00 00 90 19 1B CC 32 00 00 00 00 00 00 16 0C 00 5D A6 00 00 00 1B A7 33 00 00 00 00 00 00 24 50 16 2C 02 16 16 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 04 0B 53

 

 

 

Similar to anUser's mod (which made charges based solely on items) there is a lot of free space left to add more functionality if it is needed.

 

The decompiled code :

 

 

 

function UpdateItemCharges()
{
// End:0x31
if(GetCharacter().HasUpgrade(48))
{
SetMediKitCharges(2);
}
// End:0xB2
if(GetInventory().GetNumItems(76) > 0)
{
GetCharacter().GivePerk(48);
SetMediKitCharges(m_iMediKitCharges + GetInventory().GetNumItems(76));
}
// End:0xE6
if(GetCharacter().HasUpgrade(93))
{
SetRockets(2);
}
// End:0xF2
else
{
SetRockets(1);
}
// End:0x123
if(GetCharacter().HasUpgrade(22))
{
SetShredderRockets(1);
}
// End:0x154
if(GetCharacter().HasUpgrade(8))
{
SetBattleScannerCharges(2);
}
// End:0x1D5
if(GetInventory().GetNumItems(99) > 0)
{
GetCharacter().GivePerk(8);
SetBattleScannerCharges(m_iBattleScanners + GetInventory().GetNumItems(99));
}
// End:0x206
if(GetCharacter().HasUpgrade(44))
{
SetSmokeGrenadeCharges(1);
}
// End:0x287
if(GetInventory().GetNumItems(86) > 0)
{
GetCharacter().GivePerk(44);
SetSmokeGrenadeCharges(m_iSmokeGrenades + GetInventory().GetNumItems(86));
}
// End:0x326
if(GetCharacter().HasUpgrade(24))
{
SetFragGrenades(GetInventory().GetNumItems(85) * 2);
SetAlienGrenades(GetInventory().GetNumItems(88) * 2);
SetSmokeGrenadeCharges(m_iSmokeGrenades * 2);
}
// End:0x37E
else
{
SetFragGrenades(GetInventory().GetNumItems(85));
SetAlienGrenades(GetInventory().GetNumItems(88));
}
SetGhostCharges(4);
SetArcThrowerCharges(GetInventory().GetNumItems(80) * 2);
//return;
}

 

 

 

As anUser discovered, the ability is only made available if the unit has the appropriate perk, regardless of the number of charges set.

 

To get around this, I first apply charges based on whether the unit has the appropriate perk.

I then check to see if the unit is carrying any of the appropriate items. If it is carrying an item, then the unit is given the perk (if it already has it, the calling function does not increment the perk array) and is granted additional charges based on the number of items carried.

 

Feedback and/or suggestions are (as always) welcome.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...