|
 |
|
|
|
|
|
GTA Modification Forums
Scrypt error game crashing
 |
|
 |
| |
JACK JONES  |
|
Booom!!!

Group: Members
Joined: Dec 6, 2011


|
Hi. I got some error in my scrypt and it's very hard to find it because it's happening very rarely (almost 1 in 100 cases). Before I start telling you about it I'm sure that the timers (16@ and 17@) are not causing it because I puted them in scrypt yesterday and me and this error met eachother a long time ago. The problem is that sometimes when I hit the pilot in the head or when I blow up a heli-the game crashes and just as I said before it's very rare (mostly when I shot a pilot in the head the game crashes before heli even start to simulate crash landing). The scrypt has several ideas (and I would like to stay that way): if a pilot is being shot the heli will simulate crashing, if a heli is blown up with a projectile he'll explode instantly. Here's the scrypt: | CODE | {$CLEO .cs}
:HUNTERATACK thread 'HELI'
:LOAD wait 250 if and Player.Defined($PLAYER_CHAR) Player.WantedLevel($PLAYER_CHAR) > 3 else_jump @LOAD Model.Load(#HUNTER) Model.Load(#ARMY) Model.Load(#M4) 038B: load_requested_models
:CREATE wait 0 if and Model.Available(#HUNTER) Model.Available(#ARMY) Model.Available(#M4) else_jump @CREATE 04C4: create_coordinate 13@ 14@ 15@ from_actor $PLAYER_ACTOR offset 0.0 200.0 150.0 1@ = Car.Create(#HUNTER, 13@, 14@, 15@) Car.Health(1@) = 150000 Car.ImmuneToNonPlayer(1@) = True Car.SetImmunities(1@, 1, 1, 0, 1, 1) 0129: 3@ = create_actor 6 #ARMY in_car 1@ driverseat 9@ = Actor.Create(Cop, #ARMY, 13@, 14@, 15@) 10@ = Actor.Create(Cop, #ARMY, 13@, 14@, 15@) 0464: put_actor 9@ into_turret_on_car 1@ at_car_offset 0.8 0.0 0.5 position 3 angle 180.0 with_weapon 26 0464: put_actor 10@ into_turret_on_car 1@ at_car_offset -0.8 0.0 0.5 position 3 angle 180.0 with_weapon 26 02E2: set_actor 9@ weapon_accuracy_to 100 02E2: set_actor 10@ weapon_accuracy_to 100 Actor.Health(3@) = 10 Actor.Health(9@) = 10 Actor.Health(10@) = 10 Actor.Health(3@) = 10 Marker.TieToCar(4@, 1@, 4, 2) Marker.SetColor(4@, 1) Model.Destroy(#HUNTER) Model.Destroy(#ARMY) Model.Destroy(#M4)
:EVANTS wait 0 if 8443: not player $PLAYER_CHAR in_a_car else_jump @GOHIGH 04C4: create_coordinate 13@ 14@ 15@ from_actor $PLAYER_ACTOR offset 0.0 40.0 20.9 04A2: heli 1@ fly_to 13@ 14@ 15@ speed 100 if 0184: actor 3@ health >= 1 else_jump @CRASH if 0185: car 1@ health >= 149500 else_jump @BLOW 05E0: 0@ = read_memory 0x94AD28 size 4 virtual_protect 0 0@ += 0x244 05E0: 2@ = read_memory 0@ size 1 virtual_protect 0 if or NOT 2@ == 62 // integer values 8117: NOT player $PLAYER_CHAR wasted else_jump @END wait 0 jump @EVANTS 05DC: end_custom_thread
:CRASH wait 0 16@ = 0 // integer values
:CRASHH wait 0 0564: set_vehicle 1@ helicopter_simulate_crash_landing if 16@ >= 4000 // integer values else_jump @CRASHH
:BLOW 04C4: create_coordinate 5@ 6@ 7@ from_actor $PLAYER_ACTOR offset 0.0 40.0 0.0 02D4: car 1@ turn_off_engine 020B: explode_car 1@ Car.StorePos(1@, 5@, 6@, 7@) 020C: create_explosion_with_radius 11 at 5@ 6@ 7@ 039D: scatter_particles 17 0.8 0 0 0 11000 at 5@ 6@ 7@ 0.1 0.0 0.2 jump @END
:GOHIGH wait 0 04C4: create_coordinate 13@ 14@ 15@ from_actor $PLAYER_ACTOR offset 0.0 -25.0 75.0 04A2: heli 1@ fly_to 13@ 14@ 15@ speed 100 05E0: 0@ = read_memory 0x94AD28 size 4 virtual_protect 0 0@ += 0x244 05E0: 2@ = read_memory 0@ size 1 virtual_protect 0 if or 2@ == 62 // integer values 0117: player $PLAYER_CHAR wasted else_jump @EVANTS
:END wait 0 17@ = 0 // integer values
:ENDD wait 0 if 17@ >= 4000 // integer values else_jump @ENDD Marker.Disable(4@) Actor.DestroyWithFade(3@) Actor.DestroyWithFade(9@) Actor.DestroyWithFade(10@) Car.RemoveReferences(1@) jump @LOAD | Just one more thing-why the below opcode crashing the game? Is it because it can't be used on a dead actor? | CODE | | 01C2: remove_references_to_actor 1@ ;; Like turning an actor into a random pedestrian |
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
JACK JONES  |
Posted: Saturday, Apr 14 2012, 10:51
|
Booom!!!

Group: Members
Joined: Dec 6, 2011


|
I just tested the scrypt in the original Vice City and the game crashing happened again (after I shot the actor 3@) which means that the error is definitely IN the CLEO scrypt - non related to anything else besides the scrypt. The crashing is probably happening because of this opcode: | CODE | | 0564: set_vehicle 1@ helicopter_simulate_crash_landing |
I'm almost 95% sure because when I expel that opcode from the scrypt the crashing stops and this is not the first time that 0564 crashing the game. Does anyone know why this opcode making troubles in my scrypts? Maybe I don't use it properly? If anyone read this please tell me everything you know about the 0564. Also I made some changes in my scrypt (it's basicly the same - I only used diferent method of scrypting so I could expand it in the future): | CODE | {$CLEO .cs} thread 'H1'
:START wait 0 if and Player.Defined($PLAYER_CHAR) Player.WantedLevel($PLAYER_CHAR) > 3 else_jump @START Model.Load(#HUNTER) Model.Load(#ARMY) Model.Load(#M4) 038B: load_requested_models
:LOAD wait 0 if and Model.Available(#HUNTER) Model.Available(#ARMY) Model.Available(#M4) else_jump @LOAD 04C4: create_coordinate 13@ 14@ 15@ from_actor $PLAYER_ACTOR offset 0.0 40.0 30.0 1@ = Car.Create(#HUNTER, 13@, 14@, 15@) Car.ImmuneToNonPlayer(1@) = True Car.SetImmunities(1@, 1, 1, 0, 1, 1) Car.Health(1@) = 150000 0129: 3@ = create_actor 4 #ARMY in_car 1@ driverseat 9@ = Actor.Create(CivMale, #ARMY, 13@, 14@, 15@) 10@ = Actor.Create(CivMale, #ARMY, 13@, 14@, 15@) 0464: put_actor 9@ into_turret_on_car 1@ at_car_offset 0.8 0.0 0.5 position 3 angle 180.0 with_weapon 26 0464: put_actor 10@ into_turret_on_car 1@ at_car_offset -0.8 0.0 0.5 position 3 angle 180.0 with_weapon 26 02E2: set_actor 9@ weapon_accuracy_to 10 02E2: set_actor 10@ weapon_accuracy_to 10 Actor.Health(9@) = 10 Actor.Health(10@) = 10 Actor.Health(3@) = 10 Marker.TieToCar(4@, 1@, 4, 2) Marker.SetColor(4@, 1) Model.Destroy(#HUNTER) Model.Destroy(#ARMY) Model.Destroy(#M4)
:GSB wait 0 gosub @HELI1 05E0: 0@ = read_memory 0x94AD28 size 4 virtual_protect 0 0@ += 0x244 05E0: 2@ = read_memory 0@ size 1 virtual_protect 0 if or 2@ == 62 // integer values 0117: player $PLAYER_CHAR wasted Actor.Dead(3@) else_jump @GSB 16@ = 0 // integer values
:DESTROY wait 0 if 16@ >= 4000 // integer values else_jump @DESTROY Marker.Disable(4@) Actor.DestroyWithFade(3@) Actor.DestroyWithFade(9@) Actor.DestroyWithFade(10@) Car.Destroy(1@) jump @START 05DC: end_custom_thread
:HELI1 wait 0 if 8443: not player $PLAYER_CHAR in_a_car else_jump @GOHIGH 04C4: create_coordinate 13@ 14@ 15@ from_actor $PLAYER_ACTOR offset 0.0 30.0 30.0 04A2: heli 1@ fly_to 13@ 14@ 15@ speed 100 if 0449: actor 3@ in_a_car else_jump @CRASH0 if 0185: car 1@ health >= 149500 else_jump @EXPLO1
:Return1 return
:CRASH0 17@ = 0 // integer values 0564: set_vehicle 1@ helicopter_simulate_crash_landing
:CRASH1 wait 0 if 17@ >= 4000 // integer values else_jump @CRASH1
:EXPLO1 04C4: create_coordinate 5@ 6@ 7@ from_actor $PLAYER_ACTOR offset 0.0 40.0 0.0 02D4: car 1@ turn_off_engine 020B: explode_car 1@ Car.StorePos(1@, 5@, 6@, 7@) 020C: create_explosion_with_radius 2 at 5@ 6@ 7@ 020C: create_explosion_with_radius 11 at 5@ 6@ 7@ 020C: create_explosion_with_radius 1 at 5@ 6@ 7@ 020C: create_explosion_with_radius 6 at 5@ 6@ 7@ 039D: scatter_particles 17 0.8 0 0 0 11000 at 5@ 6@ 7@ 0.1 0.0 0.2 jump @Return1
:GOHIGH wait 0 04C4: create_coordinate 13@ 14@ 15@ from_actor $PLAYER_ACTOR offset 0.0 -25.0 75.0 04A2: heli 1@ fly_to 13@ 14@ 15@ speed 100 jump @Return1 | This post has been edited by JACK JONES on Monday, Apr 16 2012, 11:14
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
Ashwin the new boy  |
|
I am The Most Confused Person

Group: Members
Joined: Nov 14, 2010


|
| QUOTE | | tell me everything you know about the 0564. |
all i know about this is 0564 is not in my OPCrash list, it used to make a Chopper crash on land, it is used simply as others, i have tested & it's 100% working. ---------------------------------------- does the game still crash after this Script ? if yes then tell me what exactly you want this script to do!
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:
Track this topic
Receive email notification when a reply has been made to this topic and you are not active on the board.
Subscribe to this forum
Receive email notification when a new topic is posted in this forum and you are not active on the board.
Download / Print this Topic
Download this topic in different formats or view a printer friendly version.
| |
 |
|
 |
|
|
|
|