Jump to content

Camera collisions disabling


MiranDMC

Recommended Posts

I'm trying to utilize third person camera with mouse control. I written functions to lock camera distance at desired value.

 

// disable camera distance changes by player
// arg 0 - (bool)
:CAMERA_DISTANCE_FREEZE
    if
        0@ == true
    then
        0@ = 0x84 // asm TEST
    else
        0@ = 0x89 // asm MOV (original value)
    end

    0A8C: write_memory 0x00528FDD size 1 value 0@ virtual_protect 0
0AB2: cleo_return 0


// set camera distance
// arg 0 - (float) new distance
:CAMERA_DISTANCE_SET
    0A8C: write_memory 0x00B6F0F4 size 4 value 0@ virtual_protect 0 // target value
    0A8C: write_memory 0x00B6F0FC size 4 value 0@ virtual_protect 0 // current value
0AB2: cleo_return 0

 

Now I like to eliminate game's automatic camera distance adjustment when it collides with world geometry, as it is undesired behaviour in my case.

I tried to follow camera processing routines inside exe but without much success. Flags in CCamera and CCam also doesn't do what I need.

Edited by MiranDMC
Link to comment
Share on other sites

Ok I figured it out:
 

// disable follow ped camera's collision detection
// arg 0 - (bool)
:CAMERA_DISABLE_COLLISIONS
    if
        0@ == true
    then
        0@ = 0xE990 // asm NOP JMP
    else
        0@ = 0x840F // asm JE (original value)
    end

    0A8C: write_memory 0x0041B03C size 2 value 0@ virtual_protect 0
0AB2: cleo_return 0 

 

Edited by MiranDMC
Link to comment
Share on other sites

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.