Spooky Posted October 6, 2004 Author Share Posted October 6, 2004 The edges of the speedo aren't smoothed out for me like that, I'vr tried changing my res already. I have no idea, I might need to change some settings on my vid card? Are you running in 32bit color?... Can't think of anything else it could be, unless theres some graphics card settings for alphablending. I've noticed a little bug, when you change the radio station, the speedo disappears and comes back when the game has tuned in on the next station It's due to the flag I used to see whether you're ingame. If it's really bothering you and you know how to recompile the source I'll find you a better flag... I haven't had much time for any recreational coding lately, but I'll make a start on it when I do though, if nobody else does first. It's relatively simple if you make use of the msscript control. Implementing all the scms as methods will be the hardest part. I've started turning some of them into C++ classes... pGame = new ScriptGame();pGame->NameThread("MAIN");pGame->Fade(0, FADE_OUT);pGame->SetMaxWantedLevel(6);pGame->SetWastedBustedCheck(0);pGame->SetCurrentTime(12, 0);pGame->RefreshScreen(200.0f, -500.0f);pGame->SetCamera(200.0f, -503.0f, 11.54f);pPlayer = new ScriptPlayer(200.0f, -500.0f, 11.54f);pPlayer->SetSkin(MODEL_PLAYER);pGame->SetWeather(WEATHER_SUNNY);pGame->Fade(1000, FADE_IN);pGame->SelectInterior(INTERIOR_OUTSIDE);pPlayer->Freeze(1); But it will take a looong time... unless it becomes a community project wouldn't it be better/easier to see which functions the scm opcodes actually call, and instead document those, combine them with known memory addresses, and try to reconstruct the real vehicle/actor/scriptthread objects from that (in which case the ps2 gta3 exe with embedded function names would help a lot)? It would be better, but I wouldn't say it'd be easier Does the vice city ps2 executable have labels? If so, if somebody would send me either of those (I've gave my PS2 vice city and gta3 to my brother now ), that'd be great I spent about 3 hours strait yesterday finding, and then figuring out how to use the AnimateActor function - If this is labeled I'll go mad . First attemp: Using a scm opcode const SCRIPT_COMMAND get_car_health = { 0x0227, "vv" };...float fCurrentHealth = 0.0;if (!ScriptCommand(&car_stopped, &dwPlayerCar)) // Is the car moving?...{ScriptCommand(&get_car_health, &dwPlayerCar, &fCurrentHealth); // Get the car health} It returns 0. Second attemp: Getting the value from memory float* fCarHealth=(float*)GameGetVehicle(dwPlayerCar);fCarHealth += 516;float fCarHealth2=*fCarHealth; Same here. What's wrong? Please help me, i can't find a mistake. The first one might possibly be failing due to what Patrick said, and the second is failing due to pointer arithmetic - fCarHealth += 516 on a float pointer will increment the pointer by (516*sizeof(float)). Typecasting as a byte pointer while you do that should sort it - (BYTE*)fCarHealth += 516. This is the best speedometer i've seen. And the only one i use . BUT...there seems to be a problem... I don't know is it just my pc or something, but this speedometer doesn't work with GTA: LC . I've tried reinstalling the game...and gtalc... Anyone have the same problem? I've not tried it on LC, but if their main.scm script doesn't have the $PLAYER_CHAR at 0x08 and $PLAYER_ACTOR at 0x0C then any scm commands sent through the hook using those will crash. It's easily fixable if you can compile the source, just the lines... PLAYER_CHAR = (DWORD*)(SCRIPT_BASE + 0x08);PLAYER_ACTOR = (DWORD*)(SCRIPT_BASE + 0x0C); ...in Custom.cpp need changing. I'm not sure it solves the problem, but I think car health is returned as an integer value, and you're putting it in a float variable. Thus interpreting the returned bit-pattern as a float, while is was meant to be a Integer. This is my fault, I said it'd be returned as a float, because thats how it is in memory. Well, whenever I copy the thing into the root directory the game crashes. is there anything else I should be doing? Nope that should be it. If you're not having the same problem as LT_McGyver with a custom main.scm, please repost here and i'll try to find out whats going on. Link to comment Share on other sites More sharing options...
Mark Pagliaro Posted October 6, 2004 Share Posted October 6, 2004 I have a dvd rom drive and both my ps2 disks but there is no exe. I think its extension is .sys or whatever. To get the labels you need I would need to use what prog to open them? I'd like to help but this is the only way I can. I have a hex editor if that is all I need. Link to comment Share on other sites More sharing options...
Spooky Posted October 6, 2004 Author Share Posted October 6, 2004 I believe they are .SLUS files. I use IDA (interactive disassembler) to view labels. If you could send those files to my email in my signature, that'd be great Thanks. Link to comment Share on other sites More sharing options...
Mark Pagliaro Posted October 6, 2004 Share Posted October 6, 2004 (edited) Thanks for the info about what to use to decompile. Not my area but hopefully the files will help you more. Edited October 6, 2004 by Mark Pagliaro Link to comment Share on other sites More sharing options...
Kryptos Posted October 6, 2004 Share Posted October 6, 2004 I believe the GTA3 PS2 executable is the better documented one. I'm not sure, I've only heard this third hand, I assume CyQ would be the one who knows everything about that. I wish I had to a damn DVD-ROM so I could access my PS2 discs, it seems as though they're collecting more dust as each day goes past. Link to comment Share on other sites More sharing options...
Un3462 Posted October 6, 2004 Share Posted October 6, 2004 yeah, only the gta3 version has labels, but there's heaps of duplicate code between vc and gta3 so it's useful still. the file i have is called SLES_503.30 (SLUS_205.52 is vc). Link to comment Share on other sites More sharing options...
Spooky Posted October 7, 2004 Author Share Posted October 7, 2004 Bah! theres loads of info in here (gta3 slus) that could've helped Oh well, I know what function i'm calling for this animation routine now, and the proper parameters Link to comment Share on other sites More sharing options...
Frozen_Flare Posted October 7, 2004 Share Posted October 7, 2004 Is there a chance that this mod will have a KM/H version for us aussies? Link to comment Share on other sites More sharing options...
Spooky Posted October 7, 2004 Author Share Posted October 7, 2004 You can change the speed to kmh by editing the file Speedo.cfg, changing mul_speed 2.24 to mul_speed 3.6 - The MPH text on the speedometer will stay there, but the speed is now read as kmh. Link to comment Share on other sites More sharing options...
Cowpat Posted October 8, 2004 Share Posted October 8, 2004 I tried to compile and link the source for speedo but got these errors. I have the directx 9c SDK installed as well as the extra .lib file required to use that version of the SDK with MSVC++ 6.0 Can anyone suggest what's wrong? Compiling resources... Compiling... Custom.cpp GameScripting.cpp IDirect3D8Hook.cpp IDirect3DDevice8Hook.cpp Linking... Custom.obj : error LNK2001: unresolved external symbol [email protected] Custom.obj : error LNK2001: unresolved external symbol [email protected] Custom.obj : error LNK2001: unresolved external symbol [email protected] Debug/Spookie.dll : fatal error LNK1120: 3 unresolved externals Error executing link.exe. Spookie.dll - 4 error(s), 0 warning(s) Link to comment Share on other sites More sharing options...
Firefly2k Posted October 8, 2004 Share Posted October 8, 2004 did you download the Directx9 SDk? http://www.microsoft.com/downloads/details...&DisplayLang=en Link to comment Share on other sites More sharing options...
TwoZero Posted October 8, 2004 Share Posted October 8, 2004 I tried to compile and link the source for speedo but got these errors. I have the directx 9c SDK installed as well as the extra .lib file required to use that version of the SDK with MSVC++ 6.0 did you download the Directx9 SDk?http://www.microsoft.com/downloads/details...&DisplayLang=en He has it installed.. Link to comment Share on other sites More sharing options...
Kryptos Posted October 9, 2004 Share Posted October 9, 2004 Don't forget, when using DirectX you have to import the libraries. If you're using Microsoft Visual C++ 6.0 then go to Project>Settings>Link and under Object/Library Modules add d3d8.dll. That should fix your problem. I don't believe you have to add any other library modules, if you do just check the DirectX SDK folder and you'll find them in the /lib directory. Simple enough. Also, you may face a pure virtual function violation when using MSVC++ 6.0. As well, make sure you compile the project as a Dynamic Link Library (DLL), it won't compile as an executable as it wasn't created for that. Hope that solves your problems. Link to comment Share on other sites More sharing options...
Spooky Posted October 9, 2004 Author Share Posted October 9, 2004 Those errors are because you're not including d3dx8.lib. You can add this to the linker settings or simply put... #pragma comment(lib, "d3dx8.lib") ...in the code. Link to comment Share on other sites More sharing options...
Kryptos Posted October 9, 2004 Share Posted October 9, 2004 Whoops, sorry I forgot to mention d3dx8.lib. I knew I was forgetting something. Link to comment Share on other sites More sharing options...
Cowpat Posted October 10, 2004 Share Posted October 10, 2004 (edited) Everybody, thanks for your replies to my question. I did as you suggested Spookie, and it compiled and linked no problem, producing a release version of the dll at 376KB size. However, the game doesn't run, throwing up a dialog box straight away with the message "Application failed to intialize properly 0x000007b". The source was compiled using an educational version of MSVC++ 6.0, which, while it produces executables with a nag screen, as far as I was aware, produced ordinary dlls. I may be completely mistaken in this assumption. Oh well, looks like I'll just have buy my own copy of MSVC++ .NET. Thanks again for all your help, everyone. Edited October 10, 2004 by Cowpat Link to comment Share on other sites More sharing options...
Spooky Posted October 10, 2004 Author Share Posted October 10, 2004 Cowpat, you need to add the defination file to the project (Speedo.def). You're getting that error because the dll isn't exporting any functions, and Vice City is expecting to find Direct3DCreate8 exported. Link to comment Share on other sites More sharing options...
Kryptos Posted October 10, 2004 Share Posted October 10, 2004 Cowpat, you never ran into any pure virtual function violations when compiling with MSVC++ 6.0? The first time around I included all the necessary libraries, made sure the DXSDK was referenced with the compiler fine, but upon compiling an annoying pure virtual function violation would always show up in SetCursorPosition. I finally got around to fixing it, but now whenever I throw the DLL in the Vice folder it crashes the game after starting up. I've been too lazy as of yet to fix this, I essentially just made a quick fix to avoid the violation which of course allowed it to compile but essentially created numerous flaws at runtime. Anyhow, I'll start fresh a little later today and get the code to compile in MSVC++ 6.0. Link to comment Share on other sites More sharing options...
Cowpat Posted October 10, 2004 Share Posted October 10, 2004 @Spookie: Yup, spot on, I'd not included the the .def file in the project. It now works fine. The fact that I'd never heard of .def files is no excuse, I should have checked first @Kryptos: I didn't get anything about pure virtual function violations, just the linking errors. Odd you should get something different. Did you modify the code at all? Link to comment Share on other sites More sharing options...
JernejL Posted October 10, 2004 Share Posted October 10, 2004 i added to developer console a option, if it detects speedo mod it reveals a button named 'run gtavc in window' i will release new devc soon Currently working on Top Down City Game, a classics top down game similar to GTA1 & GTA2: Thread Info: https://gtaforums.com/topic/911312-new-game-top-down-city/ Youtube channel: https://www.youtube.com/channel/UCxGfOh3ld7Xm-ic3KEMB6iA Discord: https://discord.gg/UXmDPzS - join #bridge channel Link to comment Share on other sites More sharing options...
Kryptos Posted October 10, 2004 Share Posted October 10, 2004 No Cowpat, I merely extracted everything from the archive, started a new DLL project, added all the necessary files, including all the aforementioned files, and it reported a pure virtual function violation. Anyhow, I've since fixed the problem. Link to comment Share on other sites More sharing options...
DexX Posted October 10, 2004 Share Posted October 10, 2004 Well, i can get it to compile (thanks kryptos), but when i get ingame, it (the speedometer) simply isnt there. I do have this error after compiling.. Creating library Release/SpeedoSrc2.lib and object Release/SpeedoSrc2.expSpeedoSrc2.exp : warning LNK4070: /OUT:d3d8.dll directive in .EXP differs from output filename "Release/SpeedoSrc2.dll"; ignoring directive MSVC++ 6.0, i have the dx9sdk.. Link to comment Share on other sites More sharing options...
Kryptos Posted October 10, 2004 Share Posted October 10, 2004 This is caused because you compiled the source into SpeedoSrc2.dll when it should be d3d8.dll. The problem revolves around the .EXP file creating a different name then that of the created file. If you go to Project>Settings>Link and then change the Output Filename to d3d8.dll it should fix your problem. This is the reason why the the speedometer isn't being displayed. I assume you just renamed the SpeedoSrc2.dll to d3d8.dll. Link to comment Share on other sites More sharing options...
DexX Posted October 10, 2004 Share Posted October 10, 2004 dammit. Now when i load it, i have: Unhandled Exception:C0000005 At Address 1000314c Game crashes. Link to comment Share on other sites More sharing options...
Kryptos Posted October 10, 2004 Share Posted October 10, 2004 Which SDK are you using? I had to install the newer, DXSDK 9, release before I could even compile the code. For anyone who was wondering, the pure virtual function violation was a result of my own wrongdoing. I had modified one of the DXSDK files which was causing major issues, and of course in my own stupidity I forgot to modify the file back to the original before compiling this. Link to comment Share on other sites More sharing options...
DexX Posted October 10, 2004 Share Posted October 10, 2004 The older, summer 2003 version. its the only i have handy. 9.0c would be nice, but im on 56k,. and the file is 227mb......ill have it later. Link to comment Share on other sites More sharing options...
Kryptos Posted October 10, 2004 Share Posted October 10, 2004 Well the version shouldn't make much of a difference anyhow, since DirectX supports all previous versions of itself. Link to comment Share on other sites More sharing options...
Cowpat Posted October 11, 2004 Share Posted October 11, 2004 The older, summer 2003 version. its the only i have handy. 9.0c would be nice, but im on 56k,. and the file is 227mb......ill have it later. I'm on dialup too, so I went to a little internet cafe and downloaded the 9c SDK there. It cost me £4.10, including the disc, and it was done in an hour. I also downloaded an 'Extras' file, which is apparently nessesary if you want to run it under MSVC 6.0 The important part of the Extras download is d3dx9.lib, which I just dropped into any Lib folders I could find in MSVC. I would have thought though that the app would run with the 8.0 version of the SDK. I think you can name your dll d3d9.dll if you want, and the game does an incremental search through the dx versions, starting at 8.0 Kryptos: I'm not really up to speed on C++, so I'm glad I never had to fend off any pure virtual functions Link to comment Share on other sites More sharing options...
Kryptos Posted October 11, 2004 Share Posted October 11, 2004 (edited) Yes, your right, you can use d3dx9.lib instead of d3dx8.lib, although it will bloat the DLL due to all the advancements in the 9.0 DirectX version. Word of advice; don't play around with things you're not suppose to, it'll only come back to haunt you in the end. In one of my earlier posts I also mentioned d3d8.lib, I've been including that in the project settings for an unknown reason, but apparently you don't need it. Sorry for any misconceptions or nuisances. This shouldn't actually cause any issues, but it's not necessary to include this. Also, in MSVC++, including d3dx9.lib instead of d3dx8.lib makes the DLL size approximately 1.57 MB, opposed to 848 KB when using d3dx8.lib. I was just playing around with the script commands for a while. If anyone wants to update their list with some extra opcodes here's some new ones for custom.cpp: const SCRIPT_COMMAND get_actor_coords = { 0x00A0, "vfff" }; // var_actor, x, y, zconst SCRIPT_COMMAND is_key_pressed = { 0x00E1, "ii" }; // int, intconst SCRIPT_COMMAND set_motion_blur = { 0x0374, "i" }; // intconst SCRIPT_COMMAND set_gamespeed = { 0x015D, "f" }; // float (1 = 100%)const SCRIPT_COMMAND debug_on = { 0x00C3, "" }; // -/-const SCRIPT_COMMAND debug_off = { 0x00C4, "" }; // -/-const SCRIPT_COMMAND make_car_heavy = { 0x01EC, "vi" }; // var_car, int (0/1)const SCRIPT_COMMAND explode_car = { 0x020B, "v" }; // var_car I wrote a quick function using some of these, as well as some of the older, opcodes. It takes advantage of the simplicity in calling is_key_pressed directly through the hook, and in the case of the brake or reverse button being pressed in a vehicle it slows the gamespeed down to 0.3 so you can pull some sweet slow motion stops and turns. It also speeds up the gamespeed as you push the accelerator. void CustomScript(){ScriptCommand(&set_weather, WEATHER_STORM);if (ScriptCommand(&is_key_pressed, 0, 14)){ ScriptCommand(&set_gamespeed, 0.3);}else if (ScriptCommand(&is_key_pressed, 0, 6)){ ScriptCommand(&set_gamespeed, 0.3);}else if (ScriptCommand(&is_key_pressed, 0, 16)){ ScriptCommand(&set_gamespeed, 1.3);}} Don't forget to define the function in Custom.h. Anyhow, just some quick fun. Sorry most of the formatting didn't turn out. If you were wondering about the set_motion_blur opcode, I was testing it out with little luck, I just left it as having a 4-byte integer parameter for the time being. Oh, and a little extra thing for those of you who like making things go boom in the night: ScriptCommand(&make_car_heavy, &dwPlayerCar, 1); // Make the vehicle heavy. Add that just after get_player_car is called in the CustomRender(...) function. Edited October 12, 2004 by Kryptos Link to comment Share on other sites More sharing options...
ocram88 Posted October 12, 2004 Share Posted October 12, 2004 hi @all. sorry for my very bad english. @spooky, can you make a dll-file(d3d8.dll) with a .cfg? in the .cfg is written the name of other .dll-files (like scm-scripting^^). 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