Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. Red Dead Redemption 2

      1. PC
      2. Gameplay
      3. Missions
      4. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. Diamond Casino & Resort
      2. DLC
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Grand Theft Auto Series

    3. GTA 6

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    3. Featured Mods

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. News

    2. Forum Support

    3. Site Suggestions

Sign in to follow this  
trickstar34

Why does this crash?

Recommended Posts

trickstar34

OK, this my first atuall mission, all my other mods were TXD and non objective CLEO mods, but now I am making a add on to my mod Empire Mode. The place is set away because I want the place easy to be easy to access.

 

Everything is fine untill I get to the Russian, he doesnt have his gun, whats wrong?

Edited by trickstar34

Share this post


Link to post
Share on other sites
Dutchy3010

 

01B2: give_actor [email protected] weapon #AK47 ammo 1000 // Load the weapon model before using this01B9: set_actor [email protected] armed_weapon_to #AK47

 

In these opcodes, you have to use a number. You can look it up in the helpfiles: Help > Content > SCM Documentation > GTA SA > Weapon numbers. In this case, it has to be 30.

Share this post


Link to post
Share on other sites
trickstar34

I added a sphere for starting the mission.

 

This line of code wont compile and says "8 parameters required" but theres nowhere else to put parameters. Whats wrong?

 

 

00FF:   actor $PLAYER_ACTOR sphere 0 in_sphere 2488.5601, -1666.84, 13.38 radius 1.0 1.0 2.0 on_foot 

 

Share this post


Link to post
Share on other sites
Dutchy3010

Don't use comma's.

 

 

00FF:   actor $PLAYER_ACTOR sphere 0 in_sphere 2488.5601 -1666.84 13.38 radius 1.0 1.0 2.0 on_foot 

 

Share this post


Link to post
Share on other sites
trickstar34

How come the mission starts before I even leave the safehouse and the sphere wont disapear when I walk in it? Also when I wreck the car, it doesnt fail the mission.

 

 

Edited by trickstar34

Share this post


Link to post
Share on other sites
Dutchy3010

The sphere won't disappear, because you are using "[email protected]" as variable. When you don't make an official mission structure, you can't use that, because it's a timer. So it will have another value right after you placed the sphere.

 

 

if00FF:   actor $PLAYER_ACTOR sphere 0 in_sphere 2488.5601 -1666.84 13.38 radius 1.0 1.0 2.0 on_foot  thenmarker.Disable([email protected])jump @STARTelse_jump @SPHEREend:START0247: load_model 300247: load_model #MAFBOSS

 

You didn't make this a loop. When the player isn't in the sphere, it will go to :START too. You have to make it in a loop, so for example:

 

repeatwait 0until 00FF:   actor $PLAYER_ACTOR sphere 0 in_sphere 2488.5601 -1666.84 13.38 radius 1.0 1.0 2.0 on_foot  

 

 

When you are loading the model, you have to use #AK47, not 30. Because 30 isn't the model-id (that is 355). Only use it for the 01B2 and 01B9.

Share this post


Link to post
Share on other sites
trickstar34

The sphere still wont disapear.

 

 

Edited by trickstar34

Share this post


Link to post
Share on other sites
Dutchy3010
The sphere won't disappear, because you are using "[email protected]" as variable. When you don't make an official mission structure, you can't use that, because it's a timer. So it will have another value right after you placed the sphere.

Please read my previous post.

 

Besides:

1. Why don't you use:

 

03BD: destroy_sphere [email protected] 

 

2. Why do you put the marker.disable within the repeat-wait-until loop? You can better make it like this:

 

repeatwait 0until 00FF:   actor $PLAYER_ACTOR sphere 0 in_sphere 2488.5601 -1666.84 13.38 radius 1.0 1.0 2.0 on_foot  marker.Disable([email protected]):START0247: load_model #AK47

 

Share this post


Link to post
Share on other sites
trickstar34

 

The sphere won't disappear, because you are using "[email protected]" as variable. When you don't make an official mission structure, you can't use that, because it's a timer. So it will have another value right after you placed the sphere.

Please read my previous post.

 

Besides:

1. Why don't you use:

 

03BD: destroy_sphere [email protected] 

 

It will say local variable [email protected] is to high, max variable is [email protected], so it wont compile.

 

 

Edited by trickstar34

Share this post


Link to post
Share on other sites
Dutchy3010

