wghost81 Posted April 5, 2014 Share Posted April 5, 2014 (edited) Flags description (and explanation of some other variables) can be found in UPK Format document. Edited April 5, 2014 by wghost81 Link to comment Share on other sites More sharing options...
dubiousintent Posted April 6, 2014 Share Posted April 6, 2014 Updated the "Features" page of UPKModder with the above info. -Dubious- Link to comment Share on other sites More sharing options...
ragnaroklucifer Posted May 28, 2014 Share Posted May 28, 2014 How did you get the decompiled source as comment and the associated hex code for each line? Don't tell me you manually do it.... In UE explorer, I only see the option view token but it doesn't generate code like that. And how did you get the GUID and header for the function? How does it know the function is from which class? Link to comment Share on other sites More sharing options...
Amineri Posted May 28, 2014 Author Share Posted May 28, 2014 How did you get the decompiled source as comment and the associated hex code for each line? Don't tell me you manually do it.... In UE explorer, I only see the option view token but it doesn't generate code like that. I use the UE Explorer token view, copy the whole thing into Notepad++, then have a macro which trims out the unneeded stuff and reorganizes the lines the way I like. I then manually indent everything in Notepad++. This part isn't too bad is actually generally the first step in understanding the function I'm going to be modding. After that I copy the whole block from Notepad++ into UPKmodder into the BEFORE_HEX section. How did you get the decompiled source as comment and the associated hex code for each line? Don't tell me you manually do it.... In UE explorer, I only see the option view token but it doesn't generate code like that. And how did you get the GUID and header for the function? How does it know the function is from which class? And how did you get the GUID and header for the function? In practice I copy the UPKFILE= and GUID= lines from existing files. However it's pretty straightforward to type in XComGame.upk or XComStrategyGame.upk the first couple of times. To get the GUID initially just put a dummy value in and run the Reference updater (the BEFORE and AFTER blocks can be empty). Use the current upk file you're working on. Hit "update references to new values" and the GUID will automatically be inserted, along with the filename used as a comment. How does it know the function is from which class? I'm not sure whether you mean the FUNCTION= header entry or the virtual function unrealscript. For the FUNCTION= header you have to specify the class. UPKmodder uses a mutated form of ownership notation. In my mind it's to help distinguish the unreal ownership property from the object-oriented unrealscript use of the '.' operator. So for example:FUNCTION=CalcWorkshopRebate@XGFacility_Engineering Is the CalcWorkshopRebate function in the XGFacility_Engineering class. ---- If you're referring to the virtual function 1B unrealscript operation, that's handled internally by the unreal engine. The same function name but different functions in different classes use the same name reference, which is resolved at run-time. The final function 1C token works differently and uses the object reference for the specific function. Link to comment Share on other sites More sharing options...
wghost81 Posted July 28, 2014 Share Posted July 28, 2014 (edited) I have several suggestions on UPKModder usability. I like when source files (projects) are cross-PC and cross-platform compatible. Here are my suggestion on how to do it for UPKModder: 1. Convert all upk filenames to lowercase internally. Since windows filesystem is case-insensitive and Linux resource files are all lowercase, it will ensure cross-platform compatibility. 2. Make source-root parameter a relative path (modsrc by default). This will ensure compatibility between different PCs as all the modders keep their files in different folders. 3. Move upk-file parameter out of project file to UPKModder config and allow it to be relative path. Same as 2, this will allow moddder to set game path for his own PC once and then open and apply files and projects from other modders. And a question: how to bulk-apply an entire project? Edited July 28, 2014 by wghost81 Link to comment Share on other sites More sharing options...
XMarksTheSpot Posted July 28, 2014 Share Posted July 28, 2014 (edited) 1. Convert all upk filenames to lowercase internally. Since windows filesystem is case-insensitive and Linux resource files are all lowercase, it will ensure cross-platform compatibility.Yeah, that's a reasonable suggestion and a pretty straightforward change. 2. Make source-root parameter a relative path (modsrc by default). This will ensure compatibility between different PCs as all the modders keep their files in different folders.Since there's currently no way to change the source directory path in-application and the sourcefiles get dumped in a subdirectory of where the project XML is located it makes sense to just use a relative path, or maybe even do away with it completely. 3. Move upk-file parameter out of project file to UPKModder config and allow it to be relative path. Same as 2, this will allow moddder to set game path for his own PC once and then open and apply files and projects from other modders.I think I had this argument with Amineri, but she was in favor of keeping UPK file associations project-specific, back then when the most immediately useful and needed feature was the reference updater. I agree that the way it's set up currently is not really suited to sharing mod files as you have to re-pick the target UPK files manually after importing. And a question: how to bulk-apply an entire project?There should be a right-click context menu entry in the project tree view for that purpose. PS: since UPKModder is an open-source project you're free to check out the source, implement some changes yourself and deploy a custom version; I suppose Amineri could also grant you permission to commit code while we're at it :) Edited July 28, 2014 by XMarksTheSpot Link to comment Share on other sites More sharing options...
wghost81 Posted July 29, 2014 Share Posted July 29, 2014 There should be a right-click context menu entry in the project tree view for that purpose.We have a problem then: I can't see any context menu under Linux, right-clicking in project tree does nothing. There are no warnings or error console messages when I right-click project name. Nothing happens at all. Another suggestion: you can duplicate project context menu as main menu item named "Project". I think I had this argument with Amineri, but she was in favor of keeping UPK file associations project-specific, back then when the most immediately useful and needed feature was the reference updater. I agree that the way it's set up currently is not really suited to sharing mod files as you have to re-pick the target UPK files manually after importing.You can try to code both options: project-specific UPK association and global UPK association. If set, project-specific association overrides global settings. And you can add button or context menu entry for quick cleaning project-specific UPK association. since UPKModder is an open-source project you're free to check out the source, implement some changes yourself and deploy a custom version; I suppose Amineri could also grant you permission to commit code while we're at it :smile:I'm afraid I'm not an expert in java coding. I can read java code, but I'm not ready to write something myself. :smile: Link to comment Share on other sites More sharing options...
XMarksTheSpot Posted July 30, 2014 Share Posted July 30, 2014 (edited) We have a problem then: I can't see any context menu under Linux, right-clicking in project tree does nothing. There are no warnings or error console messages when I right-click project name. Nothing happens at all. Another suggestion: you can duplicate project context menu as main menu item named "Project".You're right, I forgot that on Linux systems popups need to trigger on mouse press events, whereas they trigger on mouse release on Windows. Thankfully that's a simple fix.Also, yeah, replicating some functionality in toolbars and menu bars generally is good practice. You can try to code both options: project-specific UPK association and global UPK association. If set, project-specific association overrides global settings. And you can add button or context menu entry for quick cleaning project-specific UPK association.Currently there are no facilities to modify project settings in-application nor are there any directly editable global settings other than in some kind of workspace configuration binary file for remembering previously opened projects. I'll keep thinking about this, there's quite a bit of user interface stuff to take into consideration to tie all of that together. I'm afraid I'm not an expert in java coding. I can read java code, but I'm not ready to write something myself. :smile:We're hardly experts at java coding either, neither do you need to be one to make small adjustments here and there (for instance, adding toLowerCase() calls in places dealing with UPK file names) :wink: And since you're already proficient in at least one other programming language it shouldn't be too hard for you to find your way around Java, all it takes is some reading up on documentation, which is usally excellent for the core classes :smile: As I've said earlier, the project's repository is publicly accessible, anyone's free to tinker around with the code at their own leisure/pace and we'd very much like to encourage other people to check out the source (pun intended :wink:). Edited July 30, 2014 by XMarksTheSpot Link to comment Share on other sites More sharing options...
wghost81 Posted July 30, 2014 Share Posted July 30, 2014 Thankfully that's a simple fix.Good, because implementing Long War files one by one takes a lot of time. :smile: To be honest, I don't like java very much. :smile: But I'll be happy to help with testing and suggestions. :smile: Link to comment Share on other sites More sharing options...
Amineri Posted July 30, 2014 Author Share Posted July 30, 2014 Thankfully that's a simple fix.Good, because implementing Long War files one by one takes a lot of time. :smile: To be honest, I don't like java very much. :smile: But I'll be happy to help with testing and suggestions. :smile: It does take a long time. There's still some really intermitten bug in UPKmodder that can cause the upk to be corrupted. It seems to only crop up for me about once a month, and generally only when I've had UPKmodder running for a few hours and have performed a lot of operations. It's so intermittent/nonreproducible that I haven't been able to track down the cause to fix it. Nonetheless, back before we'd implemented bulk apply/revert operations, Long War was at around 400 or 500 modfiles, so around 200 each to XComGame and XComStrategyGame, and recovering after a corrupted upk would typically take a couple of hours, and was a real drag. After the 2nd or 3rd time it happened I finally dug in and got the build apply/revert operations working, so now it typically only take a few minutes to recover. I can't say that I'm a big fan of Java either. This is actually my first time coding in Java. I literally was learning the language at the same time I was coding the app, which I'm sure XMTS will attest was a bit annoying :). The main reason I went with Java was for the cross-platform capabilities. Of course it's never quite so simple, as your feedback points out, but at least things are pretty close. I can certainly code things up such as converting all file strings to lower case for Linux compatibility, but I can't test that the resultant build works correctly under Linux since I'm not running the OS. I'd certainly be happy to give you write access to the Google code repository so you can check Linux in compatibility changes if you like, or I can add the Linux compatibility changes and then you can check out a new build to test. However, I'd prefer not to release a new version (i.e. jar file) until it's verified working. PM me and we can work out the details. Link to comment Share on other sites More sharing options...
Recommended Posts