GTAStunting
GTA Series => GTA Modding => Topic started by: Glen1992 on March 27, 2011, 07:33:11 AM
-
Im making a new video and have been working on a script its very basic as its my first time but every time i try to use it my game crashes just wondering if someone could take a look and tell me whats wrong thanks
DEFINE VERSION VICE 0.22
0002: jump ££Label008620
DEFINE MEMORY 34329
:Label008620
0002: jump ££Label008644
DEFINE OBJECTS 1
DEFINE OBJECT DOOR \\ This is an unused object. You can put anything here.
:Label008644
0002: jump ££Label008658
DEFINE MISSIONS 0
;-------------MAIN---------------
:Label008658
03A4: name_thread "MAIN"
016A: fade 0? () 0? ms
01F0: set_max_wanted_level_to 0?
03AD: toggle_rubbish 0?
03DE: set_pedestrians_density_multiplier_to 0?
01EB: set_car_density_to 0?
0111: set_wasted_busted_check_to 0? (disabled)
00C0: set_current_time 10? 0?
04E4: unknown_refresh_game_renderer_at 380.60! 253.15!
03CB: set_camera 380.60! 253.15! 15.43!
0053: $PLAYER_CHAR = create_player #NULL at -366.690! -534.406! 16.301!
01F5: $PLAYER_ACTOR = create_emulated_actor_from_player $PLAYER_CHAR
0330: set_player $PLAYER_CHAR infinite_run_to 1? (true)
0001: wait 0? ms
01B6: set_weather 0?
00D6: if 0?
8118: NOT actor $PLAYER_ACTOR dead
004D: jump_if_false ££Label0086EF
0352: set_actor $PLAYER_ACTOR skin_to "PLAYER"
038B: load_requested_models
0353: refresh_actor $PLAYER_ACTOR
0222: set_player 2228?? health_to 100!
:Label0086EF
016A: fade 1? (back) 1000& ms
00D6: if 0?
0256: player $PLAYER_CHAR defined
004D: jump_if_false ££Label0086EF
04BB: select_interiour 0? \\ select render area
01B4: set_player $PLAYER_CHAR frozen_state 1? (unfrozen)
01B7: release_weather
:Label008700
0001: wait 1000& ms
0247: request_model #PCJ600
0247: request_model #MBA
00D6: if 0?
8248: NOT model #PCJ600 available
8248: NOT model #MBA available
004D: jump_if_false ££Label008706
0001: wait 1000& ms
0002: jump ££Label008700
:Label008706
038B: load_requested_models
0001: wait 1000& ms
0002: jump ££Label008717
:Label008717
0001: wait 1000& ms
00A5: 404?? = create_car #PCJ600 at -362.475! -526.456! 11.781!
0175: set_car 404?? z_angle_to 90!
00AE: unknown_set_car 404?? to_ignore_traffic_lights 1?
00AD: set_car 404?? max_speed_to 0!
02AC: set_car 404?? immunities 1? 1? 1? 1? 1?
0129: 32?? = create_actor 4? #MBA at -366.690! -534.406! 16.301!
0211: actor 32?? walk_to -363.506! -526.355! 11.781!
03E2: actor 32?? enter_car
0350: unknown_actor 32?? not_scared_flag 1?
0002: jump ££Label008722
:Label008722
0001: wait 2000& ms
02C2: car 404?? drive_to_point 85.249! -453.902! 10.497!
00AD: set_car 404?? max_speed_to 10!
-
You could try several things:
1. Perhaps separating out your actor and your vehicle into two separate threads.
2. Using 'put_actor' opcode for getting him into the car instead of 'walk_to'
3. End your thread. Either by created a dead loop thread or using end_thread.
Not sure if any of these will work, but it's a start. If not, remove non-essential lines of thread one at a time until it works. Stuff like ignore opcodes and actor variables. Also you've got two opcodes setting your cars max speed. I dunno that that would cause a crash itself, but it's kinda redundant.
-
Thanks :) i have spent the last few hours trying to sort it out i have made progress both my bike and player spawn but then before the character moves the game crashes this is the new code ;
DEFINE VERSION VICE 0.22
0002: jump ££Label008620
DEFINE MEMORY 34329
:Label008620
0002: jump ££Label008644
DEFINE OBJECTS 1
DEFINE OBJECT DOOR \\ This is an unused object. You can put anything here.
:Label008644
0002: jump ££Label008658
DEFINE MISSIONS 0
;-------------MAIN---------------
:Label008658
03A4: name_thread "MAIN"
016A: fade 0? () 0? ms
01F0: set_max_wanted_level_to 0?
03AD: set_rubbish 0? (invisible)
03DE: set_pedestrians_density_multiplier_to 1?
01EB: set_car_density_to 1?
0111: set_wasted_busted_check_to 0? (disabled)
00C0: set_current_time 22? 0?
04E4: unknown_refresh_game_renderer_at 380.6! 253.15!
03CB: set_camera 380.6! 253.15! 15.43!
0053: $PLAYER_CHAR = create_player #NULL at -366.69! -534.406! 16.301!
01F5: $PLAYER_ACTOR = create_emulated_actor_from_player $PLAYER_CHAR
0330: set_player $PLAYER_CHAR infinite_run_to 1? (true)
0001: wait 0? ms
01B6: set_weather 5?
00D6: if 0?
8118: NOT actor $PLAYER_ACTOR dead
004D: jump_if_false ££Label0086FA
0352: set_actor $PLAYER_ACTOR skin_to "PLAYER"
038B: load_requested_models
0353: refresh_actor $PLAYER_ACTOR
0222: set_player 2228?? health_to 100!
:Label0086FA
016A: fade 1? (back) 1000& ms
00D6: if 0?
0256: player $PLAYER_CHAR defined
004D: jump_if_false ££Label00871E
04BB: select_interiour 0? \\ select render area
01B4: set_player $PLAYER_CHAR frozen_state 1? (unfrozen)
01B7: release_weather
:Label00871E
0001: wait 1000& ms
0247: request_model #PCJ600
0247: request_model #BKA
00D6: if 0?
8248: NOT model #PCJ600 available
8248: NOT model #BKA available
004D: jump_if_false ££Label008658
0001: wait 1000& ms
0002: jump ££Label00874C
:Label00874C
038B: load_requested_models
0002: jump ££Label008755
:Label008755
0001: wait 1000& ms
00A5: 404?? = create_car #PCJ600 at -362.475! -526.456! 11.781!
0175: set_car 404?? z_angle_to 180!
00AD: set_car 404?? max_speed_to 10!
0002: jump ££Label00878C
:Label00878C
009A: 32?? = create_actor 4? #BKA at -378.323! -553.585! 18.593!
0211: actor 32?? walk_to -363.506! -526.355!
01D5: actor 32?? go_to_and_drive_car 404??
0002: jump ££Label0087C2
:Label0087C2
0001: wait 8000& ms
02C2: car 404?? drive_to_point 85.249! -453.902! 10.497!
0002: jump ££Label0087E2
:Label0087E2
0002: jump ££Label0087E2
Any help would be much appreciated
-
Kaneda is a genius :ninja:
-
Try giving a bit of a wait state before your actor moves toward the car. If the car isn't there yet, the game will crash. Coding can be very fickle about timing. I recall having this same problem, and I had to wind up just putting the actor in the car, rather than having them walk to it and enter.
If worse comes worst, mine the game's default script to see how the same kind of coding reads in there.
-
your last 2 lines need a "wait" code in the middle of it so it doesnt crash. I suggest using something above 100ms
-
Thanks guys my game no longer crashes, the timing just seems all wrong lol just needs tweaking now :P