Jump to content

twinj

Members
  • Posts

    113
  • Joined

  • Last visited

Nexus Mods Profile

About twinj

twinj's Achievements

Enthusiast

Enthusiast (6/14)

  • First Post
  • Collaborator Rare
  • Week One Done
  • One Month Later
  • One Year In

Recent Badges

0

Reputation

  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;
×
×
  • Create New...