anUser Posted March 22, 2013 Share Posted March 22, 2013 I've always thought it'd be nice to be able to equip more of the cool stuff into your item slot, and today I gave it a try at hex scripting and got it done! :) the function responsible for item charges is in XComGame.XGUnit.UpdateItemCharges() function UpdateItemCharges() { // End:0xB6 if(GetCharacter().HasUpgrade(48)) { SetMediKitCharges(GetInventory().GetNumItems(76) * XComGameReplicationInfo(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kGameCore.3); } // End:0xE2 else { SetMediKitCharges(GetInventory().GetNumItems(76)); } // End:0x1D4 if(GetCharacter().HasUpgrade(93)) { SetRockets(XComGameReplicationInfo(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kGameCore.1 + XComGameReplicationInfo(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kGameCore.1); } // End:0x23D else { SetRockets(XComGameReplicationInfo(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kGameCore.1); } // End:0x26D if(GetCharacter().HasUpgrade(22)) { SetShredderRockets(1); } // End:0x3ED if(GetCharacter().HasUpgrade(44)) { // End:0x384 if(GetCharacter().HasUpgrade(92)) { SetSmokeGrenadeCharges(XComGameReplicationInfo(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kGameCore.1 + XComGameReplicationInfo(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kGameCore.1); } // End:0x3ED else { SetSmokeGrenadeCharges(XComGameReplicationInfo(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kGameCore.1); } } // End:0x47C if(GetCharacter().HasUpgrade(8)) { SetBattleScannerCharges(XComGameReplicationInfo(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kGameCore.2); } // End:0x5C0 if(GetCharacter().HasUpgrade(24)) { SetFragGrenades(GetInventory().GetNumItems(85) * XComGameReplicationInfo(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kGameCore.2); SetAlienGrenades(GetInventory().GetNumItems(88) * XComGameReplicationInfo(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kGameCore.2); } // End:0x618 else { SetFragGrenades(GetInventory().GetNumItems(85)); SetAlienGrenades(GetInventory().GetNumItems(88)); } SetGhostCharges(4); SetArcThrowerCharges(GetInventory().GetNumItems(80) * 2); //return; } which now I changed to read: function UpdateItemCharges() { SetMediKitCharges(GetInventory().GetNumItems(76) * (1 + (GetCharacter().HasUpgrade(48) * 2))); SetRockets((GetInventory().GetNumItems(7) + GetInventory().GetNumItems(19)) * (1 + (GetCharacter().HasUpgrade(93) * 1))); SetShredderRockets((GetInventory().GetNumItems(7) + GetInventory().GetNumItems(19)) * (0 + (GetCharacter().HasUpgrade(22) * 1))); SetFragGrenades(GetInventory().GetNumItems(85) * (1 + (GetCharacter().HasUpgrade(24) * 1))); SetAlienGrenades(GetInventory().GetNumItems(88) * (1 + (GetCharacter().HasUpgrade(24) * 1))); SetSmokeGrenadeCharges((GetCharacter().HasUpgrade(44) * 1) + (GetInventory().GetNumItems(77) * (2 + (GetCharacter().HasUpgrade(24) * 1)))); SetArcThrowerCharges(GetInventory().GetNumItems(80) * 2); SetGhostCharges(GetInventory().GetNumItems(78) * 5); //return; } which in ('''my''') hex is: 3A B1 00 00 47 55 00 00 00 00 00 00 25 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 FB 04 00 00 B7 04 00 00 1B 3D 62 00 00 00 00 00 00 90 19 1B C5 32 00 00 00 00 00 00 16 0C 00 3A A6 00 00 00 1B A0 33 00 00 00 00 00 00 24 4C 16 AE 2C 01 90 19 1B 74 31 00 00 00 00 00 00 16 0C 00 C7 A2 00 00 00 1B B0 36 00 00 00 00 00 00 2C 30 16 2C 02 16 16 16 16 1B 9E 62 00 00 00 00 00 00 90 AE 19 1B C5 32 00 00 00 00 00 00 16 0C 00 3A A6 00 00 00 1B A0 33 00 00 00 00 00 00 24 07 16 19 1B C5 32 00 00 00 00 00 00 16 0C 00 3A A6 00 00 00 1B A0 33 00 00 00 00 00 00 24 13 16 16 AE 2C 01 90 19 1B 74 31 00 00 00 00 00 00 16 0C 00 C7 A2 00 00 00 1B B0 36 00 00 00 00 00 00 2C 5D 16 2C 01 16 16 16 16 1B BA 62 00 00 00 00 00 00 90 AE 19 1B C5 32 00 00 00 00 00 00 16 0C 00 3A A6 00 00 00 1B A0 33 00 00 00 00 00 00 24 07 16 19 1B C5 32 00 00 00 00 00 00 16 0C 00 3A A6 00 00 00 1B A0 33 00 00 00 00 00 00 24 13 16 16 AE 2C 00 90 19 1B 74 31 00 00 00 00 00 00 16 0C 00 C7 A2 00 00 00 1B B0 36 00 00 00 00 00 00 2C 16 16 2C 01 16 16 16 16 1B DB 61 00 00 00 00 00 00 90 19 1B C5 32 00 00 00 00 00 00 16 0C 00 3A A6 00 00 00 1B A0 33 00 00 00 00 00 00 24 55 16 AE 2C 01 90 19 1B 74 31 00 00 00 00 00 00 16 0C 00 C7 A2 00 00 00 1B B0 36 00 00 00 00 00 00 2C 18 16 2C 01 16 16 16 16 1B 33 61 00 00 00 00 00 00 90 19 1B C5 32 00 00 00 00 00 00 16 0C 00 3A A6 00 00 00 1B A0 33 00 00 00 00 00 00 24 58 16 AE 2C 01 90 19 1B 74 31 00 00 00 00 00 00 16 0C 00 C7 A2 00 00 00 1B B0 36 00 00 00 00 00 00 2C 18 16 2C 01 16 16 16 16 1B CC 62 00 00 00 00 00 00 AE 90 19 1B 74 31 00 00 00 00 00 00 16 0C 00 C7 A2 00 00 00 1B B0 36 00 00 00 00 00 00 2C 2C 16 2C 01 16 90 19 1B C5 32 00 00 00 00 00 00 16 0C 00 3A A6 00 00 00 1B A0 33 00 00 00 00 00 00 24 4D 16 AE 2C 02 90 19 1B 74 31 00 00 00 00 00 00 16 0C 00 C7 A2 00 00 00 1B B0 36 00 00 00 00 00 00 2C 18 16 2C 01 16 16 16 16 16 1B 4B 61 00 00 00 00 00 00 90 19 1B C5 32 00 00 00 00 00 00 16 0C 00 3A A6 00 00 00 1B A0 33 00 00 00 00 00 00 24 50 16 2C 02 16 16 1B F0 61 00 00 00 00 00 00 90 19 1B C5 32 00 00 00 00 00 00 16 0C 00 3A A6 00 00 00 1B A0 33 00 00 00 00 00 00 24 4E 16 2C 05 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 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 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 00 00 00 02 00 02 00 32 6E 00 00 00 00 00 00 and still got plenty of space left to script, almost half file. original hex (in my game, it will probaly differ from yours, but if you check function calls you may see there's the same hex offset for each function reference, so you'd increase or decrease each of the function refs if copy-pasting from my code, or preferably looking at the structure to script it yourself) 3A B1 00 00 47 55 00 00 00 00 00 00 25 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 74 31 00 00 00 00 00 00 16 0C 00 C7 A2 00 00 00 1B B0 36 00 00 00 00 00 00 2C 30 16 1B 3D 62 00 00 00 00 00 00 90 19 1B C5 32 00 00 00 00 00 00 16 0C 00 3A A6 00 00 00 1B A0 33 00 00 00 00 00 00 24 4C 16 19 19 2E FA 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 EC 2C 00 00 00 01 EC 2C 00 00 02 00 EC 2C 00 00 00 2C 03 16 16 06 E2 00 1B 3D 62 00 00 00 00 00 00 19 1B C5 32 00 00 00 00 00 00 16 0C 00 3A A6 00 00 00 1B A0 33 00 00 00 00 00 00 24 4C 16 16 07 D4 01 19 1B 74 31 00 00 00 00 00 00 16 0C 00 C7 A2 00 00 00 1B B0 36 00 00 00 00 00 00 2C 5D 16 1B 9E 62 00 00 00 00 00 00 92 19 19 2E FA 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 EC 2C 00 00 00 01 EC 2C 00 00 01 00 EC 2C 00 00 00 26 19 19 2E FA 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 EC 2C 00 00 00 01 EC 2C 00 00 01 00 EC 2C 00 00 00 26 16 16 06 3D 02 1B 9E 62 00 00 00 00 00 00 19 19 2E FA 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 EC 2C 00 00 00 01 EC 2C 00 00 01 00 EC 2C 00 00 00 26 16 07 6D 02 19 1B 74 31 00 00 00 00 00 00 16 0C 00 C7 A2 00 00 00 1B B0 36 00 00 00 00 00 00 2C 16 16 1B BA 62 00 00 00 00 00 00 26 16 07 ED 03 19 1B 74 31 00 00 00 00 00 00 16 0C 00 C7 A2 00 00 00 1B B0 36 00 00 00 00 00 00 2C 2C 16 07 84 03 19 1B 74 31 00 00 00 00 00 00 16 0C 00 C7 A2 00 00 00 1B B0 36 00 00 00 00 00 00 2C 5C 16 1B CC 62 00 00 00 00 00 00 92 19 19 2E FA 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 EC 2C 00 00 00 01 EC 2C 00 00 01 00 EC 2C 00 00 00 26 19 19 2E FA 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 EC 2C 00 00 00 01 EC 2C 00 00 01 00 EC 2C 00 00 00 26 16 16 06 ED 03 1B CC 62 00 00 00 00 00 00 19 19 2E FA 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 EC 2C 00 00 00 01 EC 2C 00 00 01 00 EC 2C 00 00 00 26 16 07 7C 04 19 1B 74 31 00 00 00 00 00 00 16 0C 00 C7 A2 00 00 00 1B B0 36 00 00 00 00 00 00 2C 08 16 1B 56 61 00 00 00 00 00 00 19 19 2E FA 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 EC 2C 00 00 00 01 EC 2C 00 00 02 00 EC 2C 00 00 00 2C 02 16 07 C0 05 19 1B 74 31 00 00 00 00 00 00 16 0C 00 C7 A2 00 00 00 1B B0 36 00 00 00 00 00 00 2C 18 16 1B DB 61 00 00 00 00 00 00 90 19 1B C5 32 00 00 00 00 00 00 16 0C 00 3A A6 00 00 00 1B A0 33 00 00 00 00 00 00 24 55 16 19 19 2E FA 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 EC 2C 00 00 00 01 EC 2C 00 00 02 00 EC 2C 00 00 00 2C 02 16 16 1B 33 61 00 00 00 00 00 00 90 19 1B C5 32 00 00 00 00 00 00 16 0C 00 3A A6 00 00 00 1B A0 33 00 00 00 00 00 00 24 58 16 19 19 2E FA 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 EC 2C 00 00 00 01 EC 2C 00 00 02 00 EC 2C 00 00 00 2C 02 16 16 06 18 06 1B DB 61 00 00 00 00 00 00 19 1B C5 32 00 00 00 00 00 00 16 0C 00 3A A6 00 00 00 1B A0 33 00 00 00 00 00 00 24 55 16 16 1B 33 61 00 00 00 00 00 00 19 1B C5 32 00 00 00 00 00 00 16 0C 00 3A A6 00 00 00 1B A0 33 00 00 00 00 00 00 24 58 16 16 1B F0 61 00 00 00 00 00 00 2C 04 16 1B 4B 61 00 00 00 00 00 00 90 19 1B C5 32 00 00 00 00 00 00 16 0C 00 3A A6 00 00 00 1B A0 33 00 00 00 00 00 00 24 50 16 2C 02 16 16 04 0B 53 00 00 00 02 00 02 00 32 6E 00 00 00 00 00 00 With this changes now it gives the unit 1 rocket per launcher or 2 per launcher if got rocketeer ability + 1 shredder rocket per launcher if got shredder ability, but the way it's written it's easy to change how many rockets per launcher and how many extra rockets per launcher if got rocketeer. (to make units able to carry more than one launcher you've got to make them small items in the DGC.ini) --> (in my game I moved rockets to assault and I left machinegun 2nd slot empty, but boosted MG) medikits assignement have been compacted as well and now it's easy to set how many charges per medikit and how many extra charges per medikit if unit got Field Medic Smoke grenades, now you can use combat Stims as smoke grenades. The sentence now lets you set how many smoke grenades you'll give the unit just for having smoke grenade ability, how many more per combatStim item equipped, and how many more per combatStims equipped if unit got the '''grenadier''' ability (this can be changed to Smoke and Mirrors, it's just one number) And finally, Mind Shield now gives 5 Ghost ability charges. If every armor is set to have ghost ability, this item can be used with every armor. You might notice I've deleted battle scanner, that's cause I don't use them, you may want to just copy paste the original sentence for them. A few thoughts about items and equippable stuff- I think making ghost abilty more flexible and make it takes 1 item slot is deserved considering it's usefulness (not just for hidding, hope you've noticed it gives you +100% critical hit if invisible, and I'd swear you become visible after the second shot in a rapid fire)- this may free an armor slot, since the main feature/characteristic of ghost armor was ghost ability, so it can remain as "level 2" light armor, or it can be changed into something else, and have real variety as for mobility, extra HP, equippable items, and maybe damage reduction?- I don't like being able to stack nanofiber vest and chiting plating, it feels completely overpowered... so maybe ghost armor could become made of chryssalid (with due requirements) and the chiting plating item could be fred for some other use, since there are few equippable items (I'd really like some flashbang grenades, but there are other possible uses).... some idea to improve the overall effect? @ modders & scripters:I've found that those "XComGameReplicationInfo(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kGameCore.1" can be replaced by just "1" (I really mean it, the whole sentence replaced by 2C 01, it works). Can someone explain me why is the game generating such apparently useless data? Link to comment Share on other sites More sharing options...
Amineri Posted March 23, 2013 Share Posted March 23, 2013 I@ modders & scripters:I've found that those "XComGameReplicationInfo(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kGameCore.1" can be replaced by just "1" (I really mean it, the whole sentence replaced by 2C 01, it works). Can someone explain me why is the game generating such apparently useless data? I believe all of those values were of type const. The dev's compiler would give them the option of keeping them as variables (to aid in debugging, I guess), or to replace the uses of the const with the actual value (runs faster). Apparently it keeps the Replication call, though, since the optimizer doesn't understand about that (it just sees the defined const and replaces it). That's my guess. Link to comment Share on other sites More sharing options...
anUser Posted March 23, 2013 Author Share Posted March 23, 2013 I believe all of those values were of type const. The dev's compiler would give them the option of keeping them as variables (to aid in debugging, I guess), or to replace the uses of the const with the actual value (runs faster). Apparently it keeps the Replication call, though, since the optimizer doesn't understand about that (it just sees the defined const and replaces it). That's my guess. Well, since we can't edit constants I assume it should be safe to change those replicationInfo, right? I haven't had any problem so far... Got a couple of questions about items and abilities, and I was wondering if some of you guys have experimented with / succeeding at: 1) Getting extra equippable items (either to be used as a placeholder for ability charges or actually items with abilities, such as grapple, some shiv cannon to be used in the rocket slot ala demolition man, etc. It'd be great too if alien weapons or those eItem_PlaceholderWeapon in XGGameData.EItemType could be used by the player, to make more weapon variants) 2) Removing the perk requirement for some abilities like fire rocket, smoke grenade or battle scanner, thus making those depend only on equipped items (class restriction may still apply separately) Link to comment Share on other sites More sharing options...
anUser Posted March 29, 2013 Author Share Posted March 29, 2013 (edited) I found a workaround to fix #2 - giving each unit the Smoke Grenade ability and giving Fire Rocket to *Assault* class. So as now the Heavy class it's only a machinegunner, it doesn't need the secondary slot, (I even think it's natural a machinegunner has to save space for ammo) so by skipping the call that gives the rocket weapon once a unit is assigned as Heavy, we save space enough to make several calls to GivePerk(), which happens to be a class function. This way the game fills the empty slot with the default icon, and since rocket launchers have been moved to assault there's no weapon to chose from for that slot so it looks nice. Function: XComStrategyGame >> XGStrategySoldier >> SetClass function SetClass(XComGame.XGTacticalGameCoreData.ESoldierClass eNewClass) { local TInventory kNewLoadout; m_kSoldier.kClass.eType = eNewClass; kNewLoadout = m_kChar.kInventory; m_kChar.eClass = eNewClass; m_kSoldier.kClass.strName = class'XGLocalizedData'.default.SoldierClassNames[eNewClass]; switch(eNewClass) { // End:0x191 case 1: m_kSoldier.kClass.eWeaponType = 7; TACTICAL().TInventoryLargeItemsSetItem(kNewLoadout, 0, 6); // End:0x18E if(IsInjured()) { TACTICAL().TInventoryLargeItemsSetItem(m_kInjuredLoadout, 0, 6); } // End:0x42F break; // End:0x230 case 3: m_kSoldier.kClass.eWeaponType = 4; TACTICAL().TInventoryLargeItemsSetItem(kNewLoadout, 0, 3); // End:0x22D if(IsInjured()) { TACTICAL().TInventoryLargeItemsSetItem(m_kInjuredLoadout, 0, 3); } // End:0x42F break; // End:0x327 case 2: m_kSoldier.kClass.eWeaponType = 8; TACTICAL().TInventoryLargeItemsSetItem(kNewLoadout, 0, 5); TACTICAL().TInventoryLargeItemsSetItem(kNewLoadout, 1, 7); // End:0x324 if(IsInjured()) { TACTICAL().TInventoryLargeItemsSetItem(m_kInjuredLoadout, 0, 5); TACTICAL().TInventoryLargeItemsSetItem(m_kInjuredLoadout, 1, 7); } // End:0x42F break; // End:0x3C6 case 4: m_kSoldier.kClass.eWeaponType = 6; TACTICAL().TInventoryLargeItemsSetItem(kNewLoadout, 0, 4); // End:0x3C3 if(IsInjured()) { TACTICAL().TInventoryLargeItemsSetItem(m_kInjuredLoadout, 0, 4); } // End:0x42F break; // End:0x42C case 5: m_kSoldier.kClass.eWeaponType = 4; TACTICAL().TInventoryLargeItemsSetItem(kNewLoadout, 0, 3); // End:0x42F break; // End:0xFFFF default: LOCKERS().ApplySoldierLoadout(self, kNewLoadout); //return; } } Changed to: function SetClass(XComGame.XGTacticalGameCoreData.ESoldierClass eNewClass) { local TInventory kNewLoadout; m_kSoldier.kClass.eType = eNewClass; kNewLoadout = m_kChar.kInventory; m_kChar.eClass = eNewClass; m_kSoldier.kClass.strName = class'XGLocalizedData'.default.SoldierClassNames[eNewClass]; GivePerk(44); switch(eNewClass) { // End:0x19D case 1: m_kSoldier.kClass.eWeaponType = 7; TACTICAL().TInventoryLargeItemsSetItem(kNewLoadout, 0, 6); // End:0x19A if(IsInjured()) { TACTICAL().TInventoryLargeItemsSetItem(m_kInjuredLoadout, 0, 6); } // End:0x42F break; // End:0x23C case 3: m_kSoldier.kClass.eWeaponType = 4; TACTICAL().TInventoryLargeItemsSetItem(kNewLoadout, 0, 3); // End:0x239 if(IsInjured()) { TACTICAL().TInventoryLargeItemsSetItem(m_kInjuredLoadout, 0, 3); } // End:0x42F break; // End:0x2DB case 2: m_kSoldier.kClass.eWeaponType = 8; TACTICAL().TInventoryLargeItemsSetItem(kNewLoadout, 0, 5); // End:0x2D8 if(IsInjured()) { TACTICAL().TInventoryLargeItemsSetItem(m_kInjuredLoadout, 0, 5); } // End:0x42F break; // End:0x3C6 case 4: m_kSoldier.kClass.eWeaponType = 6; GivePerk(18); eNewClass eNewClass eNewClass eNewClass eNewClass eNewClass TACTICAL().TInventoryLargeItemsSetItem(kNewLoadout, 0, 4); // End:0x3C3 if(IsInjured()) { TACTICAL().TInventoryLargeItemsSetItem(m_kInjuredLoadout, 0, 4); } // End:0x42F break; // End:0x42C case 5: m_kSoldier.kClass.eWeaponType = 4; TACTICAL().TInventoryLargeItemsSetItem(kNewLoadout, 0, 3); // End:0x42F break; // End:0xFFFF default: LOCKERS().ApplySoldierLoadout(self, kNewLoadout); //return; } } I'd got to adjust offsets before the eNewClass calls, and there are few of them. Notice there's 2 calls to GivePerk and there's still room for 2-3 more calls? I'm pondering giving Snap Shot for free to snipers, besides headshot as the first perk, since it feels more of a weapon limitation than a shooter's ability. Hex Code: 08 45 00 00 A9 1F 00 00 00 00 00 00 06 45 00 00 00 00 00 00 00 00 00 00 08 45 00 00 00 00 00 00 BC 00 00 00 66 16 00 00 5C 04 00 00 08 03 00 00 0F 35 30 FF FF FF 7B FA FF FF 00 00 35 B2 F9 FF FF 72 FA FF FF 00 01 01 E7 44 00 00 00 08 45 00 00 0F 00 07 45 00 00 35 B4 F9 FF FF 7C FA FF FF 00 00 01 E8 44 00 00 0F 35 31 FF FF FF 7C FA FF FF 00 01 01 E8 44 00 00 00 08 45 00 00 0F 35 E3 F9 FF FF 7B FA FF FF 00 00 35 B2 F9 FF FF 72 FA FF FF 00 01 01 E7 44 00 00 1A 38 3A 00 08 45 00 00 12 20 82 36 00 00 09 00 74 36 00 00 00 02 74 36 00 00 ;GivePerk(44): (EXTRA BYTES!!!) 1B D3 10 00 00 00 00 00 00 2C 2C 16 ;switch case 1 sniper full 05 08 45 00 00 00 00 08 45 00 00 0A 91 01 24 01 0F 35 2F FF FF FF 7B FA FF FF 00 00 35 B2 F9 FF FF 72 FA FF FF 00 01 01 E7 44 00 00 24 07 19 1B C7 27 00 00 00 00 00 00 16 16 00 80 FB FF FF 00 1C 75 FC FF FF 00 07 45 00 00 25 2C 06 16 07 8E 01 1B 7A 14 00 00 00 00 00 00 16 19 1B C7 27 00 00 00 00 00 00 16 16 00 80 FB FF FF 00 1C 75 FC FF FF 01 DA 44 00 00 25 2C 06 16 06 2F 04 ;switch case 3 support full 0A 30 02 24 03 0F 35 2F FF FF FF 7B FA FF FF 00 00 35 B2 F9 FF FF 72 FA FF FF 00 01 01 E7 44 00 00 24 04 19 1B C7 27 00 00 00 00 00 00 16 16 00 80 FB FF FF 00 1C 75 FC FF FF 00 07 45 00 00 25 2C 03 16 07 2D 02 1B 7A 14 00 00 00 00 00 00 16 19 1B C7 27 00 00 00 00 00 00 16 16 00 80 FB FF FF 00 1C 75 FC FF FF 01 DA 44 00 00 25 2C 03 16 06 2F 04 ;switch case 2 heavy 0A 27 03 24 02 0F 35 2F FF FF FF 7B FA FF FF 00 00 35 B2 F9 FF FF 72 FA FF FF 00 01 01 E7 44 00 00 24 08 19 1B C7 27 00 00 00 00 00 00 16 16 00 80 FB FF FF 00 1C 75 FC FF FF 00 07 45 00 00 25 2C 05 16 ;Tactical().Inventory() second item REMOVED!!!! 19 1B C7 27 00 00 00 00 00 00 16 16 00 80 FB FF FF 00 1C 75 FC FF FF 00 07 45 00 00 26 2C 00 16 ;if injured 07 24 03 1B 7A 14 00 00 00 00 00 00 16 19 1B C7 27 00 00 00 00 00 00 16 16 00 80 FB FF FF 00 1C 75 FC FF FF 01 DA 44 00 00 25 2C 05 16 ;second item REMOVED!!! 19 1B C7 27 00 00 00 00 00 00 16 16 00 80 FB FF FF 00 1C 75 FC FF FF 01 DA 44 00 00 26 2C 00 16 ;jump & case 4 assault weapon type 6 06 2F 04 0A C6 03 24 04 0F 35 2F FF FF FF 7B FA FF FF 00 00 35 B2 F9 FF FF 72 FA FF FF 00 01 01 E7 44 00 00 24 06 ;GivePerk(18): (EXTRA BYTES!!!) 1B D3 10 00 00 00 00 00 00 2C 12 16 ;filling and nulls 00 08 45 00 00 00 08 45 00 00 00 08 45 00 00 00 08 45 00 00 00 08 45 00 00 00 08 45 00 00 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 19 1B C7 27 00 00 00 00 00 00 16 16 00 80 FB FF FF 00 1C 75 FC FF FF 00 07 45 00 00 25 2C 04 16 07 C3 03 1B 7A 14 00 00 00 00 00 00 16 19 1B C7 27 00 00 00 00 00 00 16 16 00 80 FB FF FF 00 1C 75 FC FF FF 01 DA 44 00 00 25 2C 04 16 06 2F 04 0A 2C 04 24 05 0F 35 2F FF FF FF 7B FA FF FF 00 00 35 B2 F9 FF FF 72 FA FF FF 00 01 01 E7 44 00 00 24 04 19 1B C7 27 00 00 00 00 00 00 16 16 00 80 FB FF FF 00 1C 75 FC FF FF 00 07 45 00 00 25 2C 03 16 06 2F 04 0A FF FF 19 1B EE 16 00 00 00 00 00 00 16 14 00 AF 2C 00 00 00 1B 28 01 00 00 00 00 00 00 17 00 07 45 00 00 16 04 0B 53 00 00 00 02 00 82 00 B8 23 00 00 00 00 00 00 I've posted the hex code in case someone is interested, I wouldn't suggest copy-pasting but you can check structure and offsets. ... next, making combat stims (smoke grenade) available for production from the beginning, and finding a replacement for berserker autopsy... or finding more items to equip. Edit: I forgot to say, this change will only apply for new games, or for rookies on saved games, since units get the extra abilities upon reaching level 1, squaddie. Edited March 29, 2013 by anUser Link to comment Share on other sites More sharing options...
Recommended Posts