Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

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

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    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. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. 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. Red Dead Redemption 2

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

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

    2. Support

    3. Suggestions

Building Collision Detection?


toonskull
 Share

Recommended Posts

I have tried a few things on my own such as;

 

 

if0179:   actor $PLAYER_ACTOR colliding_with_object -1then//do somethingend//also tried 083D: get_actor $PLAYER_ACTOR velocity_in_direction_XYZ [email protected] [email protected] [email protected] [email protected] == [email protected] == [email protected] == 0.0Actor.Animation($PLAYER_ACTOR) == "RUN_PLAYER"then//do somethingend

 

 

I have googled and searched here without much luck...so how can I know when CJ runs into a wall or hits building while walking around town?

Link to comment
Share on other sites

Attach a object around the player, make it invisible, check if the object has collided, done.

Link to comment
Share on other sites

 

Attach a object around the player, make it invisible, check if the object has collided, done.

Thanks, I will give that a try.

 

Update: I must not be doing this correctly;

 

 

{$VERSION 3.1.0027}{$CLEO .cs}//-------------MAIN---------------thread 'test001' //Place the 8 ball in front of [email protected] = Object.Create(-113, 0.0, 0.0, 0.0)0750: set_object [email protected] visibility 0 wait 250069B: attach_object [email protected] to_actor $PLAYER_ACTOR with_offset 0.0 1.0 0.0 rotation 0.0 0.0 0.0 0382: set_object [email protected] collision_detection 1 //Hit a wall?:test001_1wait 100if andActor.Animation($PLAYER_ACTOR) == "RUN_PLAYER"04DA:   has_object [email protected] collided then0393: actor $PLAYER_ACTOR perform_animation "KO_SHOT_FACE" at 1.0 times_normal_rate end jump @test001_1

 

 

Nothing happens. Well any suggestions?

Edited by toonskull
Link to comment
Share on other sites

The ball is probably inside CJ's brain.

 

And uhh.. Don't you need to load the model first? and wtf why is the model -113?!

 

Also you don't need to use 0382. And for debugging, comment out 0750.

Link to comment
Share on other sites

The ball is probably inside CJ's brain.

 

And uhh.. Don't you need to load the model first? and wtf why is the model -113?!

 

Also you don't need to use 0382. And for debugging, comment out 0750.

No if you load the script and comment out the invisibility (0750) you would see the ball clearly in front of CJ. You really don't understand the -113? You need to bone up on the MAIN.SCM, the top lines define all the objects from -1 to -388 and -113 is the magic 8 ball.

 

The 8 ball clearly passed through the wall of the buildings and had no trigger on the game.

 

@BNB: that line you mentioned means the player is still in motion of jogging at the wall. I know that works, thanks.

 

I think it is pretty obvious to most people that when I run or jog at a brick wall I should fall down like real people do.

Link to comment
Share on other sites

I've partially (for some weird reasons) answered you here.

012          345
678   9A   BCD
EFG HIJK LMN
OPQR  STUV
WX    YZ

Link to comment
Share on other sites

I've partially (for some weird reasons) answered you here.

Thanks Wesser, I have just about given up on the building collision detection. I am exploring other avenues such as the idea prior that the player is stalled out but the animation is running or sprinting. I will keep this option in mind and post anything I can come up with but for now school is back in session today and it will have to wait.

Link to comment
Share on other sites

Just an update to interested parties; I had some minor success at making a position range check. He hits the wall but there is too much delay and sometimes it triggers when no wall is present. In a nutshell, I am trying to make it where CJ hits a wall and falls down. I got the idea when I saw a student at the career center bounce off a wall not looking where he was going. I think hitting peds is going to be easier. But I think they should fall down as well.

Link to comment
Share on other sites

04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.0 2.0 0.0

04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.0 0.0 0.0

 

 

06BD: no_obstacles_between [email protected] [email protected] [email protected] and [email protected] [email protected] [email protected] solid 1 car 0 actor 0 object 0 particle 0

 

i think you should try working with these smile.gif

i hope this helped a bit tounge.gif

Link to comment
Share on other sites

 

04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.0 2.0 0.0

04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.0 0.0 0.0

 

 

06BD:  no_obstacles_between [email protected] [email protected] [email protected] and [email protected] [email protected] [email protected] solid 1 car 0 actor 0 object 0 particle 0 

 

i think you should try working with these  smile.gif

i hope this helped a bit  tounge.gif

Thanks! That did the trick. See the finished script here.

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
 Share

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