marcelo_20xx Posted July 30, 2020 Share Posted July 30, 2020 I want to get rid of the rising mechanism of the bridge, to have it all the time lowered after the mechanism is repaired. I searched on the main.scm with no luck, at first I thought to disable the timer which triggers the bridge to lift up but after many hours I gave up on finding the function that controls its, maybe it is harcoded on the exe? any help is appreciated thanks, also I dont care if I cant reach the hidden package, because I can always move the pickup to another position to compensate... Link to comment Share on other sites More sharing options...
Jack Posted July 30, 2020 Share Posted July 30, 2020 The function name is: CBridge::Update(void); // 0x413AC0 And this function is called inside the function: CGame::Process(void); At this point to be more precise: 0x48C9CD So in order to disable the bridge move we need to disable this function call: if (plugin::GetGameVersion() == GAME_10EN) { plugin::patch::Nop(0x48C9CD, 5); } else { if (plugin::GetGameVersion() == GAME_11EN) { plugin::patch::Nop(0x48CACD, 5); } } I'm not sure how will this effect the other bridges. Tank Fire [SA] New Police Helicopter [VC & III] My YouTube Channel Link to comment Share on other sites More sharing options...
marcelo_20xx Posted July 30, 2020 Author Share Posted July 30, 2020 (edited) So, the function is indeed on the exe? then I just need to NOP CGame::Process(void); which is at the hex address 0x48C9CD if I am using the version 1.0 if I understand it correctly? Also, the code you posted is an ASI script? because I searched in the exe and couldn't find the address 0x48C9CD... Edited July 30, 2020 by marcelo_20xx Link to comment Share on other sites More sharing options...
Jack Posted July 30, 2020 Share Posted July 30, 2020 (edited) 1 hour ago, marcelo_20xx said: then I just need to NOP CGame::Process(void); No not CGame::Process(void) A function call inside CGame::Process(void): 0048C9CD call 00413AC0 1 hour ago, marcelo_20xx said: I searched in the exe and couldn't find the address 0x48C9CD... Don't search for the address. You already have it. Go to the address and disable the function call at its location. Edited July 30, 2020 by Jack Tank Fire [SA] New Police Helicopter [VC & III] My YouTube Channel Link to comment Share on other sites More sharing options...
marcelo_20xx Posted July 30, 2020 Author Share Posted July 30, 2020 I NOPed the call in OllyDbg and it worked, also I didn't see any bugs on the others bridges just one thing remains, the bridge alarm is always ringing which causes the cars to stop on the bridge, the alarm bell is no problem as I can blank it, but the other problem I dont know, maybe a nearby function controls the bridge state? or make the cars to not wait and always cross the bridge no matter what, thanks for all the help you gave me so far... Link to comment Share on other sites More sharing options...
Jack Posted July 31, 2020 Share Posted July 31, 2020 CTrafficLights::ShouldCarStopForBridge(); does that. First you need to check which functions are calling it, then modify that memory region in a way you want. plugin::patch::Nop(0x48C9CD, 5); // to make the vehicles move over the bridge again. plugin::patch::SetUChar(0x45648C + 1, 0); // mov al, 0 // to disable the bridge ringing CBridge::State = BRIDGE_IDLE_DOWN; // #include "CBridge.h" and "eBridgeState.h" The last one is controlled by CBridge::Update(); The other functions are juct checking if the bridge is down. I could try to explain what I did but the only way to actually understand is to see the functions by yourself. You need IDA tool with a gta3 database. It has been written in the asm code but IDA hex rays can convert it to c++ which is much clearer. Tank Fire [SA] New Police Helicopter [VC & III] My YouTube Channel Link to comment Share on other sites More sharing options...
marcelo_20xx Posted July 31, 2020 Author Share Posted July 31, 2020 (edited) I will try to study the function with IDA, the GTA3 database you are referring could be this one? Also I see you are using Visual Studio, where do I get #include "CBridge.h" and "eBridgeState.h"? or those files are part of the GTA3 database? thanks Edited July 31, 2020 by marcelo_20xx Link to comment Share on other sites More sharing options...
Jack Posted August 1, 2020 Share Posted August 1, 2020 (edited) plugin-sdk must be installed on the visual studio in order to create codes. And here's the gta3 database provided by Dmitri in 19.05.2018. Also you might wanna check this out too: [Q] DK22PAC Plugin SDK c++ #include "plugin.h" #include "CBridge.h" #include "eBridgeState.h" using namespace plugin; class ShoresideWaleBridge { public: ShoresideWaleBridge() { if (plugin::GetGameVersion() == GAME_10EN) { plugin::patch::Nop(0x48C9CD, 5); plugin::patch::SetUChar(0x45648C + 1, 0); // mov al, 0 CBridge::State = BRIDGE_IDLE_DOWN; // plugin::patch::SetUInt(0x8F2A1C, 3); } } } shoresideWaleBridge; scm: {$CLEO} 0000: repeat wait 250 until 0256: player $player_char defined 05E5: [email protected] = game_version if [email protected] == 0 // version 1.0 then // plugin::patch::Nop(0x48C9CD, 5); 05DF: write_memory 0x48C9CD size 4 value 0x90909090 virtual_protect 0 05DF: write_memory 0x48C9D1 size 1 value 0x90 virtual_protect 0 // 0x48C9CD + 4 // plugin::patch::SetUChar(0x45648C + 1, 0); // mov al, 0 05DF: write_memory 0x45648D size 1 value 0 virtual_protect 0 // CBridge::State = BRIDGE_IDLE_DOWN; 05DF: write_memory 0x8F2A1C size 4 value 3 virtual_protect 0 end 05DC: end_custom_thread Edited August 1, 2020 by Jack . marcelo_20xx 1 Tank Fire [SA] New Police Helicopter [VC & III] My YouTube Channel Link to comment Share on other sites More sharing options...
marcelo_20xx Posted August 1, 2020 Author Share Posted August 1, 2020 (edited) Thank you so much my man, it works perfectly. I will get deep on this PluginSDK system and see what I can do but for the moment I will play and enjoy this tiny but huge change that make the game more fluent for me, thanks again... Edited August 1, 2020 by marcelo_20xx 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