Jump to content

So I gave Outsiders Plasma Snipers as a test....


Joshuahoeth

Recommended Posts

I edited the loadouts.ini file and figured I'd just break the Outsider by changing it's weapon, turns out, it works fine also gave it a grenade and a Plasma Pistol which yielded interesting results,

 

 

the Outsider will actively use the grenades however, when it comes to the pistol, I was disappointed, since I couldn't figure out how to add perks to aliens I decided to give them the pistol so they could still attack after moving, at first I thought they just didn't have the pistols, however, when swapping its team I could switch weapons, animations worked and all, I could even fire it, but the Ai just stopped working after I gave it back the Outsider with the pistol in it's hand, rather disappointing honestly there was a lot of hope, could someone guide me through how to give them Snapshot or any other perk for that matter

Edited by Joshuahoeth
Link to comment
Share on other sites

Hmm see the issue is I don't understand how to find out what to change and on top of that I don't understand how to make it installable via PatcherGUI, I am a bit new to this to be honest, I have modded before but not like this

Edited by Joshuahoeth
Link to comment
Share on other sites

XCOM Enemy Unknown and Enemy Within isn't easy to mod.

 

You can rewrite bytecode (hex) to change how the game works. For example add XCOM perks to aliens. It is straightforward way, but with limits like no new functions, variables and so on. Requires a knowledge of bytecode tokens, how to connect them, how things work.

 

Or you can write new code with help of Unreal Development Kit (UDK), which is more friendly and has allmost no limits. Requires a creation of stub script classes so new code compiles. New scripts must be hooked to the game, with mutators or DynamicLoadObject call (not sure we tested this yet).

 

Comparison:

MyVarible = 7; // in code

// or

0F 00 <.MyVariable> 2C <%b32> // in bytecode using PatcherGUI pseudo code feature

// where

0F // =
00 // Local variable
<.MyVariable> // 4 bytes in this case
2C // 1 byte integer follows
<%b32> // writes 20, as it is 32 in hexadecimal

Another option is to try Long War mod, which has alien perks implemented.

 

Or you can wait for XCOM 2 and try its shiny SDK.

 

---

 

If you want to learn, there is a lot of reading involved.

 

You can begin with Start here - XCOM Nexus Wiki article. It has links to what's needed to know.

 

Check out Modding Tools. Definitely get UE Explorer, so you can view code and contents of uncompressed UPK files. There is view tokens feature, that lets you see code and bytecode together. Disassembled tokens view can help you understad how bytecode works.

 

UPK files can be uncompressed with UPKUtils - DecompressLZO. One of these great tools is HexToPseudoCode, that may be used to create mod files to patch. It really speeds up mod creation process.

 

It is absolute minimum, so you can find what you're looking for. When you find it, you will have to learn how to change it. Search the forum, many things were already done.

 

Adding Additional Perks to Aliens

Adding Perks to Aliens

Combined mod (see the first spoiler)

 

There are many resources you can use to understand.

 

XCOM:EU Perks

Hex editing UPK files

Basic Guide to installing mods
How to DIY common mod solutions (PatchUPK mod file example: How to customize Zhang)

---

 

The most relevant files considering scripts are XComGame (tactical stuff and more) and XComStrategyGame (strategy stuff). But watch in what folder they are, becuse on it depends if you're modding Enemy Unknown or Enemy Within. My paths are:

  • EU - Steam\steamapps\common\XCom-Enemy-Unknown\XComGame\CookedPCConsole\
  • EW - Steam\steamapps\common\XCom-Enemy-Unknown\XEW\XComGame\CookedPCConsole\

 

That'd be all from me :smile: Hope it helped.

 

Edit: Typos.

Edited by Drakous79
Link to comment
Share on other sites

I am using UE Explorer I am starting simple trying to change a simple number, however the "View" Menu does not do anything when I click no drop down boxes appear, I appreciate the help by the way I am sorry I am clueless when it comes to this

 

 

*EDIT*

 

 

Turns out the view menu wasn't working in that particular section for reasons I do not understand, I was attempting to modify the DecalLifeSpan settings

Edited by Joshuahoeth
Link to comment
Share on other sites

I was like you, when I started with XCOM, no clue.

 

You can do simple edits directly in UE Explorer.

 

Always backup files you are going to change :smile: If you don't, you would have to verify game's cache in Steam to get unmodified files back.

 

Try to open XComStrategyGame.upk.

 

When you open the file, you will see 3 tabs in the left pane. The most interesting is Objects tab. It contains:

  • Content - embedded packages in the file
  • Classes - scripts

At the bottom of the left pane is filter input field. Type XGStrategyAI in it. It will filter just the class you typed. You can use just part of the class' name. Expand its tree by clicking on + sign. Then go to Functions and find GetNumAbductionSites. Now you can right click on it in the left pane and select View tokens.

(000/000) [04 2C 03]
	R(3/3) -> ICB(2/2)
	return 3

04 // return
2C // 1 byte integer
03 // 3

Right click on the function again and select View buffer. Locate 04 2C 03 and right click on 03 and select Edit cell. Type 01 or 02. Then CTRL + S, CTRL + D will save changes and renew the buffer. Close the buffer view and check the change you just made. Close XComStrategyGame.upk by clicking on X at the top right corner, just above Save button. Check in the game, if you get the same number of abduction sites you've just entered.

 

If you don't close the file in UE Explorer, the game will crash.

 

Also if you increase a width of the left pane in UE Explorer, there will be Tools. If you click on an arrow next to it, you can choose Find / Find in Classes. Try to search for AbductionSites. This can help to find places of interest and uncover game's mechanics.

 

---

 

Edit: How to make a mod of it with help of UPKUtils.

 

At the top of the left pane is another input field, that contains name and path of an object selected below.

 

You can use HexToPseudoCode util to create a mod file.

 

Copy XComStrategyGame.upk to HexToPseudoCode folder, or HexToPseudoCode to a place, where your unpacked upks are. Run cmd, command line. Type:

HexTopSeudoCode XComStrategyGame.upk XGStrategyAI.GetNumAbductionSites > d:\Pseudo_XGStrategyAI.GetNumAbductionSites.txt

and you'll get mod file:

//This script was generated by HexToPseudoCode decompiler for use with PatchUPK/PatcherGUI tool
UPK_FILE = XComStrategyGame.upk
OBJECT = XGStrategyAI.GetNumAbductionSites : AUTO

[REPLACEMENT_CODE]
04 2C 03 
04 3A <.ReturnValue> 
53 

to use with PatcherGUI.

 

Check out PatchUPK_Readme.txt to learn about all features and how to use the util.

Edited by Drakous79
Link to comment
Share on other sites

hmmm thank you for all your help, I am happy Xcom 2 is so much more mod friendly, so out of curiosity, would it be possible to make decals persist as well as make Mechtoid ragdoll before they hit the ground, I hate how they ragdoll after they fall on the ground as it makes them die in the same position every time

Edited by Joshuahoeth
Link to comment
Share on other sites

  • Recently Browsing   0 members

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