Jump to content

Photo

SHIV Loadout in Barracks


  • Please log in to reply
19 replies to this topic

#1
Amineri

Amineri

    Resident poster

  • Members
  • PipPipPipPipPip
  • 3,594 posts

I found a simple hex change that will unlock the "Loadout" button for SHIVs in the Barracks "View Troops" screen.

 

Change is in XcomStrategyGame.upk

Spoiler
 
Simple testing allowed me to replace my basic SHIV minigun for an Assault Rifle or Laser Rifle (and the models updated correctly!). I didn't try taking it on missions or anything, though. Also available was an option to replace the built-in SHIV tread chassis with Flak Armor :smile:.
 
I think I see where all the changes necessary to make the SHIV weapons properly equippable are, plus the changes to require them to be researched (in Foundry) and then built, but the task is going to be delayed by some other things I have to do first.
 
I figured I'd toss it out there, though, in case anyone wants to play around with it. I'd be verrrry interested to see if you can equip an assault rifle and then use a SHIV in a mission. Fun !!
 
Spoiler


#2
Amineri

Amineri

    Resident poster

  • Members
  • PipPipPipPipPip
  • 3,594 posts

So, I've fixed the loadout screen for SHIVs so that by default, all weapons and armor are class-locked (unequippable). However, weapons can be made equippable by giving them the property eWP_Overheats in the "ini file" stored in the executable.

 

I've verified giving a SHIV an LMG. It animates correctly in the loadout screen (the rotation thingie), and can be taken on a mission when equipped. It can go on overwatch, and shoot the gun (killed a Thinman with a LMG-equipped SHIV).

 

