Jump to content

Adding Cities & Countries? Xcomestrategygame.upk


GooDilein

Recommended Posts

Hey Guys,

 

Maybe I found something Interesting in adding additional Cities / Countries and Councilcountries.

 

I found this lines in xcomstrategygame.upk / XGWorld: (lines 720 - 756 in UE Explorer)

 

BuildCouncilCountry(0, 0, true);

BuildCouncilCountry(15, 0, true);

BuildCouncilCountry(21, 0, false);

BuildCouncilCountry(3, 2, true);

BuildCouncilCountry(1, 2, true);

BuildCouncilCountry(5, 2, true);

BuildCouncilCountry(4, 2, true);

BuildCouncilCountry(2, 3, true);

BuildCouncilCountry(6, 3, true);

BuildCouncilCountry(7, 3, false);

BuildCouncilCountry(8, 3, true);

BuildCouncilCountry(20, 1, false);

BuildCouncilCountry(19, 1, false);

BuildCouncilCountry(18, 4, false);

BuildCouncilCountry(22, 4, true);

BuildCouncilCountry(25, 4, false);

BuildCountry(28, 1, false);

BuildCountry(26, 1, false);

BuildCountry(27, 2, true);

BuildCountry(11, 2, true);

BuildCountry(13, 2, true);

BuildCountry(29, 2, true);

BuildCountry(24, 2, true);

BuildCountry(9, 2, true);

BuildCountry(30, 2, true);

BuildCountry(31, 2, true);

BuildCountry(32, 2, true);

BuildCountry(33, 2, true);

BuildCountry(34, 2, true);

BuildCountry(35, 2, true);

BuildCountry(14, 3, false);

BuildCountry(10, 3, true);

BuildCountry(12, 3, false);

BuildCountry(16, 3, false);

BuildCountry(17, 3, true);

BuildCountry(23, 4, true);

BoundCouncilCountries();

 

I'm not yet skilled enough to change those values and implement them into the game, because I'm trying to find out how it works.

(hexediting / finding the right values / Xshape)

 

Maybe it works if we put everything to true AND edit the gamecore.ini (founding amounts).

There are 25 ( 10 Councilcountries / 15 countries) set to true and 11 to false (6 council / 5 countries).

Make overall 36.

 

In the gamecore.ini are 16 countries with founding amounts and 20 without, what also is a total of 36.

 

Would be awesome if it works that easy...

 

p.s.: I would appreciate it, if someone shows me how it exactly works with Hexedit -> *.upk files -> implement via Xshape, because i found

also some other stuff like "maxmoves=2 / maxabilities=8" in the xcomgame.upk ;-)

Link to comment
Share on other sites

Hey Guys,

 

Maybe I found something Interesting in adding additional Cities / Countries and Councilcountries.

 

I found this lines in xcomstrategygame.upk / XGWorld: (lines 720 - 756 in UE Explorer)

[snip]

 

I'm not yet skilled enough to change those values and implement them into the game, because I'm trying to find out how it works.

(hexediting / finding the right values / Xshape)

 

Maybe it works if we put everything to true AND edit the gamecore.ini (founding amounts).

There are 25 ( 10 Councilcountries / 15 countries) set to true and 11 to false (6 council / 5 countries).

Make overall 36.

 

In the gamecore.ini are 16 countries with founding amounts and 20 without, what also is a total of 36.

 

Would be awesome if it works that easy...

 

p.s.: I would appreciate it, if someone shows me how it exactly works with Hexedit -> *.upk files -> implement via Xshape, because i found

also some other stuff like "maxmoves=2 / maxabilities=8" in the xcomgame.upk ;-)

 

The buildcouncilcountry function is described like this : function BuildCouncilCountry(int iCountry, int iContinent, bool bDeveloped)

So the variables (content of the parenthesis) is 1.Country number, 2. Continentnumber, 3."Developped or not" boolean. The third parameter's effect is still unclear but it is unlikely it does what you think it does, unfortunately.

Notice there are 16 lines of BuildCouncilCountry, just like the number of council countries. To determine who's who one would need to find where enum m_arrCountries is, which I did not. However with the continents you can do a bit of guessing :

Continent 0 has 3 countries

Continent 1 has 2 countries

Continent 2 has 4 countries

Continent 3 has 4 countries

Continent 4 has 3 countries

My guess is :

BuildCouncilCountry(0, 0, true); -> USA