That was just a code like I copied from SannyBuilder. You always have to change the opcodes the way you need it. wink.gif Of course you have to change it in [email protected] or something.

Share this post


Link to post
Share on other sites
trickstar34

How come when the car is destroyed the mission doesnt fail?

Edited by trickstar34

Share this post


Link to post
Share on other sites
Dutchy3010

 

// Damage Check:MODEL_WRECKEDwait 0 ms          if  0119:   car [email protected] wrecked      else_jump @MODEL_END            jump @MODEL_SPAWN:MODEL_ENDwait 0 msif 0119:   car [email protected] wreckedthen01E3: show_text_1number_styled GXT 'M_FAIL' number 10000 time 5000 style 1  // Mission Failed!Player.Money($PLAYER_CHAR) += -10000jump @Endelse_jump @MODEL_WRECKEDend

 

What you have to understand, is that the code continues after if-then-end. So it will read this code only once.

 

So you have to make something like this:

 

 

:MODEL_WRECKEDwait 100if0119:   car [email protected] wrecked  then01E3: show_text_1number_styled GXT 'M_FAIL' number 10000 time 5000 style 1  // Mission Failed!Player.Money($PLAYER_CHAR) += -10000jump @Endendif00EC:   actor $PLAYER_ACTOR 0 near_point 2100.9604 -1366.8369 radius 5.0 5.0 thenjump @ACTOR_SPAWNendjump @MODEL_WRECKED:ACTOR_SPAWNMarker.Disable([email protected])[email protected] = Actor.Create(CIVFEMALE, #MAFBOSS, 2094.3499, -1342.9515, 23.9844)Actor.Angle([email protected]) = 88.440187: [email protected] = create_marker_above_actor [email protected]

 

 

This way, the code will check again and again if the car is wrecked or the player is at his destination.

Share this post


Link to post
Share on other sites
trickstar34

The game crashes when I get in the car.

Edited by trickstar34

Share this post


Link to post
Share on other sites
Dutchy3010

 

repeatwait 0jump @MODEL_WRECKEDuntil 00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere -2033.7306 170.3496 28.8359 radius 15.0 15.0 15.0

 

Why do you jump in this repeat-wait-until? Now you jump even before the condition can be read! Why don't you just try the code in my previous post?

 

So instead of the code above:

 

if00EC:   actor $PLAYER_ACTOR 0 near_point 2100.9604 -1366.8369 radius 5.0 5.0thenjump @ACTOR_SPAWNendjump @MODEL_WRECKED

 

Share this post


Link to post
Share on other sites
trickstar34

Because the objective of my mission is steal the car, get it back to the garage, and fight the Russians attacking the buisiness.

Share this post


Link to post
Share on other sites
trickstar34

I got the code to work. How do you terminate a local variable so I can use them later in the script? Im adding more to attack you and security at the dealership from which the car is stolen. Also how do you add multible markers above thier heads (add one for each of the enemies). This does not crash, why doesnt it display both the enemies markers?

Edited by trickstar34

Share this post


Link to post
Share on other sites
Dutchy3010

 

0187: [email protected] = create_marker_above_actor [email protected] 0187: [email protected] = create_marker_above_actor [email protected] 

 

Because you created two markers above the same actor. wink.gif

 

Side note:

 

:MODEL_LOADif  8248:   not model #CHEETAH availableelse_jump @MODEL_SPAWNwait 0 msjump @MODEL_LOAD

 

You only check if CHEETAH is loaded, not if the MAFBOSS and AK47 are available.

Share this post


Link to post
Share on other sites
trickstar34

So you cant terminate variables so they can be used to generate another character? Also when I changed it, the game crashed when I killed the 2 enemies.

 

 

If your going to test it out, the mission start marker is in Doherty.

Edited by trickstar34

Share this post


Link to post
Share on other sites
james227uk

I know this probably isn't why it crashes, but I wanna add

 

 

:MODEL_LOADif  8248:   not model #CHEETAH available 8248:   not model #MAFBOSS available8248:   not model #AK47 availableelse_jump @MODEL_SPAWNwait 0 ms jump @MODEL_LOAD

 

 

Checks with more than one condition need and IF-AND construction.

 

 

:MODEL_LOADif and  8248:   not model #CHEETAH available 8248:   not model #MAFBOSS available8248:   not model #AK47 availableelse_jump @MODEL_SPAWNwait 0 ms jump @MODEL_LOAD

 

Share this post


Link to post
Share on other sites
trickstar34