However, trying to move the SHIV causes it to "hang up". If there are other soldiers, you can tab switch to them, but the SHIVs are "stuck". Ending the turn causes an indefinite hang (if you've tried to move the SHIV). However, if you don't move the SHIV at all, the mission can completed and all soldiers return to base as normal.

 

I noticed that the minigun has a special little animation that "pulls in" the minigun while the SHIV is moving. I suspect that this animation is being called, but doesn't exist for the LMG, thus causing the hang-up.

 

Anyone have any thoughts or suggestions as to where such an animation is set or invoked? Or any other workaround for this?



#3
dubiousintent

dubiousintent

    Faithful poster

  • Members
  • PipPipPipPip
  • 1,070 posts

Just a guess, but wouldn't an animation most likely be implemented as an 'actionscript'?

 

-Dubious-



#4
Amineri

Amineri

    Resident poster

  • Members
  • PipPipPipPipPip
  • 3,594 posts
Update on loadouts for SHIVs.
 
The modlet is basically working, with just a few glitches that detract slightly from the user experience.
 
What is working:
  1. Loadout Button unlocked for SHIVs in Barracks and Dropship equip screens
  2. SHIV weapons are available for equipping in loadout screens
  3. SHIV armor is visible, but locked and unswappable
  4. Only weapons with property eWP_Integrated (the SHIV weapons, by default) can be equipped to SHIVs
  5. SHIV weapons cannot be equipped on any soldier class, or rookies
  6. All SHIVs begin with a Minigun, regardless of Foundry tech researched
  7. SHIVs do not get automatically upgraded when Foundry tech research is completed
  8. SHIV weapons above Minigun are now constructed in Engineering -- they are unlocked by the Foundry project
  9. If a SHIV is destroyed or dismissed, its weapon goes back into inventory (same as soldier equipment)
  10. If a SHIV is MIA or if SW option "Total Loss" is set, SHIV weapon is lost (same as soldier equipment)
  11. Sentry gun is now available. By default, it unlocks after SHIV Suppression Foundry project is completed
  12. Default cost for Sentry Gun is $50
  13. Default cost for Laser Cannon (SHIV) is $80 + 30 alloy
  14. Default cost for Plasma Cannon (SHIV) is $300 + 38 elerium + 40 alloy
  15. Weapon Item Cards display correctly for SHIV weapons -- localisation text needs to be added in XComGame.int

Current Issues:

  1. SHIV weapons are manufactured under the Soldier tab in Engineering, rather than the Vehicles tab.
  2. Any weapon can be marked with eWP_Integrated, but causes game to hang if SHIV equipped with non-SHIV weapon moves during tactical battle
  3. RESOLVED
  4. RESOLVED
  5. In Engineering, when entering Manufacturing screen, erroneously states that SHIV weapons can be used by all classes
  6. Sentry gun image and Minigun image are set to be the same, but are glitchy
  7. Sentry gun model is identical to Minigun model, but does not display in Barracks view -- it does display correctly during tactical battles
  8. Default damage of Sentry gun of 10 is not balanced with other SHIV weapons
  9. Costs of SHIVs + weapons has not been rebalanced

The changes so far have all been to XcomStrategyGame.upk. There are quite a few hex changes to make this work. Hidden below in the spoiler.

 

Spoiler

Edited by Amineri, 27 March 2013 - 04:42 AM.


#5
Yzaxtol

Yzaxtol

    Old hand

  • Premium Member
  • 594 posts

Can you disable the sentry gun from appearing or being available?

 

Tempted to include this in my mod as:

 

1. Minor issue

2. Can be designed around.

3. Can be edited in the localisation files.

4. .. screenshot to how bad it is?

5. Can be edited, hopefully

6. Hopefully will remove Sentry

7. removing Sentry

8. removing Sentry

9. I can still rebalance them in the .ini file right?

 

This modlet will allow me to reintroduce SHIV weapons as tactical varieties, as because you weren't given a choice I had to just make each one do a little extra damage and have no flavour.


Edited by Yzaxtol, 20 March 2013 - 02:24 PM.


#6
Amineri

Amineri

    Resident poster

  • Members
  • PipPipPipPipPip
  • 3,594 posts

Definitely able to not include the sentry gun (easier than including it, for sure).

 

My goal in including the sentry gun was to be able to provide a 4th weapon option so that early game SHIVs could be introduced. The 6 damage of a minigun is a bit unbalancing in the first month and half (I think), so my thought on damage progression was : minigun 4 or 5 -- sentry 6 or 7 -- laser 8 or 9 -- plasma 10 to 12. Having to spend resources makes the SHIV weapons the most difficult weapons to get -- they easily have the longest research path. Requiring them to be built individually allows them to be made more powerful than the soldier weapons without rendering soldiers obsolete -- high end SHIV weapon can simply be made too expensive to be able to field too many of them.

 

Keep in mind that the various bonuses can be split between the chassis (tank armor) and the weapon. For example, alloy shiv chassis could have 0 aim, hover shiv could have +15, shiv laser +10 aim, and shiv plasma +5 aim. The alloy shiv chassis could be given more bonus hp than the hover, but given a move penalty compared to the basic one (tough but slow).

 

4) Currently the item card shows up for SHIV weapons, but shows blank information. I've identified the issue, and thought I had a fix, but it caused the game to crash whenever any item card (for ANY weapon) was displayed. Issue is that creation of the item card for weapons is tied to a function ItemIsWeapon, which is hard coded to return true only if 1< iItem < 55 OR 84 < iItem < 100. The SHIV weapons are in the range 113-116, so the weapon item card function just isn't called. I have a fix for this in the works -- it decompiles okay and the game launches, but crashes when accessing item cards ... soon, hopefully.

 

9) Yes, you can rebalance the weapon stats in the ini file, but to change build costs requires changing the (changed) hex code in the BuildItems function. I will point out which values need to be changed.

 

The lines for the SHIV weapons (in change below, NOT the one with Sentry) are:

 

1B 6E 04 00 00 00 00 00 00 24 71 1D 19 00 00 00 24 00 1D 00 00 00 00 24 05 24 0A 4A 4A 24 10 24 34 16    <--- SHIV Minigun
1B 6E 04 00 00 00 00 00 00 24 73 1D 50 00 00 00 24 00 1D 1E 00 00 00 24 09 24 14 4A 4A 24 06 24 35 16    <--- SHIV Laser
1B 6E 04 00 00 00 00 00 00 24 74 1D 2C 01 00 00 24 26 1D 28 00 00 00 24 0B 24 28 2C 00 4A 24 07 24 41 16    <--- SHIV Plasma
 

