Tycho Posted March 13, 2012 Share Posted March 13, 2012 Tomorrow night at the very best, I have a got a Maelstrom of a work now. Wow, can I use it? All wrapped up, just put it in etc.? Nice work, Tycho. Be my guest! Let me know if there is anything else to look for. I guess I know the sound subroutines for EU pretty good only because it took so much effort to locate the bomber-zombie issue. What are you using to assemble the scripts into an executable? I would like to experiment with modifying the loader for myself (at first). I could have included the actual fire interval for weapons if I have been able to inject a script instead of trying to rearrange the actual code. Link to comment Share on other sites More sharing options...
Tycho Posted March 13, 2012 Share Posted March 13, 2012 (edited) Here is my first attempt at some of the coding. I know the values are correct but check the scripting. Feel free to include this as well. Finding these values was my biggest accomplishment to date in deciphering the assembly. if(INI_READ_INT("Mod","DUP torpedos for cannons at start",0)) { char patch[]={0x03}; PatchInPlace(0x43F152,patch,1); //set ammo amount for DUP torpedoes char patch2[]={0x01}; PatchInPlace(0x43F159,patch2,1); //set r-slot as DUP torpedo launcher,sub1 PatchInPlace(0x43F18C,patch2,1); //set r-slot as DUP torpedo launcher,sub2 char patch3[]={0x00,0x00,0x00}; PatchInPlace(0x4798BA,patch3,3); //remove cannon and DUP launchers in base store char patch4[]={0x00}; PatchInPlace(0x4798C8,patch4,1); //remove cannon rounds in base store char patch5[]={0x13}; //extra DUP torpedos for diff in prices PatchInPlace(0x4798C6,patch5,1); } Edited March 13, 2012 by Tycho Link to comment Share on other sites More sharing options...
Bomb Bloke Posted March 13, 2012 Share Posted March 13, 2012 I'm not exactly proficient with the language used here, but if it's anything like what I'm used to, you won't be able to redefine "patch" as a char over and over again like that. Will probably be fine if you just remove all use of "char" except for the first instance. You also shouldn't need to redefine the contents of "patch" unless the next value to write will be different; that is to say, you can remove the second line that sets it to {0x01} because, well, it already was. If C handles char anything like how Java handles char (only lets you put valid characters into it), you will not want to use it here. Go with "byte" or something like that if so. I gather "sizeof(patch)/sizeof(char)" should return the amount of values in the array, saving you having to add them up manually with larger patches. But as mentioned above, I'm no C expert (I'm only even guessing this is C, so all of the above could be hogwash!), really I'm posting this to ask: can anyone explain to me what's with the 4 in the addresses? Like, 0x4798C6? It's been bugging me ever since I first saw it done, and it drives me mad with curiosity each time I see it! Link to comment Share on other sites More sharing options...
Tycho Posted March 13, 2012 Share Posted March 13, 2012 I'm not exactly proficient with the language used here, but if it's anything like what I'm used to, you won't be able to redefine "patch" as a char over and over again like that. Will probably be fine if you just remove all use of "char" except for the first instance. You also shouldn't need to redefine the contents of "patch" unless the next value to write will be different; that is to say, you can remove the second line that sets it to {0x01} because, well, it already was. If C handles char anything like how Java handles char (only lets you put valid characters into it), you will not want to use it here. Go with "byte" or something like that if so. I gather "sizeof(patch)/sizeof(char)" should return the amount of values in the array, saving you having to add them up manually with larger patches. The layout and wording is exactly how seb has written all his scripts. Whatever language it is, it should work. Thanks for pointing out that I didn't need to redefine the character unless the values changed. I edited it above. But as mentioned above, I'm no C expert (I'm only even guessing this is C, so all of the above could be hogwash!), really I'm posting this to ask: can anyone explain to me what's with the 4 in the addresses? Like, 0x4798C6? It's been bugging me ever since I first saw it done, and it drives me mad with curiosity each time I see it! As far as I understand, it has to do with the the file being a windows PE executable. When using IDA to disassemble the code it always starts from there and all the scripts by seb use this 4xxxxx convention for the offsets. Link to comment Share on other sites More sharing options...
Jace11 Posted March 27, 2012 Share Posted March 27, 2012 Hope this is still in the works. I tried one of the tftd loaders but it wasn't great. A functional extender with lots of options, mp3 music, bug fixes etc would be great. Link to comment Share on other sites More sharing options...
Bomb Bloke Posted March 27, 2012 Share Posted March 27, 2012 It seems so long as you disable the "more smoke" and "corrupt land sound" tweaks, this one is mostly functional as-is. Worth a try if you haven't already. Link to comment Share on other sites More sharing options...
Tycho Posted March 28, 2012 Share Posted March 28, 2012 It seems so long as you disable the "more smoke" and "corrupt land sound" tweaks, this one is mostly functional as-is. Worth a try if you haven't already. Are you able to access the sell or purchase menu? I keep crashing in those areas. Link to comment Share on other sites More sharing options...
Bomb Bloke Posted March 28, 2012 Share Posted March 28, 2012 You're right, they both throw: XCOM crashed at 0x441AB5 with error 0xC0000005 trying to access 0x834E0930This problem isn't related to any INI setting, so you simply can't open them with the loader active, full stop. Link to comment Share on other sites More sharing options...
kyrub Posted March 28, 2012 Author Share Posted March 28, 2012 This problem isn't related to any INI setting, so you simply can't open them with the loader active, full stop.Sounds horrible, my apologies. Thanks for detecting it, BB and Tycho.- I am drained from RL workload, lost any desire for extra programming or Terrain mod testing in consequence. Link to comment Share on other sites More sharing options...
Bomb Bloke Posted March 29, 2012 Share Posted March 29, 2012 It can wait; I still think the overall package is pretty awesome as-is. Won't stop me from piling up the laundry list in the meantime though. To make the CE game work with XcomUtil, Scott made a tweak to the game exe that let you run it via two copies - a "tactical" version and a "geoscape" version. He did this for both UFO and TFTD, but the TFTD patch is somewhat broken... it forces a crash whenever either executable exits, pretty much guaranteed. If the game could be made to exit cleanly that'd be pretty cool, as at the very least it disrupts the flow of gameplay. If you don't already know what I'm on about, just shout and I'll provide more info. Link to comment Share on other sites More sharing options...
Tycho Posted April 19, 2012 Share Posted April 19, 2012 I found a solution to the problem with the crashes on the sell and purchase screens. The problem is two-fold: The source of the error is in the bug fix for the dismantle base facility crash. However, the INI file has a problem in that the enabled by default fixes are not under the proper heading so the loader runs them by default even if you set any of them to zero. Copy the following over the appropriate sections in the INI file should fix that problem and avoid the crash on the purchase/sell screen. [bug Fix]; bug fixes by default:No research impasses=1Phantom Radar=1Elerium-fueled Craft Bug=1Personnel Overflow=1Base Facility Dismantle-Construction Crash=0Transfered Crafts Refueled=1Door Jam=1Hostile Civilians=1Collectors Edition Blaster Bomb Bug=1Crash On First Move=1Proximity Grenades=1Base Disjoint=0 ; bugs that have an impact on game mechanicsHallucinoid Ranged Attack=0Set BioDrone Melee Accuracy=0Radar Stacking=0Underwater weapons reaction fire=0Funky Fire=0 [Annoying]Sea Floor Terrain Variety=1Corrupted Background Land Sound=0Cannot Intercept Over Land Message=1Mission Too Deep Glitch=1Single Stage Ship Missions=0Fewer Ship Terror Missions=0See Last Alien After 60 Turns=0Deep One Research Unlock=0;if true, any live alien terrorist will substitute Deep One [Obvious Flaws]More Smoke=0Reorder Soldiers In Crafts=1De-equip Crafts=1Retaliate Against Ground Assault=0Manual Interception Fire Mode=0 [Technical issues]Video Pitch=1Music Change Freeze=0Tactical Scroll=0Animations Speed=0HQ4x=0D3D=0D3D Windowed=0Always On Top=0Clip Cursor=0Scale Mouse=0Screen Ratio=0.833333Max FPS=0 Link to comment Share on other sites More sharing options...
Bomb Bloke Posted April 19, 2012 Share Posted April 19, 2012 Huzzah! Good sleuthing. Link to comment Share on other sites More sharing options...
Tycho Posted April 19, 2012 Share Posted April 19, 2012 FYI. If you get an error when you start an interception that says something about it occuring at 44A15B, the current work-around is to disable "Elerium-fueled Craft bug fix." Link to comment Share on other sites More sharing options...
Giratorh Posted April 21, 2012 Share Posted April 21, 2012 XCOM:EU refueled my interest for UFO and especially TFTD (since I always liked the latter better). But I didn't manage to run the game in a playable way on my current PC until I found out about TFTD extender, so I'm very interested to bring that tool from alpha state to a version that is stable, so I post my observations here. There is a crash at 451DA8 whenever my Triton arrives at a crash site and I click on the button to start the mission. That crash doesn't happen anymore when I set Sea Floor Terrain Variety=0. There is also a crash at 460917 when an interception is aborted because the alien sub is too deep. Since that is a bit hard to reproduce I haven't found out yet what to do against that crash. Link to comment Share on other sites More sharing options...
Giratorh Posted April 21, 2012 Share Posted April 21, 2012 Here is my first attempt at some of the coding. I know the values are correct but check the scripting. Feel free to include this as well. Finding these values was my biggest accomplishment to date in deciphering the assembly. if(INI_READ_INT("Mod","DUP torpedos for cannons at start",0)){ char patch[]={0x03}; PatchInPlace(0x43F152,patch,1); //set ammo amount for DUP torpedoes char patch2[]={0x01}; PatchInPlace(0x43F159,patch2,1); //set r-slot as DUP torpedo launcher,sub1 PatchInPlace(0x43F18C,patch2,1); //set r-slot as DUP torpedo launcher,sub2 char patch3[]={0x00,0x00,0x00}; PatchInPlace(0x4798BA,patch3,3); //remove cannon and DUP launchers in base store char patch4[]={0x00}; PatchInPlace(0x4798C8,patch4,1); //remove cannon rounds in base store char patch5[]={0x13}; //extra DUP torpedos for diff in prices PatchInPlace(0x4798C6,patch5,1); }That sounds like you got your hands on the TFTD extender source code ... any chance I can get a copy of it too? On the net I can only find the original UFO extender source, but to translate that to TFTD is a loooot of work, and since kyrub has already done it obviously ... Link to comment Share on other sites More sharing options...
Tycho Posted April 22, 2012 Share Posted April 22, 2012 That sounds like you got your hands on the TFTD extender source code ... any chance I can get a copy of it too? On the net I can only find the original UFO extender source, but to translate that to TFTD is a loooot of work, and since kyrub has already done it obviously ... Kyrub has the only "source code", which is just him taking UFO extender and converting it to TFTD. It's in alpha since there is a lot of work that needs to be done. The above code was a quick change from my mod in EU to those TFTD offsets. Link to comment Share on other sites More sharing options...
Giratorh Posted April 22, 2012 Share Posted April 22, 2012 Kyrub has the only "source code", which is just him taking UFO extender and converting it to TFTD. It's in alpha since there is a lot of work that needs to be done. The above code was a quick change from my mod in EU to those TFTD offsets.I see, thanks for the info. Kyrub, if you still read this: do you intend to continue your work? If not, can someone else like me do it for you? I already took the UFO extender source code and TFTD idc file and began translating. I'm about two thirds through with translating the addresses, but since TFTD is different in a lot of places quite a few of the UFO extender patches are not applicable in the exact same way, so a lot of testing would be needed after the translation. And while I have Visual Studio 2008 I do most of my work in C# (and a bit Java and some other high level languages), my C/C++ and assembly knowledge is some 20 years old (and the last time I seriously occupied myself with assembler was on the Amiga ). Link to comment Share on other sites More sharing options...
kyrub Posted April 22, 2012 Author Share Posted April 22, 2012 I see, thanks for the info. Kyrub, if you still read this: do you intend to continue your work? If not, can someone else like me do it for you? I intended to finish it, but if you want to do it instead of me, it would actually be nice. I will gladly give out my translated code, there is no secret about it, I took all from other people anyway. Also, the Ufo extender was po¨sted under GNU license, so I will give you what I did with extender. Just to warn you:- it was a mess before I got it from Seb76- I made it into twice the mess, since I have 0 experience with C+ Link to comment Share on other sites More sharing options...
Giratorh Posted April 22, 2012 Share Posted April 22, 2012 I intended to finish it, but if you want to do it instead of me, it would actually be nice. I will gladly give out my translated code, there is no secret about it, I took all from other people anyway. Also, the Ufo extender was po¨sted under GNU license, so I will give you what I did with extender. Just to warn you:- it was a mess before I got it from Seb76- I made it into twice the mess, since I have 0 experience with C+Thanks, I take the risk I sent you a PM so that you can contact me directly. While I won't make any promises since my time and my C++/assembler knowledge is limited, I take that as a challenge and hope that I can finish kyrub's work. Link to comment Share on other sites More sharing options...
Tycho Posted April 23, 2012 Share Posted April 23, 2012 Kyrub, Could I get your source code too? PM me how/where to download. Link to comment Share on other sites More sharing options...
Tycho Posted April 25, 2012 Share Posted April 25, 2012 (edited) To fix the crash with the Elerium (Zrbrite) fueled craft bug is enabled: The offset to where you insert the fix needs to be changed to 0x445FEF. [you could hex-edit this value into patcher.dll . Offset 0x52E3~E4: EF 5F] To fix the crash on clicking the purchase/sell buttons when you enable the dismantle-base-facility-bug fix: Change the offset for the patch to 0x4458FD. [patcher.dll offset 0x535B~C: FD 58] Edited May 2, 2012 by Tycho Link to comment Share on other sites More sharing options...
Giratorh Posted April 27, 2012 Share Posted April 27, 2012 Kyrub? Sorry to bother you, but you didn't read your PM yet ... Link to comment Share on other sites More sharing options...
kyrub Posted May 2, 2012 Author Share Posted May 2, 2012 Be patient guys, was not able to dig out my notes + the right files.I will post the files here directly, no need PMing me. Link to comment Share on other sites More sharing options...
Tycho Posted May 2, 2012 Share Posted May 2, 2012 No hurry. I've been comparing EU and TFTD code to see what is different. A lot of it is almost the same. However, they did make some big changes to the sound routine. I'm still trying to understand how to fix the popping at the end of many of the sound files. It's not as simple as adding silence to the end of the sound selection... Link to comment Share on other sites More sharing options...
Bomb Bloke Posted May 6, 2012 Share Posted May 6, 2012 I passed this on to Blade a little while ago, but it looks like he might still be busy (either that or one of our email providers didn't like the attachment and decided to eat the message). Anyway, if you extract it over a copy of XcomUtil 9.7 it adds support for TFTD Extender. You'll need to re-run the XCU setup script to enable it. XcomUtil 9.7+TFTDLoader+Lightnin fix.zip Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now