Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Summer Special
      2. The Diamond Casino Heist
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Frontier Pursuits
      2. Find Lobbies & Outlaws
      3. Help & Support
    3. Crews

    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. Grand Theft Auto Series

    2. GTA VI

      1. St. Andrews Cathedral
    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
    6. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
    7. GTA III

      1. Guides & Strategies
      2. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    3. Gangs

    1. Announcements

    2. Support

    3. Suggestions

Sign in to follow this  
marcelo_20xx

[GTA III] Disable Shoreside Vale Bridge lifting mechanism

Recommended Posts

marcelo_20xx

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...

Share this post


Link to post
Share on other sites
Jack

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.

Share this post


Link to post
Share on other sites
marcelo_20xx
Posted (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 by marcelo_20xx

Share this post


Link to post
Share on other sites
Jack
Posted (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 by Jack

Share this post


Link to post
Share on other sites
marcelo_20xx

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...

Share this post


Link to post
Share on other sites
Jack

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.

Share this post


Link to post
Share on other sites
marcelo_20xx
Posted (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 by marcelo_20xx

Share this post


Link to post
Share on other sites
Jack
Posted (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 by Jack
.
  • Like 1

Share this post


Link to post
Share on other sites
marcelo_20xx
Posted (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 by marcelo_20xx

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.