Jump to content

Photo

Easy "text" modifications?

names text ini

  • Please log in to reply
3 replies to this topic

#1
RileyWulf

RileyWulf

    Regular

  • Members
  • PipPip
  • 88 posts

Been around here for a while, mostly gathering mods for my games. I noticed though that XCom's list of "flavor" text (Nicknames, names of soldiers, town names) were starting to repeat fairly frequently.

 

I've already started work on the names list, and I'm going to alter the nicknames/ranks. But I was wondering if there was any other text based thing in the game that was easily modified or added to, like town names or something like that.

 

Thanks!



#2
Krazyguy75

Krazyguy75

    Fan

  • Members
  • PipPipPip
  • 318 posts

All of the text for the game is in the localization. You can edit all of it easily. I'm not sure about adding elements, you could test that.



#3
Amineri

Amineri

    Resident poster

  • Premium Member
  • 3,927 posts

Many of the arrays in the game are dynamic arrays and so can be added to.

 

However, looking at the localization data it appears that all of the arrays of strings (for example CityTypeNames) are all static arrays.

 

I'm not sure if this is a limitation with Unreal or a design choice by Firaxis. 

 

For something like operation names:

var const localized string m_aFirstOpName[53];
var const localized string m_aSecondOpName[76];

There are only allowed 53 FirstOpNames and 76 SecondOpNames, all of which have entries in the XComStrategyGame.int file.

 

It may be possible to hex edit the size of these two arrays and then add additional options. I'm not sure whether the .ini / .int file parser is pre-compiled with the array size or if dynamically determines it at run-time. (First case it wouldn't work, second case it would).

 

In order to resize an array you do the following :

  1. Find the array definition in UE Explorer (for example, XComStrategyGame.upk >> XGMission / m_aFirstOpNames
  2. Right-click on variable and bring up the Buffer

For EW release this is:

05 44 00 00 94 25 00 00 00 00 00 00 05 44 00 00 
35 00 00 00 02 80 40 00 00 00 00 00 94 25 00 00 
00 00 00 00 00 00 00 00

This will have changed for EW patch 1 (which I haven't yet updated to :tongue:)

 

The key value is the first word in the second line. 0x35 = 53. To increase the size of the static array simply increase the value here.

 

As an initial test I'd recommend changing this to 0x36 (just by 1) and adding another name to the end of the list, like :

m_aFirstOpName[53]=Foo

To actually get the additional names to work requires a change to XGMission.GenerateOpName

                    kTag.StrValue0 = m_aFirstOpName[Rand(53)];
                    kTag.StrValue1 = m_aSecondOpName[Rand(76)];

The array size is hard-coded as such.

 

To test whether the new localization data is being read (without requiring a ridiculous number of trials), I'd suggest changing the first line to:

kTag.StrValue0 = m_aFirstOpName[53];

which would always pull in the new 54th array element at position 53.


Edited by Amineri, 06 December 2013 - 09:51 PM.


#4
RileyWulf

RileyWulf

    Regular

  • Members
  • PipPip
  • 88 posts

Woah, thanks for the in-depth response! That's a lot to take in. I haven't started running around in anything more complicated than the localization files. I thought about uploading the new name lists/nickname lists but I wasn't sure that was worth uploading.

 

Either way, thanks for the explanation! I'll look into it when I'm not so busy. It just seems strange that there are so few names for things - I end up with a lot of them repeating.







Also tagged with one or more of these keywords: names, text, ini

Page loaded in: 1.152 seconds