crashoverride93 Posted February 1, 2017 Share Posted February 1, 2017 Again this is a new script for GTA3 but the game crashes {$CLEO .cs} thread 'ACTORH' :ACTORH_00 wait 100 if 0256: player $PLAYER_CHAR defined else_jump @ACTORH_00 :ACTORH_01 wait 1000 0247: request_model #FEMALE01 0247: request_model #SHOTGUN if and 0248: model #FEMALE01 available 0248: model #SHOTGUN available else_jump @ACTORH_01 038B: load_requested_models 0054: store_player $PLAYER_CHAR position_to [email protected] [email protected] [email protected] [email protected] += 1.75 // floating-point values [email protected] += 3.0 // floating-point values 009A: [email protected] = create_actor_pedtype 43 model #FEMALE01 at [email protected] [email protected] [email protected] 01DE: tie_actor [email protected] to_actor $PLAYER_ACTOR 02E2: set_actor [email protected] weapon_accuracy_to 100 :ACTORH_02 wait 1000 0054: store_player $PLAYER_CHAR position_to [email protected] [email protected] [email protected] [email protected] += 1.75 // floating-point values [email protected] += 3.0 // floating-point values if 0AE1: [email protected] = random_actor_near_point [email protected] [email protected] [email protected] in_radius 15.0 find_next 1 pass_deads 1 //IF and SET else_jump @ACTORH_02 :ACTORH_03 wait 1000 01B2: give_actor [email protected] weapon 4 ammo 400 0223: set_actor [email protected] health_to 999 035F: set_actor [email protected] armour_to 999 01CB: actor [email protected] kill_actor [email protected] :ACTORH_04 wait 15000 if 0118: actor [email protected] dead else_jump @ACTORH_04 0249: release_model [email protected] jump @ACTORH_03 Link to comment Share on other sites More sharing options...
Sloth- Posted February 2, 2017 Share Posted February 2, 2017 (edited) How to solve crash problems: What i do everytime i experiment crashes is testing my code in isolated parts. Comment all code you can leaving only the minimum possible to run. Your game should stop crashing after that, if not, you are making a mistake in that minimum code you left uncommented. After reaching that point your game stops crashing, you must uncomment step by step until your game begins crashing again. Then you'll have found the problem. Or in order to advance more quickly, just uncoment half of the code, if your game stops crashing, error is in commented part. If not, probably commented part is clean, but you have to make sure of that uncommenting that part and commenting the zone that makes your game crash. After that, all you have to do is reduce the area of test until is so small that the problem becomes obvious.... Another thing is: write code in high level instead of low. Low level code is difficult to read, and what is difficult to read is difficult to debug... An example: This is more easy to read: while true wait 1000 01B2: give_actor [email protected] weapon 4 ammo 400 0223: set_actor [email protected] health_to 999 035F: set_actor [email protected] armour_to 999 01CB: actor [email protected] kill_actor [email protected] repeat wait 15000 until 0118: actor [email protected] dead 0249: release_model [email protected] than this :ACTORH_03wait 100001B2: give_actor [email protected] weapon 4 ammo 4000223: set_actor [email protected] health_to 999035F: set_actor [email protected] armour_to 99901CB: actor [email protected] kill_actor [email protected]:ACTORH_04wait 15000if0118: actor [email protected] deadelse_jump @ACTORH_040249: release_model [email protected] @ACTORH_03 And is exactly the same code. Want another example? You tell me what is more readable: if0039: [email protected] == 0else_jump @CODE_9050006: [email protected] = 1jump @CODE_1077:CODE_9050006: [email protected] = 0:CODE_1077// More code if 0039: [email protected] == 0then 0006: [email protected] = 1else 0006: [email protected] = 0end// More code Read more about high level coding here. Or just watch Sanny Builder Help section. About your code: I don't think this is causing the crashes, but why using so long waits? :ACTORH_00wait 100if0256: player $PLAYER_CHAR definedelse_jump @ACTORH_00 why wait 100? wait 0 should work just fine. :ACTORH_01wait 10000247: request_model #FEMALE010247: request_model #SHOTGUNif and0248: model #FEMALE01 available0248: model #SHOTGUN availableelse_jump @ACTORH_01 038B: load_requested_models Why wait 1000? Also, you should do the request instruction before the loop, just like this: 0247: request_model #FEMALE010247: request_model #SHOTGUN038B: load_requested_models:ACTORH_01wait 0if and0248: model #FEMALE01 available0248: model #SHOTGUN availableelse_jump @ACTORH_01 And should work. Also, notice that you put instruction 038B: load_requested_models after loop, but it should go before requests. :ACTORH_04wait 15000if0118: actor [email protected] deadelse_jump @ACTORH_04 Again, why wait 15 seconds?! Well, hope this helps.... Edited February 2, 2017 by Sloth- 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