Jump to content

twinj

Members
  • Posts

    113
  • Joined

  • Last visited

Everything posted by twinj

  1. You can. You can use local variables from other functions in the same class. Just want to make sure that variable isn't called in functions that call or are called by the one you are working with, of course. It turns out you can also borrow local variables from other classes as well. I did this when I split the class namestrings to make the 8 new class names for Long War fit into the original 4 classname config strings. The local variables I needed were in the UISoliderPromotion class but I was able to re-use them in the XGStrategySoldier class. They do of course have to be in the same upk :wink: One other thing to watch out for is certain variables that get put on a "watch list". This appears to make changing the variable automatically trigger some other behavior. I've had a few cases where re-using a particular local variable would cause the game to crash or display other aberrant behavior. Nice to see this making progress but the break and borrowing variables and looping was already being done in my attempt :D I was very close but had to edit some UI stuff to finalise - looks like it would be possible now to have a scrolling selection screen.
  2. Have you had any success with UI edits with this method?
  3. Said this already! ;) You must of missed it.
  4. If it is a final function i.e 1B do not count index reads unless it is obvious they are only four bytes long as some index references here are already 8 bytes long. If it is a 1C call these need to be counted. Jumps are not counted as reads. The best way to understand the counting is to also look at the statements list provided by UE Explorer. Each statements is shown and its reads are shown with their respective decimal positions. All jumps will always go to the beginning of a new statement. You will have to convert them to hex positions. If you removed a four byte index reference the virtual size will have to be reduced by 4. reduce VS
  5. I have added one byte 0B's in code to null out stuff. Generally it is more than one to keep the size correct. You can add them anywhere but keep in mind this can stuff your jump values. I like to remove code and replace it with 0B's so the jumps stay ok. If you removed index reads you have to adjust the jump by -4 each read and whatever was removed as bytes if you did not add 0B's. You can still fixed stuffed up jumps so you should be able to null out anywhere, even 1 byte. I like to append all 0B's at the end of the function once i know its working and then rewrite the jumps. Essentially you can null out full functions using 0B's but you must change the virtual size to match the actual size so it loads correctly. I was looking for functions to do this with so they can be used as proxy's for whatever.
  6. That's my understanding of things currently too. Being able to "move" the starting location of a function+header would be very helpful! twinj, do you know if this is/isn't possible yet? Are we able to update the places that reference the function+header position? :) Follow-up: Can we add parameters to existing functions? One workaround to make longer scripts is to find some unused function or debugging function, rewrite it, and call it from the main function we're trying to edit. If that's workable, next step would be catalog these functions. Yeah I thought of that as an alternative. Some functions could be completely cleaned out. Arrays can be lengthened to store data and saved as params. In fact i was using this technique when rewriting for squad sizes. Cannot add new params though as that will screw with how upk files are parsed through the exports. Would have to rewrite the whole upk. Currently an index to an object 'say a class' will point to all of the functions and its children which are other exports. Changing the params adds new children which screws with numbers of all other exports and children after that export. Mostly the children are in order. Same issue as size. Imports are an even bigger issue as these work across upks...
  7. There really isnt a step by step way to do this. You have to just understand how the script is expanded in size when loaded so you can adjust the jumps and lengths as needed. Currently there is no way to write over the file length of the script. If you get clever and find a better more efficient way to rerwrite some code which saves room then you have space. Have to get creative. I am working on a decompiler where I will add the ability to rewrite sizes.. if I can rewrite them it does not also mean that they will actually load as well. Not that I am aware of.
  8. Isn't that what I said? hehe ;) I've had the Unhood source downloaded for a while now, but when I first looked at it, it was beyond my understanding as I'm still learning C# as I go along. I might take another look now though, since I've learnt quite a bit since then. Eliot had also previously mentioned about adjusting the ScriptSize property when removing object indexes, but again, at the time it was beyond my understanding. Looking back on what he said and after your explaination, it all makes sense now! :) Thanks for the link, I hadn't seen those other resources at the bottom before. It sounds like the impact of your decompiler could be huge and very extensible! Keep up the excellent work and keep us posted :) Yeah sometimes I rush too much and dont get my true point across. What I meant was is that you were not mistaken.
  9. It is a native function in the XComGame.UI_FxScreen class. // Export UUI_FxsScreen::execGetMCPath(FFrame&, void* const) native simulated function name GetMCPath(); I have looked through the tfc's but only a little since I dont understand textures and maps.. yet. Tis why I was hoping someone else would have a go (a previous request post of mine). I am have another quick look now. But really need to understand how native functions work. Looks like delegates..
  10. Forgot to report that I came very close to getting this... The above code has been more optimised but I hit another brick wall. Have not updated new code. I could not refresh the UI soldiers list and screen when scrolling through the boxes.
  11. I tried to find this for Squad sizes but could not so I attempted to rewrite the current Squad select boxes to enable scrolling so as to select soldiers. Hit another UI brick wall which would not allow me to redraw the soldiers when the boxes scrolled. Otherwise I almost made it.. Drakous hit the same problem with UFO abductions... If you find the solution you will become King. It is the next big step in modding XCOM we need. Wish I could help. Daemonjax was going to write a java patcher for this.. but he's disappeared so probably has no time for this game anymore. I'll have another look at it when I have finished making a full UPK parser which could be used to create said patches.
  12. This is amazing, great work finding this out, twinj! I think this is a much needed breakthrough and the biggest leap forward we've had since being able to modify UPKs. It really does open up so much more potential for modding :) What's almost more amazing is that this was almost burried on page 2 and no one had replied! Kudos + 1; :thumbsup: Thank you :) Thanks. You can in fact edit the VS in the script header to correspond to the amount of index reads. This means there is not needed code workarounds. UE explorer has a statements list which shows the index reads and their positions. This can help with count a lot. To the point of not needing to count in some situations, just using the values. Same with jumps!
  13. Nope that's what the footer is for. I have made heaps of progress since this post but just haven't shared it. A lot of this stuff is already known by Eliot > he is a massive resource. His post here, http://eliotvu.com/unreal-package-file-format.html, also points to other resources which go into massive detail. I have also studied the C# Unhood, I think you are a C# man right? I have been working on a java version of a decompiler so I can tokenize the scripts and hopefully be able to rebuild packages on size changes and to enable full parametrization for XCMM. (I will be moving away from XCom in the future.. and enabling XCMM to handle different games. For now though I am stuck on how to deserialize Exports into classes and properties. I am successfully decompiling functions at the moment.
  14. Lol. Thanks Eliot. Looks like I reversed correctly. :biggrin:
  15. These can be found in Core.upk, Engine.upk. And in these classes: Object.class, Actor.class, Controller.class, I checked other main upks and there are no native functions in them (XComGame, Stratgey, Framework) I could not find location of last 3 or native functions on the list. XCOM adds natives that are not in the 2011UDK. The extra natives are in the Object.class For those who wish to understand the format of the list //-------------------------------------- //--- 010 Editor v4.0.3 Binary Template // // File: // Author: // Revision: // Purpose: //-------------------------------------- local int j; typedef struct { BYTE StringLength; CHAR Name[stringLength]; BYTE OperatorPrecedence; enum <BYTE> FUNCTION_TYPE { function = 1, operator = 2, preoperator = 3, postoperator = 4} Type; DWORD HexCode <format=hex>; } ENTRY <read=ReadENTRY>; string ReadENTRY(ENTRY &Entry) { string s; SPrintf(s, "native(%d) %s(%d) %s", Entry.HexCode, EnumToString(Entry.Type), Entry.OperatorPrecedence, Entry.Name); return s; } typedef struct { for (j = 0; j < count; j++) { ENTRY Entry; } } ENTRIES <read=ReadENTRIES>; string ReadENTRIES(ENTRIES &Entries) { string s; SPrintf(s, "Names: %d", count); return s; } // Code start here LittleEndian(); // Check to make sure it's a file DWORD MagicNumber; if (MagicNumber != 0x2C8D14F1) { Warning("Not a valid native table file"); return 1; } //Read number DWORD count; ENTRIES Entries;
  16. Ok so it does need packages.. :wallbash: easy done renamed Core, Engine. Dunno if anything else has native so not going to rename all. I was hoping to traverse the upk path :D. Anyway, got it working! Nice. There are 8 extra natives on top of the 2011 UDK. Thanks again.
  17. I think its a no go.. I uninstalled 1.2 and reinstalled 1.1 to try the Generator. It is asking for Unreal Scripts as *.u. I tried exporting the decompilation and using the .uc files. Nevermind.. I can just write the table myself. It's not important just wanted to see and am learning experimenting :D Thanks anyway. The structure of the Native tables is simple enough.
  18. Thanks Eliot. That'd be why I couldn't find it I am using 1.2. I assumed it would be doable after looking at Unhood code.
  19. Hey EliotVU, thanks again for the hard work. Is it possible for us to add custom NativeTables or could this be added without editing the existing ones?
  20. If you look at BalanceTechs function it loops over the XComGameIni to balance each tech. It does this in order skipping 0. Using this enum enum ETechType { eTech_None, eTech_Xenobiology, eTech_ArcThrower, eTech_BaseShard, eTech_PsiLabs, eTech_Firestorm, eTech_AutopsySectoidCommander, eTech_Hyperwave, eTech_PsiLink, eTech_WeaponFragments, eTech_AlienMaterials, eTech_Exp_Warfare, eTech_Elerium, eTech_PsiArmor, eTech_Armor_Carapace, eTech_Armor_Skeleton, eTech_Armor_Titan, eTech_Armor_Ghost, eTech_Armor_ArchAngel, eTech_LaserWeapons, eTech_PrecisionLasers, eTech_HeavyLasers, eTech_Plasma_Pistol, eTech_Plasma_Light, eTech_Plasma_Rifle, eTech_Plasma_Heavy, eTech_Plasma_Sniper, eTech_Alloy_Cannon, eTech_Plasma_Cannon, eTech_Fusion_Launcher, eTech_BlasterLauncher, eTech_AlienNavigation, eTech_UFOPowerSource, eTech_EMP, eTech_InterrogateSectoid, eTech_InterrogateFloater, eTech_InterrogateMuton, eTech_InterrogateSectoidCommander, eTech_InterrogateBerserker, eTech_InterrogateThinMan, eTech_InterrogateHeavyFloater, eTech_InterrogateMutonElite, eTech_InterrogateEthereal, eTech_AutopsySectoid, eTech_AutopsyFloater, eTech_AutopsyThinMan, eTech_AutopsyMuton, eTech_AutopsyCryssalid, eTech_AutopsyZombie, eTech_AutopsyCyberdisc, eTech_AutopsyBerserker, eTech_AutopsyHeavyFloater, eTech_AutopsyMutonElite, eTech_AutopsyDrone, eTech_AutopsySectopod, eTech_AutopsyEthereal, eTech_Placeholder, eTech_MAX }; ID Name Info 1. Xeno-Biology "Misc research starts here" 2. Arc Thrower 3. Outsider Shard 5. New Fighter Craft "Firestorm" 6. Sectoid Commander Autopsy 7. Hyperwave Communication 8. Ethereal Device x. ;Alien Alloys 12. Elerium 13. Psi Armor "Armors start here" 14. Carapace Armor 15. Skeleton Suit 16. Titan Armor 17. Ghost Armor 18. Archangel Armor 9. Weapon Fragments "Misc research starts here" 10. Alien Materials 11. Experimental Warfare 19. Beam Weapons "Laser weapons start here" 20. Precision Lasers 21. Heavy Lasers 22. Plasma Pistol "Plasma weapons start here" 23. Light Plasma Rifle 24. Plasma Rifle 25. Heavy Plasma 26. Plasma Sniper 27. Alloy Cannon 28. Plasma Cannon 29. Fusion Lance "UFO components start here" 30. Guided Fusion Launcher 31. Alien Nav Computer 32. UFO Power Source x. ;UFO Flight 33. EMP Cannon 34. Interrogate Sectoid "Interrogations start here" 35. Interrogate Floater 36. Interrogate Muton 37. Interrogate Sectoid Commander 38. Interrogate Berserker 39. Interrogate Thin Man 40. Interrogate Heavy Floater 41. Interrogate Muton Elite 42. Interrogate Ethereal 43. Sectoid Autopsy "Autopsies start here" 44. Floater Autopsy 45. Thin Man Autopsy 46. Muton Autopsy 47. Chryssalid Autopsy 48. Zombie Autopsy 49. Cyberdisc Autopsy 50. Berserker Autopsy 51. Heavy Floater Autopsy 52. Muton Elite Autopsy 53. Drone Autopsy 54. Sectopod Autopsy 55. Ethereal Autopsy This mostly corresponds to the pattern I mentioned. Some are out. But hey it led me here. I think the order also has something to do with pre requisite research also. This is why Sectoid commander is up the top.
  21. Sry mate working at the same time! The numbers in the BuildTech function list are in what seem to be random orders. 42. Sectoid Autopsy "Autopsies start here" 43. Floater Autopsy 44. Thin Man Autopsy 45. Muton Autopsy 46. Chryssalid Autopsy 47. Zombie Autopsy 48. Cyberdisc Autopsy 49. Berserker Autopsy 50. Heavy Floater Autopsy 51. Muton Elite Autopsy 52. Drone Autopsy 53. Sectopod Autopsy 54. Ethereal Autopsy There is 13 in this list which corresponds to the bottom of the Build tech list, However, the last id in BuildTech list is a 6... which you have as 5 in your list. The best example is Interrogations. TechBalance=(eTech=eTech_InterrogateSectoid, iTime=2, iAlloys=0, iElerium=0, iNumFragments=0, iNumItems=0) TechBalance=(eTech=eTech_InterrogateFloater, iTime=2, iAlloys=0, iElerium=0, iNumFragments=0, iNumItems=0) TechBalance=(eTech=eTech_InterrogateMuton, iTime=2, iAlloys=0, iElerium=0, iNumFragments=0, iNumItems=0) TechBalance=(eTech=eTech_InterrogateThinMan, iTime=2, iAlloys=0, iElerium=0, iNumFragments=0, iNumItems=0) TechBalance=(eTech=eTech_InterrogateEthereal, iTime=10,iAlloys=0, iElerium=0, iNumFragments=0, iNumItems=0) TechBalance=(eTech=eTech_InterrogateBerserker, iTime=2, iAlloys=0, iElerium=0, iNumFragments=0, iNumItems=0) TechBalance=(eTech=eTech_InterrogateMutonElite, iTime=2, iAlloys=0, iElerium=0, iNumFragments=0, iNumItems=0) TechBalance=(eTech=eTech_InterrogateHeavyFloater, iTime=2, iAlloys=0, iElerium=0, iNumFragments=0, iNumItems=0) TechBalance=(eTech=eTech_InterrogateSectoidCommander, iTime=6, iAlloys=0, iElerium=0, iNumFragments=0, iNumItems=0) Nine BuildTech(34, TechCost(5), 160, 1, 43, 1); BuildTech(35, TechCost(5), 162, 1, 44, 4); BuildTech(36, TechCost(5), 165, 1, 45, 2); BuildTech(39, TechCost(5), 164, 1, 46, 6); BuildTech(42, TechCost(10), 168, 1, 47, 9); BuildTech(38, TechCost(5), 167, 1, 48, 5); BuildTech(41, TechCost(5), 166, 1, 49, 3); BuildTech(40, TechCost(5), 163, 1, 50, 7); BuildTech(37, TechCost(8), 161, 1, 51, 8); Note the closeness of the id's. TechBalance=(eTech=eTech_Xenobiology, iTime=2, iAlloys=0, iElerium=0, iNumFragments=0, iNumItems=4) at position 4 corresponds with position 1 in BuildTech and 1 on your list.
  22. I noticed that there are 'patterns' in the counts from BuildTect list. These mini lists correspond to the type e.g: 9 Interrogatations I looked at default game core and these patterns seem to correspond to that list. ; Techs TechBalance=(eTech=eTech_WeaponFragments, iTime=2, iAlloys=0, iElerium=0, iNumFragments=5, iNumItems=0) TechBalance=(eTech=eTech_AlienMaterials, iTime=2, iAlloys=0, iElerium=0, iNumFragments=5, iNumItems=0) TechBalance=(eTech=eTech_Exp_Warfare, iTime=3, iAlloys=0, iElerium=0, iNumFragments=0, iNumItems=0) TechBalance=(eTech=eTech_Xenobiology, iTime=2, iAlloys=0, iElerium=0, iNumFragments=0, iNumItems=4) TechBalance=(eTech=eTech_LaserWeapons, iTime=6, iAlloys=5, iElerium=0, iNumFragments=10, iNumItems=0) TechBalance=(eTech=eTech_PrecisionLasers, iTime=8, iAlloys=5, iElerium=0, iNumFragments=5, iNumItems=0) TechBalance=(eTech=eTech_HeavyLasers, iTime=8, iAlloys=5, iElerium=0, iNumFragments=5, iNumItems=0) TechBalance=(eTech=eTech_Plasma_Pistol, iTime=15, iAlloys=0, iElerium=5, iNumFragments=40, iNumItems=1) TechBalance=(eTech=eTech_Plasma_Light, iTime=17, iAlloys=0, iElerium=5, iNumFragments=40, iNumItems=1) TechBalance=(eTech=eTech_Plasma_Rifle, iTime=17, iAlloys=10, iElerium=10, iNumFragments=40, iNumItems=1) TechBalance=(eTech=eTech_Plasma_Heavy, iTime=17, iAlloys=10, iElerium=10, iNumFragments=40, iNumItems=1) TechBalance=(eTech=eTech_Plasma_Sniper, iTime=15, iAlloys=10, iElerium=10, iNumFragments=50, iNumItems=0) TechBalance=(eTech=eTech_Alloy_Cannon, iTime=15, iAlloys=25, iElerium=5, iNumFragments=40, iNumItems=0) TechBalance=(eTech=eTech_BlasterLauncher, iTime=20, iAlloys=20, iElerium=10, iNumFragments=75, iNumItems=0) TechBalance=(eTech=eTech_Plasma_Cannon, iTime=10, iAlloys=0, iElerium=10, iNumFragments=30, iNumItems=0) TechBalance=(eTech=eTech_EMP, iTime=20, iAlloys=0, iElerium=20, iNumFragments=0, iNumItems=40) TechBalance=(eTech=eTech_Fusion_Launcher, iTime=15, iAlloys=10, iElerium=20, iNumFragments=50, iNumItems=0) TechBalance=(eTech=eTech_ArcThrower, iTime=3, iAlloys=0, iElerium=0, iNumFragments=10, iNumItems=0) TechBalance=(eTech=eTech_BaseShard, iTime=3, iAlloys=0, iElerium=0, iNumFragments=0, iNumItems=0) TechBalance=(eTech=eTech_AlienNavigation, iTime=5, iAlloys=0, iElerium=0, iNumFragments=0, iNumItems=2) TechBalance=(eTech=eTech_UFOPowerSource, iTime=7, iAlloys=0, iElerium=0, iNumFragments=0, iNumItems=1) TechBalance=(eTech=eTech_Firestorm, iTime=15, iAlloys=10, iElerium=10, iNumFragments=75, iNumItems=0) TechBalance=(eTech=eTech_Elerium, iTime=7, iAlloys=0, iElerium=10, iNumFragments=0, iNumItems=0) TechBalance=(eTech=eTech_Armor_Carapace, iTime=7, iAlloys=10, iElerium=0, iNumFragments=0, iNumItems=0) TechBalance=(eTech=eTech_Armor_Skeleton, iTime=10, iAlloys=15, iElerium=0, iNumFragments=0, iNumItems=0) TechBalance=(eTech=eTech_Armor_Titan, iTime=20, iAlloys=15, iElerium=5, iNumFragments=0, iNumItems=0) TechBalance=(eTech=eTech_Armor_Ghost, iTime=17, iAlloys=15, iElerium=15, iNumFragments=0, iNumItems=0) TechBalance=(eTech=eTech_Armor_ArchAngel, iTime=17, iAlloys=15, iElerium=15, iNumFragments=0, iNumItems=0) TechBalance=(eTech=eTech_PsiArmor, iTime=15, iAlloys=10, iElerium=10, iNumFragments=0, iNumItems=0) TechBalance=(eTech=eTech_Hyperwave, iTime=8, iAlloys=0, iElerium=0, iNumFragments=0, iNumItems=0) TechBalance=(eTech=eTech_PsiLink, iTime=10, iAlloys=0, iElerium=0, iNumFragments=0, iNumItems=0) TechBalance=(eTech=eTech_InterrogateSectoid, iTime=2, iAlloys=0, iElerium=0, iNumFragments=0, iNumItems=0) TechBalance=(eTech=eTech_InterrogateFloater, iTime=2, iAlloys=0, iElerium=0, iNumFragments=0, iNumItems=0) TechBalance=(eTech=eTech_InterrogateMuton, iTime=2, iAlloys=0, iElerium=0, iNumFragments=0, iNumItems=0) TechBalance=(eTech=eTech_InterrogateThinMan, iTime=2, iAlloys=0, iElerium=0, iNumFragments=0, iNumItems=0) TechBalance=(eTech=eTech_InterrogateEthereal, iTime=10,iAlloys=0, iElerium=0, iNumFragments=0, iNumItems=0) TechBalance=(eTech=eTech_InterrogateBerserker, iTime=2, iAlloys=0, iElerium=0, iNumFragments=0, iNumItems=0) TechBalance=(eTech=eTech_InterrogateMutonElite, iTime=2, iAlloys=0, iElerium=0, iNumFragments=0, iNumItems=0) TechBalance=(eTech=eTech_InterrogateHeavyFloater, iTime=2, iAlloys=0, iElerium=0, iNumFragments=0, iNumItems=0) TechBalance=(eTech=eTech_InterrogateSectoidCommander, iTime=6, iAlloys=0, iElerium=0, iNumFragments=0, iNumItems=0) TechBalance=(eTech=eTech_AutopsySectoid, iTime=2, iAlloys=0, iElerium=0, iNumFragments=0, iNumItems=1) TechBalance=(eTech=eTech_AutopsyFloater, iTime=2, iAlloys=0, iElerium=0, iNumFragments=0, iNumItems=1) TechBalance=(eTech=eTech_AutopsyMuton, iTime=2, iAlloys=0, iElerium=0, iNumFragments=0, iNumItems=1) TechBalance=(eTech=eTech_AutopsyThinMan, iTime=2, iAlloys=0, iElerium=0, iNumFragments=0, iNumItems=1) TechBalance=(eTech=eTech_AutopsyCryssalid, iTime=2, iAlloys=0, iElerium=0, iNumFragments=0, iNumItems=1) TechBalance=(eTech=eTech_AutopsyEthereal, iTime=6, iAlloys=0, iElerium=0, iNumFragments=0, iNumItems=1) TechBalance=(eTech=eTech_AutopsyCyberdisc, iTime=2, iAlloys=0, iElerium=0, iNumFragments=0, iNumItems=1) TechBalance=(eTech=eTech_AutopsyDrone, iTime=2, iAlloys=0, iElerium=0, iNumFragments=0, iNumItems=1) TechBalance=(eTech=eTech_AutopsySectopod, iTime=2, iAlloys=0, iElerium=0, iNumFragments=0, iNumItems=1) TechBalance=(eTech=eTech_AutopsyBerserker, iTime=2, iAlloys=0, iElerium=0, iNumFragments=0, iNumItems=1) TechBalance=(eTech=eTech_AutopsyMutonElite, iTime=2, iAlloys=0, iElerium=0, iNumFragments=0, iNumItems=1) TechBalance=(eTech=eTech_AutopsyHeavyFloater, iTime=2, iAlloys=0, iElerium=0, iNumFragments=0, iNumItems=1) TechBalance=(eTech=eTech_AutopsySectoidCommander, iTime=3, iAlloys=0, iElerium=0, iNumFragments=0, iNumItems=1)
  23. Put sizes on hold and go explore :) They won't escape. I cant! So close.
  24. Also, it doesn't matter what you put inside that file. You can make it so the game can't access the file nor create a new file, and the game will still load the silent patcher changes. Those EMS files seem to have weird code at the end of the file. I guess if we can edit the file and edit that code so that it corresponds to the changed file, then we can put all mod changes inside the EMS files. You could then hijack Firaxis' system to create an incremental mod installer. Or so I suspect... Nice! Certainly want to look into this more now. Damn Squad Sizes :wallbash:
  25. Nice work Drak! I Was going to work on this after I have finished the Squad Size problem but after I did some robotic warfare stuff... Squad Size is hard...
×
×
  • Create New...