toonskull Posted January 2, 2011 Share Posted January 2, 2011 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 More sharing options...
Nahiyan Posted January 2, 2011 Share Posted January 2, 2011 Attach a object around the player, make it invisible, check if the object has collided, done. Link to comment Share on other sites More sharing options...
toonskull Posted January 2, 2011 Author Share Posted January 2, 2011 (edited) 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 January 2, 2011 by toonskull Link to comment Share on other sites More sharing options...
Nahiyan Posted January 2, 2011 Share Posted January 2, 2011 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 More sharing options...
BnB Posted January 2, 2011 Share Posted January 2, 2011 Maybe Actor.Animation($PLAYER_ACTOR) == "RUN_PLAYER" is the problem. Link to comment Share on other sites More sharing options...
toonskull Posted January 2, 2011 Author Share Posted January 2, 2011 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 More sharing options...
Wesser Posted January 3, 2011 Share Posted January 3, 2011 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 More sharing options...
toonskull Posted January 3, 2011 Author Share Posted January 3, 2011 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 More sharing options...
toonskull Posted January 5, 2011 Author Share Posted January 5, 2011 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 More sharing options...
Nabx3n Posted January 6, 2011 Share Posted January 6, 2011 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 i hope this helped a bit Link to comment Share on other sites More sharing options...
toonskull Posted January 7, 2011 Author Share Posted January 7, 2011 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 i hope this helped a bit Thanks! That did the trick. See the finished script here. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now