Jump to content

Bicycle Mod for GTA IV


Recommended Posts

I'm excited to share a new mod I've been working on that adds bicycles to the game. I think the name of the topic pretty much says it all!

 

What the mod does

This mod is quite simple. It adds a new "bmx" vehicle type to vehicles.ide. This allows the game to use the CBmx class and its virtual method table, which is essential for making the bicycles function correctly within the game.

 

In addition to adding the bicycles, this script also modifies some of the game's standard logic. For example, it prevents drivers from trying to start the bicycle and disables the processing of engine and fuel tank health, since bicycles don't have them.

 

For the correct placement of the character's feet on the pedals, the mod uses an IK system (all this is also in the source code). This ensures their feet are correctly positioned, using the toe bone with a slight offset.

 

Future Plans

I'm also planning to add a few more features in upcoming updates that I believe are possible to implement, including:

  • Riding while standing. This will be a complex feature to implement, as it will likely require more testing and experimentation than initial research and coding.
  • Jumping. To implement this, I'll need to create a new CTask and find the right place to add a hook for creating and processing the task.

 

Open Source

This project is open source, which means the code is available for anyone to improve. If you find any bugs or have ideas for new features, feel free to fix or refine the script. You can then open a pull request, and I'll review your changes.

 

A Note on the Script's Design

Spoiler

This script was written from scratch without the use of any SDKs. Because of this, it contains numerous direct memory addresses and hooks into various game functions, all designed to be as efficient as possible.

 

When making changes or adding new features, it's important to follow this design philosophy. For example, you should avoid creating an infinite loop that checks every frame whether a vehicle is a BMX to apply functionality. Instead, you should create a hook in the specific location where the action needs to happen.

 

To illustrate, if you wanted to create a script that skips one hour of game time every time the player fires a weapon, the wrong approach would be to create a loop that checks every single ped in the world to find the player, and then checks if that player has fired. This would perform far too many unnecessary checks every single frame, leading to a heavy performance load.

 

The correct approach is to create a hook in the shooting task (CTask) itself. This way, the script only executes the time-skip function at the exact moment the shot is fired, without any constant checks. The result is the same, but the performance impact is significantly lower.

 

Also, follow the information on my Discord server.

 

DOWNLOAD and SOURCE CODE

 

I hope you enjoy riding around Liberty City on a bicycle!

Edited by Shvab
idk
Link to comment
https://gtaforums.com/topic/1003238-bicycle-mod-for-gta-iv/
Share on other sites

On 8/24/2025 at 10:25 PM, Claudeweed said:

Also do you know if there’s a way to replace vehicles instead of replacing the motorcycles? I don’t want to lose all motorcycles in exchange for the bicycles

idk. i didn't try

4 hours ago, Lukulo said:

 

Does this mean that we need to find bmx model and replace zombie bike?

if the model is not in the current release(on github), it must be in one of the previous ones. At the moment, the model and anims are in the first release

On 8/29/2025 at 1:28 AM, Shvab said:

if the model is not in the current release(on github), it must be in one of the previous ones. At the moment, the model and anims are in the first release

 

Thank you, full archive was in the very first version, then only *.ASI was updated. I also noticed that there is MTB, not BMX.

 

ZJsC9VS.jpeg

Edited by Lukulo
7 hours ago, Claudeweed said:

I’m having trouble with getting the animations to work. Which specific files require the pedals to move with the bike?

the pedals are controlled by a script. also in order for them to move, the model must have the correct name for these components

  • 1 month later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 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.