BuildItem parameters are (example hex shown for SHIV plasma) :

 

function BuildItem(
1)  int iItem,  -- 24 74
2)  optional int iCashCost, -- 1D 2C 01 00 00
3)  optional int iEleriumCost, -- 24 26
4)  optional int iAlloyCost, -- 1D 28 00 00 00
5)  optional int iTime, -- 24 0B
6)  optional int iMaxEngineers, -- 24 28 
7)  optional XComGame.XGGameData.ETechType eTechReq, -- 2C 00
:cool:  optional XComGame.XGGameData.EItemType eItemReq, -- 4A
9)  optional XComGame.XGGameData.EFoundryTech eFTech, -- 24 07
10) optional int EImage) -- 24 41

 

Full integers were used for cost and alloys, so valid values are 1 < cash, alloys < 2,147,483,648

Laser Cannon has null for elerium cost, so can't be given an elerium cost

Plasma Cannon elerium cost is valid in range 1 - 255

Time and Engineers are valid in range 1-255

Plasma Cannon has no current tech requirement, but there is space for one.

 

Below is the hex code change WITHOUT sentry gun added (change is still required to move SHIV weapons from category 3 to category 1, allowing them to be selected in the loadout menu)

 
Spoiler


#7
Amineri

Amineri

    Resident poster

  • Members
  • PipPipPipPipPip
  • 3,594 posts

Update:
I appear to have worked out how to display the stats for the SHIV weapons. There is no localisation text for any of the SHIV weapons, so I had to add it myself. Damage, crit damage and crit chance are all pulled from the in-game data, same as any other weapon, though.

 

2013-03-26_SHIV_Weapon_Loadout_small.jpg



#8
Amineri

Amineri

    Resident poster

  • Members
  • PipPipPipPipPip
  • 3,594 posts

Here are the hex code changes to fix the weapon item cards for SHIVs.

 

Unfortunately it is a bunch of little changes, as the ItemIsWeapon() call didn't have enough space to include SHIVs. I ended up swapping the logic in ItemIsWeapon() and ItemIsAccessory(). ItemIsAccessory was sloppily written, so had plenty of space. This then required patching up the calls to the functions (meaning three separate changes).

 

In all, there are five separate hex code changes necessary to fix up the item cards. Also included at the end is the text to be added to XComGame.int (localization file) so that the item card shows the "flavor text" -- feel free to modify as you like.

 

Finally, a big THANK YOU to anUser for pointing out that the optimization tokens have to be included ... this was what was previously causing my code to crash.

 

Spoiler


#9
Amineri

Amineri

    Resident poster

  • Members
  • PipPipPipPipPip
  • 3,594 posts

A couple of last localisation file changes to pretty things up:

 

1) When in Loadout screen, message "The Loadout of a S.H.I.V. cannot be edited." appears.

 

In XcomStategyGame.int, change
m_strNoEditSHIV="The Loadout of a S.H.I.V. cannot be edited."
to:
m_strNoEditSHIV="Choose the weapon that this S.H.I.V will take into combat."
 
2) Both SHIV and Interceptor weapons have the same names (i.e. "Laser Cannon")

In XcomGame.int, change
before:
m_aItemNames[eItem_ShivMinigun]="Minigun"
m_aItemNames[eItem_ShivSentry]="Sentry"
m_aItemNames[eItem_ShivLaser]="Laser Cannon"
m_aItemNames[eItem_ShivPlasma]="Plasma Cannon"
 
after:
m_aItemNames[eItem_ShivMinigun]="Minigun"
m_aItemNames[eItem_ShivSentry]="Sentry"
m_aItemNames[eItem_ShivLaser]="Super Heavy Laser"
m_aItemNames[eItem_ShivPlasma]="Super Heavy Plasma"
or some other names, if you prefer.


#10
anUser

anUser

    Fan

  • Members
  • PipPipPip
  • 261 posts
I'm glad my research was helpful. I wanna try this mod myself, and I'll eventualy do it, but man, I've gotta plan it well, this one is a dirty mod... :P




Page loaded in: 1.053 seconds