Jump to content

Scrypt error


Jack

Recommended Posts

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:

 

{$CLEO .cs}:HUNTERATACKthread 'HELI' :LOADwait 250 if and  Player.Defined($PLAYER_CHAR)  Player.WantedLevel($PLAYER_CHAR) > 3else_jump @LOAD Model.Load(#HUNTER)Model.Load(#ARMY)Model.Load(#M4)038B: load_requested_models :CREATEwait 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@) = 150000Car.ImmuneToNonPlayer(1@) = TrueCar.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@) = 10Actor.Health(9@) = 10Actor.Health(10@) = 10Actor.Health(3@) = 10Marker.TieToCar(4@, 1@, 4, 2)Marker.SetColor(4@, 1)Model.Destroy(#HUNTER)Model.Destroy(#ARMY)Model.Destroy(#M4):EVANTSwait 0 if 8443:   not player $PLAYER_CHAR in_a_car else_jump @GOHIGH04C4: 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 >= 149500else_jump @BLOW05E0: 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 wastedelse_jump @ENDwait 0 jump @EVANTS05DC: end_custom_thread:CRASHwait 0 16@ = 0 // integer values :CRASHHwait 0 0564: set_vehicle 1@ helicopter_simulate_crash_landingif  16@ >= 4000 // integer values else_jump @CRASHH:BLOW04C4: 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 :GOHIGHwait 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 wastedelse_jump @EVANTS:ENDwait 0 17@ = 0 // integer values :ENDDwait 0 if  17@ >= 4000 // integer values else_jump @ENDDMarker.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?

 

01C2: remove_references_to_actor 1@ ;; Like turning an actor into a random pedestrian

 

Link to comment
Share on other sites

 

01C2: remove_references_to_actor 1@;; Like turning an actor into a random pedestrian

 

Just because actor is dead he isn't meant to vanish itself if he's on list of "needed" vehicles controlled by script.

 

Actually native SCM command was:

 

MARK_CHAR_AS_NO_LONGER_NEEDED

 

Link to comment
Share on other sites

 

Just because actor is dead he isn't meant to vanish itself if he's on list of "needed" vehicles controlled by script.

Yes I know but when I put that opcode in the "ENDD" label-the game crashes instantly so I have no choice but to use "destroy_actor" command instead of "remove_references_to_actor". My question is will the game crash if I use "remove_references" on the alive actor? Also I'm guessing that scrypt error (that is happening rarely in a moment when pilot 3@ is killed) has something to do with heli (or pilot) helth. This damn error is boring me for the passed two weeks. Does anybody have any idea why the game crashes? Of course I could make heli to be completely bulletproof and explosion proof but it's much more realistic if a heli explodes when I hit him with a projectile (or start simulation of crash landing if a pilot is no longer in heli).

Edited by JACK JONES
Link to comment
Share on other sites

spaceeinstein

01C2 is for characters (actors). You have assigned 1@ to a car.

Link to comment
Share on other sites

But my SB showing me 01C3 which is for cars. See it yourself:

user posted image

Link to comment
Share on other sites

You're talking about different opcodes, spaceeinstein meant this:

 

01C2: remove_references_to_actor 1@;; Like turning an actor into a random pedestrian

 

Link to comment
Share on other sites

Oh that - that's not an error - I chose number 1@ randomly to show that opcode which I expelled from the scrypt and replaced it with another one but I don't know why the game crashes sometimes when I kill the pilot.

EDIT: It's solved (I think).

Edited by JACK JONES
Link to comment
Share on other sites

  • 2 weeks later...

I'm sorry for bringing this up guys but the same (pilot dead - start heli crash) error is happening again in my scrypt. The reason I want to talk about this is because I forgot to mention that I made some changes in the weapon.dat file so I got to ask - could such changes (in weapon.dat file) effect on my CLEO scrypt and cause the mysterious game crashing in a moment when I kill the pilot with one of the riffles? Here are the details about my weapon.dat:

 

Tec9  INSTANT_HIT 90.0  250  1000 30   40  -1.0 -1.0  -1.0  -1.0  0.88 -0.04	0.16   rifle    7.5 8 8   11 12 11   99  281 -1  28050	5Uzi INSTANT_HIT 45.0  250  500  30   20  -1.0 -1.0  -1.0  -1.0  0.45  0.00	0.12   uzi	11 13 11  11 13 11   25  282 -1  28840	5Mp5 INSTANT_HIT 45.0  250  500  30   35  -1.0 -1.0  -1.0  -1.0  0.51 -0.01	0.20   uzi	11 13 13  11 13 11   30  284 -1  28840	5m4 INSTANT_HIT 90.0  250  1000 60   40  -1.0 -1.0  -1.0   -1.0 0.88 -0.04	0.16   rifle    11 12 11  11 12 11   99  280 -1  28050	6Ruger INSTANT_HIT 90.0  250  1000 30   37  -1.0 -1.0  -1.0   -1.0 1.00 -0.06	0.17   rifle    11 13 13  11 13 11   99  276 -1  28040	6Launcher PROJECTILE  55.0  100  1200 1    75  2.0  -1.0  1000.0 1.0  0.42 0.0	0.05   unarmed  0  99 14  0  99 14   99  287 -1   324	7M60 INSTANT_HIT 75.0  1    60  100  100 -1.0 -1.0  -1.0   -1.0  1.0  0.00	0.23   rifle    11 12 11  11 12 11   99  289 -1   28050 7Minigun INSTANT_HIT 75.0  1    350  500  140 -1.0 -1.0  -1.0  -1.0  1.28 0.00	0.50   flame    11 12 11  11 12 11   35  290 294  200	7

 

When I'm shooting at the heli I mostly use the m4 weapon which I changed to be the same as m16 from gtaIII (60 bullets in clip, higher speed of firying and increased damage effect). And I tested the scrypt for the past 6 days until I finaly realised that the same error is still happening.

EDIT: And this "remove_references_to_actor" opcode is working now but the game crashing (after pilots death) still continous (rarely).

Edited by JACK JONES
Link to comment
Share on other sites

 

user posted imageJust because actor is dead he isn't meant to vanish itself if he's on list of "needed" vehicles controlled by script.

Link to comment
Share on other sites

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:

 

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):

 

