Nabx3n Posted September 8, 2011 Share Posted September 8, 2011 is there a way to make a reverse check for the car? i tried this one: :REVERSE_19wait 0 if Actor.Driving($PLAYER_ACTOR)else_jump @REVERSE_19 03C0: [email protected] = actor $PLAYER_ACTOR car 02E3: [email protected] = car [email protected] speedif and [email protected] > 1.000E1: player 0 pressed_key 4 else_jump @REVERSE_11306A2: get_car [email protected] velocity_in_direction_XYZ [email protected] [email protected] [email protected] not [email protected] > -1.0jf @REVERSE_1130338: set_car [email protected] visibility 0jump @REVERSE_19 :REVERSE_1130338: set_car [email protected] visibility 1jump @REVERSE_19 but it seams like it only works when the car is heading to south as driving forward and backward. is there a way to get that check to work properly? Link to comment Share on other sites More sharing options...
Deji Posted September 8, 2011 Share Posted September 8, 2011 Yeah, but it would be only CLEO 3 compatible. I don't think there is any other way to check if a car's reversing... if 00DF: actor $PLAYER_ACTOR drivingthen 03C0: [email protected] = actor $PLAYER_ACTOR car 0AB8: get_vehicle [email protected] current_gear_to [email protected] if [email protected] == 0 // reversing gear then 02E3: [email protected] = car [email protected] speed if [email protected] > 1.0 then // car is reversing end endend Link to comment Share on other sites More sharing options...
Wesser Posted September 8, 2011 Share Posted September 8, 2011 Sure, there is. Gas pedal float is located at CVehicle + 0x49C: [...]if 00DF: actor $PLAYER_ACTOR drivingthen 03C0: [email protected] = actor $PLAYER_ACTOR car 0A97: [email protected] = car [email protected] struct [email protected] += 0x49C 0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0 // fGasPedal if [email protected] < 0 then // car is reversing endend[...] You do not need to check if vehicle isn't stopped, since that value is speed dependant. Just add 0x4 to get brake pedal float. 012 345 678 9A BCD EFG HIJK LMN OPQR STUV WX YZ Link to comment Share on other sites More sharing options...
Nabx3n Posted September 8, 2011 Author Share Posted September 8, 2011 thanks for the help guy but there is something i forgot to write there, is that i only use main.scm. cause i only mod the Xbox i'm sorry guys is there a way with main.scm? Link to comment Share on other sites More sharing options...
Wesser Posted September 8, 2011 Share Posted September 8, 2011 I modified @Deji's code to make it working correctly: [...]if 00DF: actor $PLAYER_ACTOR drivingthen 03C0: [email protected] = actor $PLAYER_ACTOR car 0AB8: get_vehicle [email protected] current_gear_to [email protected] if [email protected] == 0 // reversing gear then if 00E1: player 0 pressed_key 14 then // car is reversing end endend[...] 012 345 678 9A BCD EFG HIJK LMN OPQR STUV WX YZ Link to comment Share on other sites More sharing options...
DK22Pac Posted September 8, 2011 Share Posted September 8, 2011 When I worked on backlights for SA, I used that method which Wesser posted. I think it is also possible with animation-check. There's place where animID stored, but after anim setting for car, game restores that value, and you can't catch it in SCM. Link to comment Share on other sites More sharing options...
Wesser Posted September 8, 2011 Share Posted September 8, 2011 He was talking about using pure SCM opcodes because of different game's platform. My first solution works as desired, though. 012 345 678 9A BCD EFG HIJK LMN OPQR STUV WX YZ Link to comment Share on other sites More sharing options...
Deji Posted September 8, 2011 Share Posted September 8, 2011 But 0AB8 is a CLEO opcode... Link to comment Share on other sites More sharing options...
Nabx3n Posted September 8, 2011 Author Share Posted September 8, 2011 I modified @Deji's code to make it working correctly: [...]if 00DF: actor $PLAYER_ACTOR drivingthen 03C0: [email protected] = actor $PLAYER_ACTOR car 0AB8: get_vehicle [email protected] current_gear_to [email protected] if [email protected] == 0 // reversing gear then if 00E1: player 0 pressed_key 14 then // car is reversing end endend[...] 0AB8: get_vehicle [email protected] current_gear_to [email protected] isn't that a cleo opcode? cause that could crash the game no? When I worked on backlights for SA, I used that method which Wesser posted.I think it is also possible with animation-check. There's place where animID stored, but after anim setting for car, game restores that value, and you can't catch it in SCM. that's what im working on, backlights thought about the same thing, i checked it on the Banshee (test model) but i noticed the player doesn't do an animation while reversing. i dunno, maybe it depends on the driving skills or maybe cause he hada gun, but i was thinking about another method and i just can't write it correctly, something about storing coords from car for example 0.0 -8.0 0.0 and everytime the car gets a little closer to it lights turns on and there should be a check if the car got too close to it about radius 2.0 the coords will change position again, "0.0 -8.0 0.0" i feel like it's possible that way but i just kind get confused when i start on it Link to comment Share on other sites More sharing options...
Wesser Posted September 8, 2011 Share Posted September 8, 2011 But 0AB8 is a CLEO opcode... Ops, I made a huge mistake, sorry. 012 345 678 9A BCD EFG HIJK LMN OPQR STUV WX YZ Link to comment Share on other sites More sharing options...
Wesser Posted September 9, 2011 Share Posted September 9, 2011 (edited) Sorry for double-posting but I found out a R*'s style solution. I think it is also possible with animation-check. There's place where animID stored, but after anim setting for car, game restores that value, and you can't catch it in SCM. This issue happens only for player walkstyle animations. Look at the following script: [...]if 00DF: actor $PLAYER_ACTOR drivingthen if and 8611: not actor $PLAYER_ACTOR performing_animation 'CAR_LB' 8611: not actor $PLAYER_ACTOR performing_animation 'CAR_LB_pro' 8611: not actor $PLAYER_ACTOR performing_animation 'CAR_LB_weak' 8611: not actor $PLAYER_ACTOR performing_animation 'QUAD_reverse' // Quad then goto @IsNotPlayerReversing end if and 8611: not actor $PLAYER_ACTOR performing_animation 'BIKEd_pushes' // Motocross 8611: not actor $PLAYER_ACTOR performing_animation 'BIKEh_pushes' // Chopper 8611: not actor $PLAYER_ACTOR performing_animation 'BIKEs_pushes' // Motorbike 8611: not actor $PLAYER_ACTOR performing_animation 'BIKEv_pushes' // Moped 8611: not actor $PLAYER_ACTOR performing_animation 'BMX_pushes' // BMX 8611: not actor $PLAYER_ACTOR performing_animation 'CHOPPA_pushes' // Crossbike 8611: not actor $PLAYER_ACTOR performing_animation 'MTB_pushes' // Mountainbike 8611: not actor $PLAYER_ACTOR performing_animation 'WF_pushes' // Scooter then goto @IsNotPlayerReversing end if 00E1: player 0 pressed_key 14 then // car is reversing end :IsNotPlayerReversingend[...] P.S. Only 8 conditions can be used, else the game returns always false. I don't know if XBOX version can handle DMA but give it a try: {$CLEO}0000: NOPconst TYPE_BYTE = 1 TYPE_SHORT = 2 TYPE_DWORD = 4 endwhile true wait 0 if 00DF: actor $PLAYER_ACTOR driving then [email protected] = 0xB6F3B8 // Player's CVehicle [email protected] = TYPE_DWORD gosub @ReadMemVal [email protected] += 0x49C // fGasPedal [email protected] = TYPE_DWORD gosub @ReadMemVal if [email protected] < 0.0 then // vehicle is reversing end endend:[email protected] -= 0xA49960 [email protected] /= 0x4 008B: [email protected] = &0([email protected],1i)if and [email protected] == 1 // BYTE [email protected] > 0xFF then 0085: [email protected] = [email protected] [email protected] -= 0xFF 0062: [email protected] -= [email protected] else if and [email protected] == 2 // WORD [email protected] > 0xFFFF then 0085: [email protected] = [email protected] [email protected] -= 0xFFFF 0062: [email protected] -= [email protected] else if [email protected] <> 4 // DWORD then [email protected] = 0 end endendreturn Edited September 9, 2011 by Wesser 012 345 678 9A BCD EFG HIJK LMN OPQR STUV WX YZ Link to comment Share on other sites More sharing options...
Nabx3n Posted September 10, 2011 Author Share Posted September 10, 2011 (edited) ok i tried the first idea and it's working well but it's just that for some cars that are set to "LOW" on their handling wich makes the player lower on the seat, he doesnt perform any animation, but its fixable all i did is just change the car animation in vehicle.ide from null to kart. and this is the script i used: :REVERSELIGHTthread 'REVERSELIGHT' :REVERSELIGHT_19wait 0 if and Actor.Driving($PLAYER_ACTOR)847A: not actor $PLAYER_ACTOR driving_bike 84A7: not actor $PLAYER_ACTOR driving_boat 84A9: not actor $PLAYER_ACTOR driving_heli not Actor.DrivingPlane($PLAYER_ACTOR)else_jump @REVERSELIGHT_19 03C0: [email protected] = actor $PLAYER_ACTOR car 02E3: [email protected] = car [email protected] speed if and Actor.Driving($PLAYER_ACTOR) [email protected] > 0.1 00E1: player 0 pressed_key 4 else_jump @REVERSELIGHT_205 if or Actor.Animation($PLAYER_ACTOR) == "CAR_LB" Actor.Animation($PLAYER_ACTOR) == "CAR_LB_PRO" Actor.Animation($PLAYER_ACTOR) == "CAR_LB_WEAK" Actor.Animation($PLAYER_ACTOR) == "DRIVE_TRUCK_BACK"else_jump @REVERSELIGHT_205 // lights turn onjump @REVERSELIGHT_19 :REVERSELIGHT_205// lights turn offjump @REVERSELIGHT_19 0000: NOP const TYPE_BYTE = 1 TYPE_SHORT = 2 TYPE_DWORD = 4 end while true wait 0 if 00DF: actor $PLAYER_ACTOR driving then [email protected] = 0xB6F3B8 // Player's CVehicle [email protected] = TYPE_DWORD gosub @ReadMemVal [email protected] += 0x49C // fGasPedal [email protected] = TYPE_DWORD gosub @ReadMemVal if [email protected] < 0.0 then // vehicle is reversing end end end :ReadMemVal [email protected] -= 0xA49960 [email protected] /= 0x4 008B: [email protected] = &0([email protected],1i) if and [email protected] == 1 // BYTE [email protected] > 0xFF then 0085: [email protected] = [email protected] [email protected] -= 0xFF 0062: [email protected] -= [email protected] else if and [email protected] == 2 // WORD [email protected] > 0xFFFF then 0085: [email protected] = [email protected] [email protected] -= 0xFFFF 0062: [email protected] -= [email protected] else if [email protected] <> 4 // DWORD then [email protected] = 0 end end end return [/code] and exactly how do you make main.scm read it? i don't even know from where the name should start should i add something above the code as for example :test thread 'test' that? sorry i'm just not used to this kind of scripts edit: ok i tried it in that way and when i compiled and tested it, nothing happend while reversing, and the code was translated to this :TESTthread 'TEST' :TEST_11wait 0 if Actor.Driving($PLAYER_ACTOR)jf @TEST_102 [email protected] = 11989944 [email protected] = 4 gosub @TEST_109 [email protected] += 1180 [email protected] = 4 gosub @TEST_109 if not [email protected] >= 0.0 jf @TEST_102 Camera.Shake(100):TEST_102jump @TEST_11 :[email protected] -= 10787168 [email protected] /= 4 008B: [email protected] = &0([email protected],1i) // (int) if and [email protected] == 1 [email protected] > 255 jf @TEST_195 0085: [email protected] = [email protected] // (int) [email protected] -= 255 0062: [email protected] -= [email protected] // (int) jump @TEST_281 :TEST_195if and [email protected] == 2 [email protected] > 65535 jf @TEST_256 0085: [email protected] = [email protected] // (int) [email protected] -= 65535 0062: [email protected] -= [email protected] // (int) jump @TEST_281 :TEST_256if not [email protected] == 4 jf @TEST_281 [email protected] = 0 :TEST_281return is that how it's supposed to be? Edited September 10, 2011 by nabnabnabn Link to comment Share on other sites More sharing options...
Wesser Posted September 10, 2011 Share Posted September 10, 2011 Too bad, it works on Windows platform. Perhaps you have a different version than 1.0 or XBOX one is totally different. 012 345 678 9A BCD EFG HIJK LMN OPQR STUV WX YZ Link to comment Share on other sites More sharing options...
Nabx3n Posted September 10, 2011 Author Share Posted September 10, 2011 Too bad, it works on Windows platform. Perhaps you have a different version than 1.0 or XBOX one is totally different. dang ok then, atleast it works fine with the animation way. better than nothing thanks guys 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