Welcome to Open Carnage

A resource for modders and technology enthusiasts; have a wander to see why we're worth the time! EST. 2012

Sign in to follow this  
Followers 0
giraffe

Crouching Boolean

Members of Open Carnage never see off-site ads.

I need a boolean function for whether or not a player is crouching. I know 002's sneaking crouch script has one, but it only returns true if the player is holding the crouch button.

EDIT: Never mind, I found the address I needed by searching by animation_graph_unit_seat_block index.

For anyone who may be interested:

function is_crouching(PlayerIndex)
    local dynamic_player = get_dynamic_player(PlayerIndex)
    if(read_byte(dynamic_player + 0x2A0) == 3) then
        return true
    end
    return false
end

3 is the index for crouch animations assuming you are using the stock animations tag.

 

I know this is probably a bit late, but you might want to also utilize this address as well to determine if they are fully crouched/standing via scale. Plus gives a little bit of wiggle room to tweak with to compensate for things.

readfloat(m_object, 0x50C)
1.0 - Fully Crouched
0.0 - Fully Standing

Just make sure its checking for a player object basically

Edited by Java
Tucker933 likes this

Have an apple! apple.pngskull.png

Share this post


Link to post
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
Sign in to follow this  
Followers 0
  • Recently Browsing   0 members

    No registered users viewing this page.