Nesthor Posted September 21, 2018 Share Posted September 21, 2018 Hello everyone this time I'm working on a code to create a car, a driver, and passengers, this car reaches a point, stops and moves to another, and at this point everyone gets off the car, in this case I'm using a bus , since it is a service station and I want to simulate that they come down to rest. The problem is that there are 4 passengers, and joins well on the bus, but I have other bus dff for example in the benson and this only admits passenger and the others appear but stay at the point where the car was created How to remove these passenger restrictions on cars? This is my code (it's still under construction but it works) I need to put animations and some details like suitcases in the hand of passengers {$CLEO .cs} //-------------MAIN--------------- 0000: NOP thread "STATION_LIVE_BY_NESTHOR" jump @START :START wait 0 if and Player.Defined($PLAYER_CHAR) 00FE: actor $PLAYER_ACTOR sphere 0 in_sphere 1354.3126 475.2162 20.159 radius 150.0 150.0 150.0 jf @START Model.Load(#BUS) Model.Load(#WMYCH) 04ED: load_animation "GANGS" 038B: load_requested_models wait 0 [email protected] = Car.Create(#BUS, 1433.1088, 420.4609, 19.5043) Car.Angle([email protected]) = 64.9809 [email protected] = Actor.Create(CivMale, #WMYCH, 0.0, 0.0, 0.0) Actor.Angle([email protected]) = 0.0 0376: [email protected] = create_random_actor_at 0.0 0.0 0.0 Actor.Angle([email protected]) = 0.0 0376: [email protected] = create_random_actor_at 0.0 0.0 0.0 Actor.Angle([email protected]) = 0.0 0376: [email protected] = create_random_actor_at 0.0 0.0 0.0 Actor.Angle([email protected]) = 0.0 0376: [email protected] = create_random_actor_at 0.0 0.0 0.0 Actor.Angle([email protected]) = 0.0 072A: put_actor [email protected] into_car [email protected] driverseat 072B: put_actor [email protected] into_car [email protected] passengerseat -1 072B: put_actor [email protected] into_car [email protected] passengerseat -1 072B: put_actor [email protected] into_car [email protected] passengerseat -1 072B: put_actor [email protected] into_car [email protected] passengerseat -1 05D1: AS_actor [email protected] drive_car [email protected] to 1353.0725 460.7376 19.8828 speed 15.0 0 model #NULL 0 Jump @PARADA :PARADA wait 0 if and 01B0: car [email protected] sphere 0 in_sphere 1353.0725 460.7376 19.8828 radius 1.0 1.0 1.0 stopped WAIT 9500 05D1: AS_actor [email protected] drive_car [email protected] to 1355.7838 478.1966 20.6497 speed 15.0 0 model #NULL 0 JUMP @BAJADA :BAJADA wait 1000 if and 01B0: car [email protected] sphere 0 in_sphere 1355.7838 478.1966 20.6497 radius 1.0 1.0 1.0 stopped WAIT 1000 0633: AS_actor [email protected] exit_car 07CD: AS_actor [email protected] walk_to 1370.014 474.0732 20.1252 stop_with_angle 205.8104 within_radius 1.0 0633: AS_actor [email protected] exit_car 07CD: AS_actor [email protected] walk_to 1364.8312 472.8913 20.2045 stop_with_angle 117.5122 within_radius 1.0 0633: AS_actor [email protected] exit_car 07CD: AS_actor [email protected] walk_to 1368.6318 471.158 20.2034 stop_with_angle 60.3962 within_radius 1.0 0633: AS_actor [email protected] exit_car 07CD: AS_actor [email protected] walk_to 1366.0138 470.0963 20.1633 stop_with_angle 307.8711 within_radius 1.0 0633: AS_actor [email protected] exit_car 07CD: AS_actor [email protected] walk_to 1371.4766 473.3182 20.127 stop_with_angle 27.2574 within_radius 1.0 0657: car [email protected] open_door 3 JUMP @ANIMACIONES :ANIMACIONES wait 1000 if and 00FE: actor [email protected] sphere 0 in_sphere 1370.014 474.0732 20.1252 radius 0.5 0.5 0.5 0812: AS_actor [email protected] perform_animation "PRTIAL_GNGTLKA" IFP "GANGS" framedelta 4.0 loopA 1 lockX 0 lockY 0 lockF 0 time 72000 // versionB jump @END :END wait 4000 if 80FE: not actor $PLAYER_ACTOR sphere 0 in_sphere 1356.5962 475.654 20.1783 radius 190.0 190.0 190.0 jf @END Car.Destroy([email protected]) Actor.DestroyInstantly([email protected]) Actor.DestroyInstantly([email protected]) Actor.DestroyInstantly([email protected]) Actor.DestroyInstantly([email protected]) Actor.DestroyInstantly([email protected]) 04EF: release_animation "GANGS" wait 10000 jump @START Link to comment Share on other sites More sharing options...
ZAZ Posted September 22, 2018 Share Posted September 22, 2018 (edited) There isn't a restriction, but it's a special hardcoded feature that the bus can take more passenger than the other vehicles. Your tricky method to let take them place by seat number -1 is luck that it works and don't crash. Basicly the models have seat dummies to define the place for the driver and passenger One frontseat dummy for driver and front passenger, cars with 4 doors have also one backseat dummy for 2 passenger If seat dummy is in center, than it can take only one actor, the forklift for example only a driver The Sanchez have one frontseat dummy and one backseat dummy, one for driver, one for passenger, because the dummies are centered The unmodded bus have one frontseat dummy and one backseat dummy at nearly the same place, there where the front passenger have to sit. That's strange and i think it's part of this special hardcoded feature. When you observe with a special cam, what happens while your script is running, you can see only the driver and the front passenger inside the bus The other actors are only assigned by a hardcoded method. And when they exit the bus, then the other actors appear one by one at the front passenger seat and leave the bus. Maybe that won't work with another model in case you have a mod for the bus. To your script: There're big mistakes This isn't a valid conditional check because the else_jump is missing: :PARADA wait 0 if and 01B0: car 1@ sphere 0 in_sphere 1353.0725 460.7376 19.8828 radius 1.0 1.0 1.0 stopped WAIT 9500 05D1: AS_actor 2@ drive_car 1@ to 1355.7838 478.1966 20.6497 speed 15.0 0 model #NULL 0 JUMP @BAJADA and this isn't a conditional code: 05D1: AS_actor 2@ drive_car 1@ to 1355.7838 478.1966 20.6497 speed 15.0 0 model #NULL 0 same mistakes here, this isn't a valid conditional check because the else_jump is missing: :BAJADA wait 1000 if and 01B0: car 1@ sphere 0 in_sphere 1355.7838 478.1966 20.6497 radius 1.0 1.0 1.0 stopped WAIT 1000 and this isn't a conditional code: WAIT 1000 same mistakes here, this isn't a valid conditional check because the else_jump is missing: :ANIMACIONES wait 1000 if and 00FE: actor 2@ sphere 0 in_sphere 1370.014 474.0732 20.1252 radius 0.5 0.5 0.5 0812: AS_actor 2@ perform_animation "PRTIAL_GNGTLKA" IFP "GANGS" framedelta 4.0 loopA 1 lockX 0 lockY 0 lockF 0 time 72000 // versionB and this isn't a conditional code: 0812: AS_actor 2@ perform_animation "PRTIAL_GNGTLKA" IFP "GANGS" framedelta 4.0 loopA 1 lockX 0 lockY 0 lockF 0 time 72000 // versionB read here about conditional check Your first conditional check :START wait 0 if and Player.Defined($PLAYER_CHAR) 00FE: actor $PLAYER_ACTOR sphere 0 in_sphere 1354.3126 475.2162 20.159 radius 150.0 150.0 150.0 jf @START To check Player.Defined($PLAYER_CHAR) is right but you should not check it together with 00FE: actor $PLAYER_ACTOR sphere 0 in_sphere The check if Player.Defined should check if the users PLAYER_CHAR is present, ready for playing, not dead, not in cutscene, before using codes to him, TO AVOID CRASHES in case that he isn't present or not ready for playing, or dead, or in cutscene, So it needs first to check if player is ok, then check if actor $PLAYER_ACTOR is in sphere :START wait 0 if Player.Defined($PLAYER_CHAR) jf @START if 00FE: actor $PLAYER_ACTOR sphere 0 in_sphere 1354.3126 475.2162 20.159 radius 150.0 150.0 150.0 jf @START Furthermore does it needs to check if the vehicle isn't wrecked and if the actor isn't dead before using codes to these Ckeck out the script below {$CLEO .cs} thread 'STATION' :START wait 0 if Player.Defined($PLAYER_CHAR) jf @START if 00FE: actor $PLAYER_ACTOR sphere 0 in_sphere 1354.3126 475.2162 20.159 radius 150.0 150.0 150.0 jf @START Model.Load(#BUS) Model.Load(#WMYCH) 04ED: load_animation "GANGS" 038B: load_requested_models wait 0 1@ = Car.Create(#BUS, 1433.1088, 420.4609, 19.5043) Car.Angle(1@) = 64.9809 2@ = Actor.Create(CivMale, #WMYCH, 0.0, 0.0, 0.0) Actor.Angle(2@) = 0.0 0376: 3@ = create_random_actor_at 0.0 0.0 0.0 Actor.Angle(3@) = 0.0 0376: 4@ = create_random_actor_at 0.0 0.0 0.0 Actor.Angle(4@) = 0.0 0376: 5@ = create_random_actor_at 0.0 0.0 0.0 Actor.Angle(5@) = 0.0 0376: 6@ = create_random_actor_at 0.0 0.0 0.0 Actor.Angle(6@) = 0.0 072A: put_actor 2@ into_car 1@ driverseat 072B: put_actor 3@ into_car 1@ passengerseat -1 072B: put_actor 4@ into_car 1@ passengerseat -1 072B: put_actor 5@ into_car 1@ passengerseat -1 072B: put_actor 6@ into_car 1@ passengerseat -1 05D1: AS_actor 2@ drive_car 1@ to 1353.0725 460.7376 19.8828 speed 15.0 0 model #NULL 0 :PARADA wait 0 if Player.Defined($PLAYER_CHAR) jf @cleanup if and 8119: not car 1@ wrecked 8118: not actor 2@ dead jf @cleanup if 01B0: car 1@ sphere 0 in_sphere 1353.0725 460.7376 19.8828 radius 5.0 5.0 5.0 stopped jf @PARADA WAIT 1000 05D1: AS_actor 2@ drive_car 1@ to 1355.7838 478.1966 20.6497 speed 15.0 0 model #NULL 0 :BAJADA wait 0 if Player.Defined($PLAYER_CHAR) jf @cleanup if and 8119: not car 1@ wrecked 8118: not actor 2@ dead jf @cleanup if 01B0: car 1@ sphere 0 in_sphere 1355.7838 478.1966 20.6497 radius 5.0 5.0 5.0 stopped jf @BAJADA WAIT 1000 0633: AS_actor 2@ exit_car 07CD: AS_actor 2@ walk_to 1370.014 474.0732 20.1252 stop_with_angle 205.8104 within_radius 1.0 0633: AS_actor 3@ exit_car 07CD: AS_actor 3@ walk_to 1364.8312 472.8913 20.2045 stop_with_angle 117.5122 within_radius 1.0 0633: AS_actor 4@ exit_car 07CD: AS_actor 4@ walk_to 1368.6318 471.158 20.2034 stop_with_angle 60.3962 within_radius 1.0 0633: AS_actor 5@ exit_car 07CD: AS_actor 5@ walk_to 1366.0138 470.0963 20.1633 stop_with_angle 307.8711 within_radius 1.0 0633: AS_actor 6@ exit_car 07CD: AS_actor 6@ walk_to 1371.4766 473.3182 20.127 stop_with_angle 27.2574 within_radius 1.0 0657: car 1@ open_door 3 :ANIMACIONES wait 0 if Player.Defined($PLAYER_CHAR) jf @cleanup if and 8119: not car 1@ wrecked 8118: not actor 2@ dead jf @cleanup if 00FE: actor 2@ sphere 0 in_sphere 1370.014 474.0732 20.1252 radius 0.5 0.5 0.5 jf @ANIMACIONES 0812: AS_actor 2@ perform_animation "PRTIAL_GNGTLKA" IFP "GANGS" framedelta 4.0 loopA 1 lockX 0 lockY 0 lockF 0 time 72000 // versionB wait 4000 :END wait 0 if Player.Defined($PLAYER_CHAR) jf @cleanup if 80FE: not actor $PLAYER_ACTOR sphere 0 in_sphere 1356.5962 475.654 20.1783 radius 190.0 190.0 190.0 jf @END :cleanup Car.Destroy(1@) Actor.DestroyInstantly(2@) Actor.DestroyInstantly(3@) Actor.DestroyInstantly(4@) Actor.DestroyInstantly(5@) Actor.DestroyInstantly(6@) 04EF: release_animation "GANGS" wait 10000 jump @START Edited September 22, 2018 by ZAZ CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
Nesthor Posted September 22, 2018 Author Share Posted September 22, 2018 Thank you very much, I'll read more about the jumps, they're my first Cleo. So there is no way to omit the maximum passenger characteristics in vehicles? I would like to use other models besides the coach and bus for this type of Cleos. My intention is to create small scenes on the roads around the city similar to this. Thanks for the explanation Link to comment Share on other sites More sharing options...
ZAZ Posted September 23, 2018 Share Posted September 23, 2018 On 9/22/2018 at 8:50 PM, Nesthor said: So there is no way to omit the maximum passenger characteristics in vehicles? I would like to use other models besides the coach and bus for this type of Cleos. No. Attach other actors by opcode 04F4: and let them do sit animation CLEO MODS CLEO Script Tutorial 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