BuildCouncilCountry(15, 0, true); -> Canada

BuildCouncilCountry(21, 0, false); -> Mexico

BuildCouncilCountry(3, 2, true); -> ? in Europe

BuildCouncilCountry(1, 2, true); -> ? in Europe

BuildCouncilCountry(5, 2, true); -> ? in Europe

BuildCouncilCountry(4, 2, true); -> ? in Europe

BuildCouncilCountry(2, 3, true); -> ? in Asia

BuildCouncilCountry(6, 3, true); -> ? in Asia

BuildCouncilCountry(7, 3, false); -> India

BuildCouncilCountry(8, 3, true); -> ? in Asia

BuildCouncilCountry(20, 1, false); -> ? in South America

BuildCouncilCountry(19, 1, false); -> ? in South America

BuildCouncilCountry(18, 4, false); -> ? in Africa

BuildCouncilCountry(22, 4, true); -> South Africa

BuildCouncilCountry(25, 4, false); -> ? in Africa

How did I guess that ? Precily due to the true/falses, which from the function description should describe developed or not-developed, or "developing" as is said PC. True is for developed countries, in the real-world economic development sense. I think it was linked to some gameplay mechanic that was sacked (possibly due to hurting people's feelings by categorizing countries as developed or not developed.

Finding the listed content of the Countries array would confirm or infirm my theory.

 

Back on the topic of making useful changes, actually adding new countries or cities is impossible for now as we do not have the possibility to change the length of the code in the upk (game refuses to start if you do).

What may be possible is to add countries to the council (ie convert a non-council country to a council country) we would actually need to change the used function from BuildCountry() to BuildCouncilCountry() on the later lines. Depending on how these functions are coded in the bytecode, it may or may not be possible with our current tools. If however both functions are the same length we might be on to something.

As a first step, switching a council country and a non-council country numbers in the Build function would be a good test. being kind of a noob at upk surgery and bytecode I tried but failed miserably. Maybe someone better suited for the task will come to the rescue...

 

Regarding upk surgery, look at the "the next step" thread, where Daemonjax made a clear tutorial on how to do upk surgery complete with links to the necessary tools. Actually learning with that tutorial might be best ^^

 

Re : "maxmoves=2 / maxabilities=8", hold your horses for the moment, a lot of these constants are actually linked to nothing and have no effect on the actual gameplay (which is just bad programming on the part of the devs). That's actually easier to mod than the above, so I'll try that and give you a walkthrough of the method if I actually manage to do it.

 

EDIT : I assumed maxmoves=2 (possibly

const MAX_MOVES = 2

?) would be XGTacticalGameCoreNativeBase, like most of the constants. It's not. Would you mind pointing me in the right direction ? (you'll still get credit for the find, if you worry about that ;P )

Edited by PepprmintButler
Link to comment
Share on other sites

Kind of off-thread, but again regarding Character moves, here is some relevant code :

(in XGUnit)

simulated function int GetRemainingActions()
{
local int maxActions, currentActionsUsed;

maxActions = 2;
// End:0x48 Loop:False
if(m_iFireActionsPerformed == 1 && (GetSoldierClass() != 2))
{
	currentActionsUsed = maxActions;
}
// End:0x5b
else
{
	currentActionsUsed = m_iMovesActionsPerformed;
}
return Max(0, maxActions - currentActionsUsed);
}

 

and in XGCharacter

defaultproperties
{
m_bCanOpenWindowsAndDoors=true
m_iMaxMoves=2
m_iMaxUseAbilities=1
RemoteRole=ENetRole.ROLE_SimulatedProxy
bTickIsDisabled=true
bAlwaysRelevant=true
}

 

Is that where you found your maxmoves=2 ?

Link to comment
Share on other sites

Yes it is. I wasn't worrying for Credits btw ;-)

 

I just didn't noticed where it exactly was - but it was the XGCharacter.

The thing is, i could post a lot of the stuff that i found, but i dont wanna

throw in something - without having it tested.

 

So I'm going back to work and learning the stuff for now... ;)

Link to comment
Share on other sites

It wouldn't be such a bad idea to throw your findings around. Sifting through the upks is one the most tedious and time consuming tasks in the modding everybody is doing now, so I'm sure that would help a lot of people here. Some of the more competent modders might even chime in and give us new things faster than we could work out by ourselves.
Link to comment
Share on other sites

  • Recently Browsing   0 members

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