{$CLEO .cs}thread 'H1' :STARTwait 0 if and  Player.Defined($PLAYER_CHAR)  Player.WantedLevel($PLAYER_CHAR) > 3else_jump @STARTModel.Load(#HUNTER)Model.Load(#ARMY)Model.Load(#M4)038B: load_requested_models :LOADwait 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@) = TrueCar.SetImmunities(1@, 1, 1, 0, 1, 1)Car.Health(1@) = 1500000129: 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@) = 10Actor.Health(10@) = 10Actor.Health(3@) = 10Marker.TieToCar(4@, 1@, 4, 2)Marker.SetColor(4@, 1)Model.Destroy(#HUNTER)Model.Destroy(#ARMY)Model.Destroy(#M4):GSBwait 0gosub @HELI105E0: 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 @GSB16@ = 0 // integer values :DESTROYwait 0if 16@ >= 4000 // integer values else_jump @DESTROYMarker.Disable(4@)Actor.DestroyWithFade(3@)Actor.DestroyWithFade(9@)Actor.DestroyWithFade(10@)Car.Destroy(1@)jump @START05DC: end_custom_thread:HELI1wait 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.004A2: heli 1@ fly_to 13@ 14@ 15@ speed 100 if 0449:   actor 3@ in_a_car else_jump @CRASH0if 0185:   car 1@ health >= 149500 else_jump @EXPLO1:Return1return:CRASH017@ = 0 // integer values 0564: set_vehicle 1@ helicopter_simulate_crash_landing :CRASH1wait 0if 17@ >= 4000 // integer values else_jump @CRASH1:EXPLO104C4: 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:GOHIGHwait 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

 

Edited by JACK JONES
Link to comment
Share on other sites

Ashwin.Star

 

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!

Link to comment
Share on other sites

Yes this last scrypt is still crashing (I spend the whole day testing it and the crashing is happening SOMETIMES when I eliminate the pilot 3@). The idea is that heli should start simulation of a crash landing only if a pilot is no longer in heli (like when I kill him he drops from the heli and the simulation starts but sometimes in that moment the game crashes - not always). And if a heli is hit with a projectile he'll explode instantly as you can see in the scrypt:

 

if 0185:   car 1@ health >= 149500 else_jump @EXPLO1

 

So if a pilot is outside the heli - crash landing simulation, if a heli is hit with a projectile - instant explosion. After one of these two evants everything goes from the begining - the hunter will dissappear and a new hunter will show up if the number of stars is bigger then 3. And if a player is wasted or busted the heli will dissappear and the code continuous from the start. And the heli should follow player in a certain distance. Soldiers have orders to shoot at him on site.

EDIT: 4 sec after crash landing simulation the heli should explode with radius 11.

Edited by JACK JONES
Link to comment
Share on other sites

Your bullsh*t sentence doesn't mean anything and it's not related with my topic. WTF are you doing here? You're not one of those native english speakers aren't you? If that's the case then I'll tell you in your words: "Not to Spamming Here" biggrin.gif.

Edited by JACK JONES
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.