no, its not, but thanks for trying to help, I added it to my code.

 

 

thread "Doherty"// Sphere:SPHEREwait 003BC: [email protected] = create_sphere_at -2033.0713 148.4002 28.8359 radius 2.0repeatwait 0until 00FF:   actor $PLAYER_ACTOR sphere 0 in_sphere -2033.0713 148.4002 28.8359 radius 1.0 1.0 2.0 on_foot  03BD: destroy_sphere [email protected]:START0247: load_model #AK470247: load_model #MAFBOSS0247: load_model #CHEETAH 038B: load_requested_models :MODEL_LOADif and 8248:   not model #CHEETAH available 8248:   not model #MAFBOSS available8248:   not model #AK47 availableelse_jump @MODEL_SPAWNwait 0 ms jump @MODEL_LOAD:[email protected] = Car.Create(#CHEETAH, -1700.8193, 1208.5012, 32.9341)Car.Angle([email protected])= 272.1767              0674: set_car_model [email protected] numberplate "TRICKSTAR 34"0186: [email protected] = create_marker_above_car [email protected]5: set_marker [email protected] color_to 2:Wastedif wasted_or_bustedthen01E3: show_text_1number_styled GXT 'M_FAIL' number 10000 time 5000 style 1  // Mission Failed!Player.Money($PLAYER_CHAR) += -10000jump @Endendif Actor.InCar($PLAYER_ACTOR, [email protected])wait 0then jump @DISTROYendjump @Wasted:DISTROYMarker.Disable([email protected])// 03BC: [email protected] = create_sphere_at -2033.7306 170.3496 28.8359 radius [email protected] = Marker.CreateIconAndSphere(42, -2033.7306, 170.3496, 28.8359):Bustedif wasted_or_bustedthen01E3: show_text_1number_styled GXT 'M_FAIL' number 10000 time 5000 style 1  // Mission Failed!Player.Money($PLAYER_CHAR) += -10000jump @Endend// Damage Check:MODEL_WRECKEDwait 100if0119:   car [email protected] wrecked  then01E3: show_text_1number_styled GXT 'M_FAIL' number 10000 time 5000 style 1  // Mission Failed!Player.Money($PLAYER_CHAR) += -10000jump @Endendif00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere -2033.7306 170.3496 28.8359 radius 15.0 15.0 15.0 thenjump @REMOVE_SPHEREendjump @Busted:REMOVE_SPHERE// 03BD: destroy_sphere [email protected]([email protected]) jump @ACTOR_SPAWN:[email protected] = Actor.Create(CIVMALE, #MAFBOSS, -2028.8303, 196.7372, 32.1487)Actor.Angle([email protected]) = 253.50590187: [email protected] = create_marker_above_actor [email protected] actor.WeaponAccuracy([email protected])= 100actor.Health([email protected]) = 25001B2: give_actor [email protected] weapon 30 ammo 1000 // Load the weapon model before using this01B9: set_actor [email protected] armed_weapon_to 3005E2: AS_actor [email protected] kill_actor [email protected] = Actor.Create(CIVMALE, #MAFBOSS, -2028.8303, 182.7372, 32.1487)Actor.Angle([email protected]) = 253.50590187: [email protected] = create_marker_above_actor [email protected] actor.WeaponAccuracy([email protected])= 100actor.Health([email protected]) = 25001B2: give_actor [email protected] weapon 30 ammo 1000 // Load the weapon model before using this01B9: set_actor [email protected] armed_weapon_to 3005E2: AS_actor [email protected] kill_actor $PLAYER_ACTOR  repeatwait 0if wasted_or_bustedthen01E3: show_text_1number_styled GXT 'M_FAIL' number 10000 time 5000 style 1  // Mission Failed!Player.Money($PLAYER_CHAR) += -10000jump @Endenduntil actor.Dead([email protected])  :NEXTrepeatwait 0if wasted_or_bustedthen01E3: show_text_1number_styled GXT 'M_FAIL' number 10000 time 5000 style 1  // Mission Failed!Player.Money($PLAYER_CHAR) += -10000jump @Endenduntil actor.Dead([email protected])  Marker.Disable([email protected])Marker.Disable([email protected])// End0394: play_music 101E3: show_text_1number_styled GXT 'M_PASS' number 50000 time 5000 style 1 // MISSION PASSED!~n~~w~$~1~:End0249: release_model #CHEETAH0249: release_model 300249: release_model #MAFBOSS00A6: destroy_car [email protected] @SPHERE0A93: end_custom_thread

 

