Jump to content

Realistic Currency Mod - need Help


yerude

Recommended Posts

Hi there,

im working on a mod and i want to have a realistic currency ingame.

I realy disliked you have to pay 10 "dollars" for a soldier, but 40 dollars for a jet.

The jet is just 4 times more expensive than a soldier...

And i also disliked the amount of costs. A Jet should cost a million dollars.

 

So i reworked ALL prices for nearto everything

EXCEPT

Mec and Genemod upgrades.

 

I dont know where the costs are located i checked all ini files but it seems to be located anywhere else.

Would be great if anyone knows where (and maybe if it is complicate to change how) to change it?

 

my first mec should cost about 40.000$

I also thought of changing meld costs too.

 

I would also realy like the idea of paying for skills of the soldiers but that must be complicated to change.

(I just guess the gene mods and mecs are perks to so maybe it is possible, and maybe it is the reason why the costs for it are not located in the ini files. Maybe i have to change the entire perk but i never did. I dont even know how to do)

 

I am very impatiand btw :laugh:

 

 

thx for help

Edited by yerude
Link to comment
Share on other sites

I bet there are many people who could find out in notime ^^

I already tried to find hints by using the search bar but no matches :(

If i didnt guessed wrong and it might be a property of a perk or something, i realy could need help. I have no idea how to handle it.

And it is VERY important for my balancing. A Soldier costs 5000$ and a titan armor 300.000$ (I also play on iron man and with item loss if soldiers die to make the high end equippement more rare and special) nobody would care about using soldiers anymore.

Link to comment
Share on other sites

alsooooooooooooooooooo

 

very luckily im genious and a very fast learner :laugh:

 

I read about how to edit the upk files. I found a decompressor and am now using the Unreal Explorer.

So first step done.

Well on the second step i realized there are over 2000 upk files and got shocked :ninja:

But i just checked the other mods i used with toolbooks and i figured out that the code for the icash may be in the xcomstrategygame.upk

 

eh voila

For the changes of costs for gene updates i want to do i found the following code:

function bool AddSoldierToGeneLabs(XGStrategySoldier kSoldier, array<XComGame.XGGameData.EGeneModTech> arrGeneTech)
{
    local TGeneModTech kTech;
    local XComGame.XGGameData.EGeneModTech eTech;
    local TGeneLabsPatient kPatient;
    local int iCashCost, iMeldCost, iTotalHours;

    iTotalHours = 0;
    // End:0x15E
    foreach arrGeneTech(eTech)
    {
        // End:0x3D
        if(!IsGeneModTechAvailable(eTech))
        {            
            return false;
        }
        kTech = TECHTREE().GetGeneTech(eTech);
        iCashCost += kTech.iCash;
        iMeldCost += kTech.iMeld;
        kPatient.m_arrHoursLeft.AddItem(kTech.iHours);
        kPatient.m_arrPendingGeneMods.AddItem(kTech.ePerk);
        iTotalHours += kTech.iHours;        
    }    
    // End:0x376
    if(((GetResource(0)) >= iCashCost) && (GetResource(7)) >= iMeldCost)
    {
        // End:0x21F
        if(!WorldInfo.IsConsoleBuild(1) && !WorldInfo.IsConsoleBuild(2))
        {
            GetRecapSaveData().RecordEvent(RecordSoldierEnteredGeneLabs(kSoldier, arrGeneTech));
        }
        AddResource(0, -iCashCost);
        AddResource(7, -iMeldCost);
        kPatient.m_kSoldier = kSoldier;
        kPatient.m_kSoldier.m_iTurnsOut = iTotalHours;
        kPatient.m_kSoldier.SetStatus(4);
        STORAGE().BackupAndReleaseInventory(kSoldier);
        m_arrPatients.AddItem(kPatient);
        BARRACKS().ReorderRanks();
        PRES().UINarrative(xcomnarrativemoment'GeneMod_Confirmed');
        return true;
    }

This programming is realy easy to understand. First time but i get into it :laugh:

I think this part checks if the soldier i wanna put into gene labs can be modified (if tech is available)

 

and then it checks all the information who are needed.

This is my favourite part

        kTech = TECHTREE().GetGeneTech(eTech);
        iCashCost += kTech.iCash;
        iMeldCost += kTech.iMeld;
        kPatient.m_arrHoursLeft.AddItem(kTech.iHours);
        kPatient.m_arrPendingGeneMods.AddItem(kTech.ePerk);
        iTotalHours += kTech.iHours;    

So i guess it declares the costs are the kTech.iCash type i just need to find out where they are.

I guess there is a table or maybe some informations about the perks itself.

The perks of gene mods are kTech.ePerk arent they?

    if(((GetResource(0)) >= iCashCost) && (GetResource(7)) >= iMeldCost)
    {
        // End:0x21F
        if(!WorldInfo.IsConsoleBuild(1) && !WorldInfo.IsConsoleBuild(2))
        {
            GetRecapSaveData().RecordEvent(RecordSoldierEnteredGeneLabs(kSoldier, arrGeneTech));
        }
        AddResource(0, -iCashCost);
        AddResource(7, -iMeldCost);
        kPatient.m_kSoldier = kSoldier;
        kPatient.m_kSoldier.m_iTurnsOut = iTotalHours;
        kPatient.m_kSoldier.SetStatus(4);
        STORAGE().BackupAndReleaseInventory(kSoldier);
        m_arrPatients.AddItem(kPatient);
        BARRACKS().ReorderRanks();
        PRES().UINarrative(xcomnarrativemoment'GeneMod_Confirmed');
        return true;
    }

So i guess ressource 0 is icash and ressource 7 is meld. Is there a list what kind of ressources there are else?

Well however i still need to find this kTech.icas and kTech.imeld stuff and maybe kTech.ePerk

If you have any tipps i can increase my workingspeed by changing the way i think, feel free to tell me. I only programmed some CNC stuff but this is a huge difference.

Damn sh1t this makes fun i feel like solving some kind of puzzle. And you cannot learn enough vocabularys possible :laugh: (im not english)

 

 

Edit: Is there a way to make bookmarks in my upk files for UE? I dont wanna get lost :sad:

Edited by yerude
Link to comment
Share on other sites

For setting the costs of the gene techs, you should check out XGTechTree.BuildGeneTechs :

function BuildGeneTechs()
{
    BuildGeneModTech(1, 50, 72, 15, 75, 4);
    BuildGeneModTech(2, 47, 72, 10, 25, 20);
    BuildGeneModTech(3, 51, 72, 20, 35, 28);
    BuildGeneModTech(4, 6, 72, 10, 35, 29);
    BuildGeneModTech(5, 13, 72, 5, 15, 30);
    BuildGeneModTech(6, 13, 72, 5, 15, 38);
    BuildGeneModTech(7, 48, 72, 15, 35, 42);
    BuildGeneModTech(8, 58, 72, 35, 75, 95);
    BuildGeneModTech(9, 46, 72, 25, 60, 50);
    BuildGeneModTech(10, 13, 72, 15, 30, 45);
    //return;    
}

BuildGeneModTech looks like :

function BuildGeneModTech(XComGame.XGGameData.EGeneModTech GeneTech, XComGame.XGGameData.ETechType TechReq, int hours, int MeldCost, int CashCost, XComGame.XGTacticalGameCoreNativeBase.EPerkType Perk)

so the CashCost is the next-to-last parameter.

 

Most of the other things built in the XGTechTree have a "Balance<type>" function that reads from the DGC.ini (e.g. BalanceFoundry, BalanceOTS, BalanceTechs), but for whatever reason Firaxis didn't create DGC.ini entries for the genetechs.

 

Altering that table you should be able to tweak the hours to perform the genemod (currently set to 72 hours for all, but customizable based on the particular tech), the Tech required to unlock it, the Cash and Meld cost, as well as the perk received.

Link to comment
Share on other sites

Hey thanks thats great this must be it i am sure.

How can i altering it? I cannot directly change the values so i switched to view tokens. I hoped there are coordiantes or the offset or whatever but i dont know how to change anything.

I also viewed the table buffer but this part cracks me up.

http://s14.directupload.net/images/140107/tw2537oc.jpg

Link to comment
Share on other sites

I see you are using UE Explorer v 1.2.2.1, which is fairly out-of-date.

 

The first step I'd suggest would be to get the most recent version, 1.2.5.0. This includes both an improved "View Tokens" and a "View Disassembled Tokens". The fun part of hex editing is learning how to read and write in unreal bytecode :)

Link to comment
Share on other sites

MEC suits are defined in XComStrategyGame.upk, class XGItemTree, function BuildItems():

// The 1st parameter is iItem, the 2nd is iCashCost, the 5th iMeldCost

BuildItem(193, 25,,, 40, -1, -1, 13,,, 52);
BuildItem(194, 50,,, 60, -1, 10, 33,,, 53);
BuildItem(195, 150,,, 100, -1, 25, 17,,, 54);

// 193 = eItem_MecArmor1 ... MEC-1 Warden - 25 credits, 40 meld
// 194 = eItem_MecArmor2 ... MEC-2 Sentinel - 50 credits, 60 meld
// 195 = eItem_MecArmor3 ... MEC-3 Paladin - 150 credits, 100 meld

Function BuildItem(params) is in the same class:

function BuildItem(int iItem, optional int iCashCost, optional int iEleriumCost, optional int iAlloyCost, optional int iMeldCost, optional int iTime, optional int iMaxEngineers, optional XComGame.XGGameData.ETechType eTechReq, optional XComGame.XGGameData.EItemType eItemReq, optional XComGame.XGGameData.EFoundryTech eFTech, optional int EImage)

------

 

The cost of building new MEC (MEC-1 Warden) is always 25 credits, but the cost of remaining upgrades is affected by number of engineers. Meld stays as defined.

Have you set new cost in DefaultGameData.ini for augmenting a soldier?

[XComStrategyGame.XGFacility_CyberneticsLab]
m_iModCashCost=10
m_iModMeldCost=10
Link to comment
Share on other sites

Thank you very much for all your help. I did as u recommended and with the latest version of UE i was able to find out. I just wrote a toolbooks script for the latest tb version.

But i havent change ANYTHINg yet so i didnt test it neither.

 

Because i have a new problem i need to solve somehow.

My problem is, that the Hex values do only allow values 0-255

But i wanna change the costs for example 40.000$

How may it be done?

I also thought of using the ressources of dead and alive captured aliens.

Should be possible somehow, because the techs also check if there are dead or alive aliens available. I maybe need to edit the obj type and the function. But for that purpouse i dont know what program i should use for.

Any good tips?

 

(Damn it would be amazing, hunting more aliens with the throw would be realy make big sense then. You could need an alive sectoid commander for the brain upgrades and a muton for chest upgrades and maybe it works for mechs too. Drone material (Dead Drone) for mecarmoror maybe a floater for archangel armor)

 

If ur interrested about the first steps:

MOD_NAME=Yerude Mod
AUTHOR=Yerude
DESCRIPTION=Upgrading costs changes

Version: 0.1

Compatible with XCOM Enemy Within:
 - Patch 1 ( Changelist: 398180)

/*Gene Mod costs*/

/*  kTech.eGeneTech = GeneTech;
    kTech.eTechReq = TechReq;
    kTech.iHours = hours;
    kTech.iMeld = MeldCost;
    kTech.iCash = CashCost;
    kTech.ePerk = Perk;  

function BuildGeneTechs()
{
    BuildGeneModTech(1, 50, 72, 15, 75, 4);
    BuildGeneModTech(2, 47, 72, 10, 25, 20);
    BuildGeneModTech(3, 51, 72, 20, 35, 28);
    BuildGeneModTech(4, 6, 72, 10, 35, 29);
    BuildGeneModTech(5, 13, 72, 5, 15, 30);
    BuildGeneModTech(6, 13, 72, 5, 15, 38);
    BuildGeneModTech(7, 48, 72, 15, 35, 42);
    BuildGeneModTech(8, 58, 72, 35, 75, 95);
    BuildGeneModTech(9, 46, 72, 25, 60, 50);
    BuildGeneModTech(10, 13, 72, 15, 30, 45);
    //return;    
}
	1=Which Perk
	2=which tech is required
	3=how long it takes in hours
	4=meld costs for upgrade
	5=cash costs for upgrade
	6=ID of Perk
*/
/*Second Heart*/
UPK_FILE=XComStrategyGame.upk
OFFSET=4908D2
[MODDED_HEX]
24 01 24 32 2C 48 2C 0F 2C 4B 24 04

/*Adrenalin*/
UPK_FILE=XComStrategyGame.upk
OFFSET=4908E8
[MODDED_HEX]
24 02 24 2F 2C 48 2C 0A 2C 19 24 14

/*Neuraldämpfung*/
UPK_FILE=XComStrategyGame.upk
OFFSET=4908FE
[MODDED_HEX]
24 03 24 33 2C 48 2C 14 2C 23 24 1C

/*Neuralfeedback*/
UPK_FILE=XComStrategyGame.upk
OFFSET=490914
[MODDED_HEX]
24 04 24 06 2C 48 2C 0A 2C 23 24 1D

/*hyperreactive pupils */
UPK_FILE=XComStrategyGame.upk
OFFSET=49092A
[MODDED_HEX]
24 05 24 0D 2C 48 2C 05 2C 0F 24 1E

/*deep awareness/Tiefenwahrnehmung */
UPK_FILE=XComStrategyGame.upk
OFFSET=490940
[MODDED_HEX]
24 06 24 0D 2C 48 2C 05 2C 0F 24 26

/*bioelectrical skin*/
UPK_FILE=XComStrategyGame.upk
OFFSET=490956
[MODDED_HEX]
24 07 24 30 2C 48 2C 0F 2C 23 24 2A

/*mimic skin*/
UPK_FILE=XComStrategyGame.upk
OFFSET=49096C
[MODDED_HEX]
24 08 24 3A 2C 48 2C 23 2C 4B 24 5F

/*muscle fiber thickness */
UPK_FILE=XComStrategyGame.upk
OFFSET=490982
[MODDED_HEX]
24 09 24 2E 2C 48 2C 19 2C 3C 24 32

/*adaptive Bone marrow /Adaptives Knochenmark */
UPK_FILE=XComStrategyGame.upk
OFFSET=490998
[MODDED_HEX]
24 0A 24 0D 2C 48 2C 0F 2C 1E 24 2D
Link to comment
Share on other sites

  • Recently Browsing   0 members

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