yerude Posted January 8, 2014 Author Share Posted January 8, 2014 Ok the OFFSETS seem to be wrong. I get an error "Error reading the Offset Details" and they have the wrong formation. I copied the Offset of the hex table. I make ascreenshothttp://s14.directupload.net/images/140108/kauzdf8x.jpg Link to comment Share on other sites More sharing options...
dubiousintent Posted January 8, 2014 Share Posted January 8, 2014 ToolBoks Custom Mods require a decimal OFFSET value, not hex, as I recall. -Dubious- Link to comment Share on other sites More sharing options...
yerude Posted January 8, 2014 Author Share Posted January 8, 2014 Ah *facepalm* i forgot :laugh: Yeah it works! Very greatBut still questioning how i can use values>255 and how i can implenet aliens as a ressource.Of course an alien ressource need to change UI too but that could be done in a later status. Link to comment Share on other sites More sharing options...
tata2tatakazika Posted January 8, 2014 Share Posted January 8, 2014 About prices.Plz see price of F35 Lighting 2. I think interceptor is like it. I think 1 milion for fighter able to fight UFOs is way to little. Link to comment Share on other sites More sharing options...
Amineri Posted January 8, 2014 Share Posted January 8, 2014 Ah *facepalm* i forgot :laugh: Yeah it works! Very greatBut still questioning how i can use values>255 and how i can implenet aliens as a ressource.Of course an alien ressource need to change UI too but that could be done in a later status. Unreal bytecode uses a 2C ## to define an integer using just a single byte, and the resultant value has to be in the range [0, 255]. To define full signed values in the full 32 bit signed range [-2147483648, 2147483647] you have to use the 1D ## ## ## ## formulation, which uses a full 4 byte (in little endian) formulation. Negative values are expressed in 2's complement. Link to comment Share on other sites More sharing options...
yerude Posted January 8, 2014 Author Share Posted January 8, 2014 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 :smile: Thank you i also picked out the offsets and used your information for a tb mod changing.I corrected my old offsets and this list should work well. You might wanna use it too.(Changed icosts of gene mod to 255 for testing purpouse) /*Second Heart*/ UPK_FILE=XComStrategyGame.upk OFFSET=4786386 [MODDED_HEX] 24 01 24 32 2C 48 2C 0F 2C FF 24 04 /*Adrenalin*/ UPK_FILE=XComStrategyGame.upk OFFSET=4786408 [MODDED_HEX] 24 02 24 2F 2C 48 2C 0A 2C FF 24 14 /*Neuraldaempfung*/ UPK_FILE=XComStrategyGame.upk OFFSET=4786430 [MODDED_HEX] 24 03 24 33 2C 48 2C 14 2C FF 24 1C /*Neuralfeedback*/ UPK_FILE=XComStrategyGame.upk OFFSET=4786452 [MODDED_HEX] 24 04 24 06 2C 48 2C 0A 2C FF 24 1D /*hyperreactive pupils */ UPK_FILE=XComStrategyGame.upk OFFSET=4786474 [MODDED_HEX] 24 05 24 0D 2C 48 2C 05 2C FF 24 1E /*deep awareness/Tiefenwahrnehmung */ UPK_FILE=XComStrategyGame.upk OFFSET=4786496 [MODDED_HEX] 24 06 24 0D 2C 48 2C 05 2C FF 24 26 /*bioelectrical skin*/ UPK_FILE=XComStrategyGame.upk OFFSET=4786518 [MODDED_HEX] 24 07 24 30 2C 48 2C 0F 2C FF 24 2A /*mimic skin*/ UPK_FILE=XComStrategyGame.upk OFFSET=4786540 [MODDED_HEX] 24 08 24 3A 2C 48 2C 23 2C FF 24 5F /*muscle fiber thickness */ UPK_FILE=XComStrategyGame.upk OFFSET=4786562 [MODDED_HEX] 24 09 24 2E 2C 48 2C 19 2C FF 24 32 /*adaptive Bone marrow /Adaptives Knochenmark */ UPK_FILE=XComStrategyGame.upk OFFSET=4786584 [MODDED_HEX] 24 0A 24 0D 2C 48 2C 0F 2C FF 24 2D /*mec upgrading costs*/ /*mec tier1*/ UPK_FILE=XComStrategyGame.upk OFFSET=4020297 [MODDED_HEX] 2C C1 2C 19 4A 4A 2C 28 /*mec tier2*/ UPK_FILE=XComStrategyGame.upk OFFSET=4020331 [MODDED_HEX] 2C C2 2C 32 4A 4A 2C 3C /*mec tier3*/ UPK_FILE=XComStrategyGame.upk OFFSET=4020362 [MODDED_HEX] 2C C3 2C 96 4A 4A 2C 64 If i know be able to change it to much higher values my mod can be finished for beta testing status. Of course it is not finished yet but i want to test the gameplay and i cannot test it without all the costs balanced.And yes i changed the ini file for the costs of changing the soldiers to mec or gene Soldier. Link to comment Share on other sites More sharing options...
Amineri Posted January 8, 2014 Share Posted January 8, 2014 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. For the MEC armors, since they are actually items, it's much simpler to add a BalanceItem entry line (or lines) so that the XGItemTree.BalanceItems function will increase the cost. You can do this for any item that is defined in BuildItems. The only values you can't set in this way are (1) meld cost (2) item build prerequisites (3) item inventory image ID. For my own modding efforts (in which I've made MEC armors buildable in the regular Build UI instead of in the Cybernetics Lab), I've added the lines : ItemBalance_Normal=(eItem=eItem_MecArmor1, iCash=50, iElerium=0, iAlloys=0, iTime=7, iEng=4) ItemBalance_Normal=(eItem=eItem_MecArmor2, iCash=100, iElerium=0, iAlloys=15, iTime=10, iEng=15) ItemBalance_Normal=(eItem=eItem_MecArmor3, iCash=300, iElerium=20, iAlloys=20, iTime=14, iEng=30) Link to comment Share on other sites More sharing options...
yerude Posted January 8, 2014 Author Share Posted January 8, 2014 (edited) About prices.Plz see price of F35 Lighting 2. I think interceptor is like it. I think 1 milion for fighter able to fight UFOs is way to little. If i Change to 1D ## ## ## ## formulation wont it change my offsets too?for 40000 it is 9C40 so would be 1D 00 00 9C 40 correct i guess.At the moment the "2C 4B" is at position 4908DA till DB of course.1D 00 00 9C 40 instead of 2C 4Bwill1. Change the data size2. Change all Offset positions of all following entrys. 4908DA-4908DE How may i solve this situation? And thanks ami ur Tipp was great.The costs of my Mec-1 was also changeable. But i dont know how the engineers influence the costs. I think this is very bad because the item will become cheaper in the late game and if the costs for the Mec-1 are too high, they are to expensive at the beginning, and to cheap in the late game :/(its important for my mod because it is more a "real War" mod where soldiers and mecs die much more often, if the mec1 is to cheap, it is kimba OP later) Edited January 8, 2014 by yerude Link to comment Share on other sites More sharing options...
Amineri Posted January 8, 2014 Share Posted January 8, 2014 or 40000 it is 9C40 so would be 1D 00 00 9C 40 correct i guess. For PCs Unreal is little endian, so the correct formulation would be 1D 40 9C 00 00. 1D 00 00 9C 40 instead of 2C 4Bwill1. Change the data size2. Change all Offset positions of all following entrys. 4908DA-4908DE You're now entering the world of larger scale modding. In general it's not easy to add new bytes to a upk -- if you simply increase the size of the upk using a hex editor the game will CTD on launch. You can try to rewrite the function and shave bytes from elsewhere in order to keep the size the same (basically what we did for the first year of modding XCOM:EU). There are now two tools available that will let you make a function bigger. Wghost's UPKPatch will make a new, larger copy of the function appended to the end of the UPK that you can then mod. Also UPKmodder that XMTS and I are working on can resize and replace code "in-place". This of course messes up any absolute file positions in later positions in the file. But i dont know how the engineers influence the costs. Engineers asymptotically reduce the cost of items to 50% of the base price. The formula is buildPrice = basePrice * ((reqEngineers / currEngineers) + 1.0) * 0.50If reqEngineers = currEngineers (player has exactly the minimum needed), then this becomes basePrice * (1.0 + 1.0) * 0.50 = basePrice. As currEngineers grows very large, the first part starts to vanish, resulting in a lower bound of 0.50 * basePrice. The cost is reduced to 75% of normal once the player has double the required Engineers. Link to comment Share on other sites More sharing options...
yerude Posted January 8, 2014 Author Share Posted January 8, 2014 (edited) About prices.Plz see price of F35 Lighting 2. I think interceptor is like it. I think 1 milion for fighter able to fight UFOs is way to little. If i Change to 1D ## ## ## ## formulation wont it change my offsets too?for 40000 it is 9C40 so would be 1D 00 00 9C 40 correct i guess.At the moment the "2C 4B" is at position 4908DA till DB of course.1D 00 00 9C 40 instead of 2C 4Bwill1. Change the data size2. Change all Offset positions of all following entrys. 4908DA-4908DE How may i solve this situation? And thanks ami ur Tipp was great.The costs of my Mec-1 was also changeable. But i dont know how the engineers influence the costs. I think this is very bad because the item will become cheaper in the late game and if the costs for the Mec-1 are too high, they are to expensive at the beginning, and to cheap in the late game :/(its important for my mod because it is more a "real War" mod where soldiers and mecs die much more often, if the mec1 is to cheap, it is kimba OP later) If i decide to Wghosts UPK Patch or UPKmodder i could need a little tutorial just basics i need, to not make thousands of mistakes with item sizes, formation or whatever.I think i can handle the code and the functions if i try. Does your program (UPKmodder) automatically change all the links of the hexes? If i change the whole upk, the toolbooks mods wont work anymore will they?I guess just comparing the size and just highering the offsets wont work. My main problem is i have difficulties to find all the informations myself because i dont much know about what all this stuff is called :laugh:UE Explorer is s*** anyway :ohmy: a program where all objects and functions will be able to hyperlink the informations and i can click on it and will automatically navigated where the object is used would realy help a lot. I dont know if it is possible with UE too, but seems to be user unfriendly //Just an example of an editor for unreal script i found which uses the features which would be great http://forums.epicgames.com/threads/940192-UnrealScript-IDE-for-Sublime-Text-2-3-Update-Content-Assist Ok i downloaded every tool i could find and tried to read and get every important informations and even read some stuff on the unreal engine udn page.Well but im still wondering how all it works. When i use UE i can READ only the whole composite of functions, objects and their values etc.But, of course, i cant change anything. If i use the extracter i can sepparate the UPK in lots of different files.For example i want to open and edit unpacked/XComStrategyGame/XGTechTree/BuildGeneTechs.FunctionBut well i dont know which program is able to open it. After a long time looking for hints i tried out different ways.I started your UPKmodder tool to find out how much i can handel it.So far so well my first problem was, that i dont know how you created the upk_mod files.But even if i could, i checked your example upk mod files.Your code is a mixture of hex and variables or however it is called :laugh:I see some if commands but no end or end else or whatever and i dont understand when, why and how you found out what exactly you have to put in as hex code. This is my first problem. Well just opening an uncompressed UPK file edit everything like i want and compress/bake or compile or whatever it again would be to easy :pinch: Ok unreal engine is hex based thats fine, but hexes are numbers only, how can you get information about when does a code starts and when a value? I have to many knowledge lacks but there must be a way to get into it. Well if it would be possible just changing the code you wold do.So how can i write code, get the code i wrote as hex, and then i could maybe find out where to place it. This cant be as difficult as it seems to be, somehow all of you have learned it too :laugh: Edited January 8, 2014 by yerude Link to comment Share on other sites More sharing options...
Recommended Posts