B-$hep Posted November 10, 2009 Share Posted November 10, 2009 (edited) I couldn't sleep so i thought why not develop something useful. This old topic motivated me: http://www.gtaforums.com/index.php?showtopic=218166 What's the idea? It's GTA2 player remapper tool. I thought why the hell not? Just few clicks and you can change player default remap 25 to anything else and more interesting: LIKE COP OUTFIT for example. Do you like to be COP? Or use it's outfit? It's easy now. Even in original GTA2 scr files. Choose your desired remap and click Save. Launch GTA2 and enjoy your new outfit. Download from my homepage: http://www.gta2madness.co.cc/click.php?id=7 All suggestions for improvement, new ideas, criticism etc are welcome. Tool is coded using good "old" Borland Delphi 2.0 from 1996. No joke. EXE is small. Edited December 30, 2009 by B-$hep No. 1 Link to comment Share on other sites More sharing options...
Sektor Posted November 10, 2009 Share Posted November 10, 2009 (edited) Cool. I tried to find the player_ped command in SCR files but it seemed to be a different opcode in each file, so I gave up on making a tool like this. Some other commands always have the same opcodes, so I guess I just missed it. Why did you password the RAR file? That's just annoying. Edited November 10, 2009 by Sektor Link to comment Share on other sites More sharing options...
B-$hep Posted November 10, 2009 Author Share Posted November 10, 2009 (edited) Just that if Google indexes that file then people who will find it but shouldn't have it will not be able to open it. It's very new. Not final. I guess more stuff can be put in actually. Maybe one day complete SCR decompiler. I always wanted to do that. But sad thing is that without any comments. But actually GTA2 scripts are not so complex so i don't think this will be a problem. But i know that some people would never like to see such tool. People If you test it please post results. Ie. does it finds your GTA2 data folder path? Does it throws any errors? Also your OS versions wouldn't hurt. Also share your ideas for improvement. Edited November 10, 2009 by B-$hep Link to comment Share on other sites More sharing options...
B-$hep Posted November 10, 2009 Author Share Posted November 10, 2009 (edited) It would be cool to decompile the scripts. But... I have taked quick look into the compiled scripts (.scr) files and seems they are compiled like executables from "real" compilers. Variables are thrown away somewhere or changed to symbols. If i could decompile the scripts then.. but is there point? Instead variable names you see just some hex strings or autogenerated variable names. But does this help you to get ste.scr and wil.scr sources? And many many things are byte packed and swapped. Dunno why. Also there is some random sh*t in .scr files. Maybe just for keeping .scr size on 80,7KB. I don't know. Of course this is just quick look. Im not in the mood right now to make a deep look and hack. But i know my software cra*king experience (5 years) will help me alot. But as i said, maybe a bit later. [OT] Im messing with gmp compression at the moment. I wan't to see my da*n maps in GTA2[/OT] Edited November 10, 2009 by B-$hep Link to comment Share on other sites More sharing options...
NTAuthority Posted November 11, 2009 Share Posted November 11, 2009 I have taked quick look into the compiled scripts (.scr) files and seems they are compiledlike executables from "real" compilers. Variables are thrown away somewhere or changed to symbols. If i could decompile the scripts then.. but is there point? Instead variable names you see just some hex strings or autogenerated variable names. GTA3D modders do that all the time, all variables are decompiled to numbers, jump targets to 'SECTION_OFFSET', since sections do have names. Only thing that's not done using names is that SA has a huge number-to-possible-name list. With some code flow analysis, it'd be possible to at least make code that can be recompiled. Inactive in GTA/R* title modification indefinitely pursuant to a court order obtained by TTWO. Good job acting against modding! Link to comment Share on other sites More sharing options...
B-$hep Posted November 11, 2009 Author Share Posted November 11, 2009 Yeah possibly. I will take another look into that stuff later. Only thing that confuses me that "random" data in SCR files. And with every compile of same script something changes in the scr file. Link to comment Share on other sites More sharing options...
NTAuthority Posted November 11, 2009 Share Posted November 11, 2009 (edited) Only thing that confuses me that "random" data in SCR files. And with every compile of same script something changes in the scr file. This is most likely true of any compiler that does not directly have all code flow instructions in the source language, especially if optimization is done -- the GTA3 and GTA IV .sc compilers would possibly have the same 'problem' as the MISS2 compiler, but the modders who discovered that file format obviously didn't notice it since R* didn't release the language compiler (sadly ). Edited November 11, 2009 by NTAuthority Inactive in GTA/R* title modification indefinitely pursuant to a court order obtained by TTWO. Good job acting against modding! Link to comment Share on other sites More sharing options...
B-$hep Posted November 11, 2009 Author Share Posted November 11, 2009 R* sadly didn't released different sweet stuff like different GTA (2) tools sources, file format specs (like for SCR file), sources of their games etc. SCR has it's own format, it must have. Because GTA2 itself reads the compiled script. But no specs for that format. But i believe that with some dedication and free time it can be decompiled. Hopefully to recompilable MIS file like you said. Link to comment Share on other sites More sharing options...
B-$hep Posted November 11, 2009 Author Share Posted November 11, 2009 (edited) I messed around with miss2.exe today and figured out that DMA aka R* used Visual Parse++ for creating lexer and parser for their compiler. http://web.archive.org/web/20080325063026/...ual+Parse++.htm Sand-stone is out of business now so it's available only from archive now. I downloaded the trial pack and also got the headers, libs etc, also headers for Delphi. In C++ headers i see same error strings and strings in general exactly what i saw in miss2.exe. I think if will mess around with that stuff i got i can at least figure out the file format or content of it. How to read it and so on. So the miss2.dfa file shipped with miss2 contains lex tables generated by Visual Parse++. And miss2.llr file shipped with miss2 contains parse tables generated by Visual Parse++. Very interesting stuff. Edited November 11, 2009 by B-$hep Link to comment Share on other sites More sharing options...
Sektor Posted November 11, 2009 Share Posted November 11, 2009 Some of the changes might be the time and date but way more bytes are changed than what would be needed to save that info. Link to comment Share on other sites More sharing options...
B-$hep Posted November 16, 2009 Author Share Posted November 16, 2009 I have update my blog also about the two new things i have done. But what else could be added into this tool? One idea i had is: change the coordinates where the game starts. Usually at the church. Link to comment Share on other sites More sharing options...
Fireman Posted November 18, 2009 Share Posted November 18, 2009 Awesome always wanted this tool, why did it took so long? Works fine here, didnt find the path though so had to click myself (OMG WTF THAT TAKES LIKE AGES). Link to comment Share on other sites More sharing options...
B-$hep Posted November 18, 2009 Author Share Posted November 18, 2009 (edited) Sorry sorry sorry. I will fix the problems with DATA folder in next version. Also backups of all SCR files should be made, at the moment only 3 are back-upped. Im really sorry. In next version i will try to add also possibility to change player start coordinates. Nice to see another user of my tool. This motivates to update it and make it even better. But can you show me the full path of your GTA2 folder? Also what's your default drive? C:\ or something else? Just curious. And please spread word around about this tool. The more people know about the better. Feel free to make copies of it and post anywhere as long as all files are included and the content isn't changed or modified in any way. Edited November 18, 2009 by B-$hep Link to comment Share on other sites More sharing options...
B-$hep Posted November 19, 2009 Author Share Posted November 19, 2009 (edited) Here is new version. Don't use the old one anymore. I had to recompile it in Delphi 3 to add some new features. Also i just renamed the tool to "GTA2 SCR Tool" So it's related to modifying GTA2 SCR files. Also updated UI a bit. There are few components hidden. Just left as placeholders for changing GTA2 player starting coordinates in next version. And now you can launch GTA2 directly from tool by pressing GTA2 button. ReadMe.txt is also updated. Read it again. Also i included versions history into it. Read it, so you know what's changed and what's fixed. So just use this as minor update. No password this time, download here: http://www.gta2madness.co.cc/click.php?id=7 Edited December 30, 2009 by B-$hep Link to comment Share on other sites More sharing options...
Sektor Posted November 20, 2009 Share Posted November 20, 2009 Is the player 1 remap always at 0x2F02 ? Link to comment Share on other sites More sharing options...
B-$hep Posted November 20, 2009 Author Share Posted November 20, 2009 (edited) Seems so yes. Why? Razor reported that it doesn't work for multiplayer. It confuses GTA2. Because GTA2 chooses remaps in MP by itself and seems that he expects there original correct values. If all players have the same remaps then it should work. Hmm you said player 1. Maybe more players are in scripts that should be changed. But i don't think that this is the problem. I can't play MP so i can't do nothing atm. Maybe memory patching helps but it's PITA to locate it in GTA2 memory. Edited November 20, 2009 by B-$hep Link to comment Share on other sites More sharing options...
Fireman Posted November 25, 2009 Share Posted November 25, 2009 D:\GTA2 Link to comment Share on other sites More sharing options...
B-$hep Posted November 25, 2009 Author Share Posted November 25, 2009 (edited) Fireman, did you tested new version? Please test it and report the results. Asks for the GTA2 path or not? Download: http://www.gta2madness.co.cc/click.php?id=7 Edited December 30, 2009 by B-$hep Link to comment Share on other sites More sharing options...
B-$hep Posted December 15, 2009 Author Share Posted December 15, 2009 (edited) Private version screenshot. Saving of new player starting coordinates works fine. Im still working on the reading of the values from SCR file. It's complicated stuff. Stay tuned. EDIT: imageshack is totally fcked up. Gonna replace it soon. Edited December 15, 2009 by B-$hep Link to comment Share on other sites More sharing options...
B-$hep Posted December 17, 2009 Author Share Posted December 17, 2009 (edited) I got the Visual Parse++ to work (ie. compiling, generating files etc). I can't remember if i got the full sources of Visual Parse ++ or not. They must be somewhere on my CD's/DVD's. But i can't remember did i got the sources or not. Something tells me that i got them and burned to CD, but i can't find it so quickly. Having these sources helps even more. I believe that if i devote more time to this SCR stuff and DMA compiler then maybe i could recreate GTA2 script compiler or make a SCR decompiler thanks to this. But this stuff needs alot of time and devotion. This is future plan, after map editor. But SCR tool will be updated, alot more stuff could be added in but as i said SCR files are tricky stuff. Edited December 17, 2009 by B-$hep Link to comment Share on other sites More sharing options...
B-$hep Posted December 18, 2009 Author Share Posted December 18, 2009 (edited) I can say that i almost solved the problem with reading coordinates from SCR file. But there rises another problem. Getting number of players from SCR file. I have made one test.mis script added few players to it and compiled. Then modified script (removed one player) and compiled again. Then compared them. Something changes in the headers of the SCR file but i don't know yet what it is. There are some common patterns in all SCR files but some of them do not always match. These bytes could be anything. They could be even just tokens or pointers to the symbol table or something. Usually in the filenames of SCR files there are number of players added, but not always. Depends on author. I can't fully rely on that. Seems that only way is to understand the bits it changes in header after PLAYER_PED command has been added or removed. I can't blindly read the SCR file. Well, i know the offsets and things but if SCR file has one player and im trying to read more then i will read just pure trash that has nothing to do with actual coordinates. But im working on it. Maybe i figure out something. EDIT: Seems like some basic AI should be added in to this app. Some bit pattern macthing and such things. Like in cr*cking world. Edited December 18, 2009 by B-$hep Link to comment Share on other sites More sharing options...
Sektor Posted December 19, 2009 Share Posted December 19, 2009 It wouldn't be so bad if you let the user chose the number of players and have a warning that it will corrupt the SCR file if they chose wrong. All the official SCR files have the player count in the filename and those are the ones that don't have the .mis files available. Link to comment Share on other sites More sharing options...
B-$hep Posted December 19, 2009 Author Share Posted December 19, 2009 (edited) Good idea Sektor. Never thought of that. I think this is the way to go until i figure out the bits. And in later versions will implement proper way of handling this. I will add also detecting of number of players from filename and ask user "is it correct?" or something like that. GTA2 has filenames like: "MP1-2P" So that 2P is good for detecting number of players. I wish that everyone would use this method naming their scripts. Edited December 19, 2009 by B-$hep Link to comment Share on other sites More sharing options...
B-$hep Posted December 28, 2009 Author Share Posted December 28, 2009 (edited) Sektor Could you please change topic title to "GTA2 SCR Tool"? It's not only remapper tool now and i don't want to make new thread. TIA. OK, because something is messed up with hosting at 000webhost my site is fckd up and i can't login to FTP atm. So uploaded new test version to my old email provider homepage account: http://www.gta2madness.co.cc/click.php?id=7 The readme.txt is not completed and this version is only for testing. But not for everyday use. README.TXT has little tutorial how to change coords in STE.SCR to pay a a little visit to Zaibatsu! Please go through this tutorial and test it! PLEASE. I want you all to test it, do you see something strange when using it? Bugs? Weird coordinates? Please let me know about this in this thread. Also please remember that it saves coordinates ONLY FOR PLAYER 1! It doesn't save others yet. Just test everything you can with player 1 and let me know how it works. Also suggestions about UI design, criticism, anything. Just post here. Feel free to redistribute this but remind anyone that it's not final version and only for testing purposes!! LINK FOR DOWNLOAD: http://www.gta2madness.co.cc/click.php?id=7 Edited December 30, 2009 by B-$hep Link to comment Share on other sites More sharing options...
Sektor Posted December 28, 2009 Share Posted December 28, 2009 (edited) On ste.SCR, it says '113,5' is not a valid floating point value. If works if I change my Windows regional setting to use , for decimal point instead of . Edited December 28, 2009 by Sektor Link to comment Share on other sites More sharing options...
Lantyz Posted December 28, 2009 Share Posted December 28, 2009 (edited) Great tool! I used it to find the missing codes of Hidden Surprise and Tiny Town. The coordinates seem all right, but I think it messes up the rotations every now and then. For instance, it says player 5 in MP5-6P (Face Off 6 players) has a rather weird rotation of 13°, although I'm positive this should be 0°. It also seems to have some trouble determining the correct remap. This goes well most of the time, but MP1-6P (Tiny Town 6 players) has two blond haired Rednecks (P4 and P5). Remaps are never used twice, and in fact I'm not sure whether the blond haired Redneck is used at all in multiplayer. P5 of MP5-6P also is a blond haired Redneck according to your tool, but I'm not sure this is correct. Edited December 28, 2009 by Lantyz Link to comment Share on other sites More sharing options...
B-$hep Posted December 28, 2009 Author Share Posted December 28, 2009 (edited) Thanks Sektor for title. Yeah i guess i must add detecting of regional settings. Im converting these commas to . (dots) in code. Sektor can you got Regional and Language Options in control panel and post here values you have in Regional Options tab. It has Samples and below values like: Number: 123 456 789,00 Currency: 123 456 789.00 kr What do you have there? You see? Releasing even such beta version helps alot to find bugs i didn't even knew about. Thanks alot Lantyz and Sektor. I will work on these bugs now. EDIT: i saw your edit about comma problem, thanks for that. I will modify my regional settings and will try it. EDIT2: yep, throws me error also here. EDIT3: download again, Regional problem should be fixed now. I added checks that should decide what separator to use with different regional settings. Link is same: http://www.gta2madness.co.cc/click.php?id=7 EDIT4: Lantyz, probably these bugs are because of array of Player structs i use. Something messes up the data in array. Should review this code and make it more stable. Thanks for this report. It helps alot. Edited December 30, 2009 by B-$hep Link to comment Share on other sites More sharing options...
B-$hep Posted December 29, 2009 Author Share Posted December 29, 2009 (edited) Lantyz 5 or 6 Virtual Machines must be set up to test these multiplayer maps / scripts using original unmodified GTA2 files. This shows and proofs what remaps / coords, rotations etc are actually used and what's not. Then we will see what is wrong and what's correct. I guess it's hard to get 6 players into game but with friends it should be possible. I can only test on VM's but i must set them up one day to really be sure if my tool lies or not. Well i could build 6 PCs easily at my home but i don't have so much mouses, keyboards and monitors. But i guess one day i will do it and post pics here. But it would be fun, 6 PC's with GTA2 on their screens. D*mn, im gonna do that. Whatever it takes. Seems good idea and i believe i will get alot of fun. But i can calculate also values by "hand". I got all coords by calculating from values in SCR for the faceoff maps. But im working on my tool. Im messing around with that piece of code that is responsible for returning correct values. Edited December 29, 2009 by B-$hep Link to comment Share on other sites More sharing options...
porky119 Posted December 29, 2009 Share Posted December 29, 2009 ive tried out the tool (not beta) a little bit and it seems pretty sweet. i had a question - how hard would it be to change the remaps for other computer controlled people (i.e. change blue police to yellow police)? Link to comment Share on other sites More sharing options...
B-$hep Posted December 29, 2009 Author Share Posted December 29, 2009 Thanks for using my tool. The remaps are assigned by game (in code) and if i remember correctly you can't even control police or medicar green guys with scripts. Scripts do not have control over this. If someone knows that's it's possible in script then i would like to see the command for this. Actually it would be fun: police jumps out of the medicar and saves people and green medicar guys will go after you if you have wanted level. And Elvis with guns in army... etc.. It's good idea, i will take a look into EXE, maybe i will find the place where game set's the remaps. 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