Share this post


Link to post
Share on other sites
ZAZ

Should it be a cleo script? So add the directive {$CLEO .cs} at scriptbeginn.

Otherwise it will be compiled as main.scm and by choosing compile+copy you have this as main.scm in your game.

And this crashs so hard like a bat on your head.

 

This must be or

 

:DOHERTY_10900D6: if or8248:   not model #CHEETAH available 8248:   not model #MAFBOSS available 8248:   not model #AK47 available 004D: jump_if_false @DOHERTY_145 0001: wait 0 ms 0002: jump @DOHERTY_109

 

if one is not available the conditions bust be checked again

 

put wait codes at the loop adress:

 

:DOHERTY_2120001: wait 0 ms 00D6: if 0112:   wasted_or_busted

 

 

:DOHERTY_3230001: wait 0 ms 00D6: if 0112:   wasted_or_busted

 

Share this post


Link to post
Share on other sites
trickstar34

The game doesnt crash untill its supposed to say mission passed (after I kill the enemies) then right as soon as I kill the last one, the game crashes, so the problem is at the end of my code.

Share this post


Link to post
Share on other sites
PatrickW

This

0249: release_model 30

 

Should be :

0249: release_model #AK47

 

Share this post


Link to post
Share on other sites
ZAZ

 

The game doesnt crash untill its supposed to say mission passed (after I kill the enemies) then right as soon as I kill the last one, the game crashes, so the problem is at the end of my code.

I could complete your missi but shure, Patrick found the failure.

Edited by ZAZ

Share this post


Link to post
Share on other sites
trickstar34

How come it the car doesnt spawn where its supposed to? its supposed to be above the store. Also, what did you think of it?

Edited by trickstar34

Share this post


Link to post
Share on other sites
trickstar34

Why iss this crashing? (This is just the part of the code that I have narrowed it down to)

 

 

:[email protected] = Actor.Create(CIVMALE, #WMORI, -1667.1288, 1213.3451, 21.1719)Actor.Angle([email protected]) = 64.6012 actor.WeaponAccuracy([email protected])= 100actor.Health([email protected]) = 20000187: [email protected] = create_marker_above_actor [email protected]: give_actor [email protected] weapon 27 ammo 1000 // Load the weapon model before using this01B9: set_actor [email protected] armed_weapon_to 270638: AS_actor [email protected] stay_put 105E2: AS_actor [email protected] kill_actor $PLAYER_ACTOR:SEEKif 00EC:   actor $PLAYER_ACTOR 0 near_point -1667.1288 1213.3451 radius 5.0 5.0then0638: AS_actor [email protected] stay_put 0jump @MISSIONendjump @SEEK

 

Share this post


Link to post
Share on other sites
trickstar34

Why isnt anything spawning at the right places?

Edited by trickstar34

Share this post


Link to post
Share on other sites
PatrickW

 

Why iss this crashing? (This is just the part of the code that I have narrowed it down to)

 

:TARGET

[email protected] = Actor.Create(CIVMALE, #WMORI, -1667.1288, 1213.3451, 21.1719)

Actor.Angle([email protected]) = 64.6012

actor.WeaponAccuracy([email protected])= 100

actor.Health([email protected]) = 2000

0187: [email protected] = create_marker_above_actor [email protected]

01B2: give_actor [email protected] weapon 27 ammo 1000 // Load the weapon model before using this

01B9: set_actor [email protected] armed_weapon_to 27

0638: AS_actor [email protected] stay_put 1

05E2: AS_actor [email protected] kill_actor $PLAYER_ACTOR

 

Did you successfully load the models: #WMORI and #SHOTGSPA ?

 

 

Why isnt anything spawning at the right places?

>> code cut away <<<

 

Please provide a bit more information when asking help in debugging your code, like:

 

What did you expect to happen?

Why did you expect that behavior?

What behavior did you observe?

When does this behavior occur?

Are the special conditions that trigger this behavior?

 

That will enable other people to focus in on your problem,

and you are more likely to get the help you want.

Edited by PatrickW

Share this post


Link to post
Share on other sites
trickstar34

I have the entire code, and I still have that clip in the code in the post after that, except its just commented it out.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • 2 Users Currently Viewing
    0 members, 0 Anonymous, 2 Guests

×
×
  • Create New...

Important Information

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