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

    1. GTA Online

      1. The Diamond Casino Heist
      2. Find Lobbies & Players
      3. Guides & Strategies
      4. Vehicles
      5. Content Creator
      6. Help & Support
    2. Red Dead Online

      1. Frontier Pursuits
      2. Find Lobbies & Outlaws
      3. Help & Support
    3. Crews

      1. Events
    1. Red Dead Redemption 2

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

    1. Grand Theft Auto Series

    2. GTA 6

    3. GTA V

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

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
      5. GTA IV Mods
    5. GTA Chinatown Wars

    6. GTA Vice City Stories

    7. GTA Liberty City Stories

    8. GTA San Andreas

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

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

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

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

    3. Mod Showroom

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

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    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
    3. Gangs

    1. News

    2. Forum Support

    3. Site Suggestions

Sign in to follow this  
Ricky12

Bringing a spawned vehicle somewhere

Recommended Posts

Ricky12

I know how to spawn a car during a mission, i want to know how to make the player have to bring the car to a sphere, and only succeed if that excact vehicle is brought there.

 

Also fail if the vehicle is destroyed.

 

 

Also this is in CLEO.

Share this post


Link to post
Share on other sites
ZAZ

 

I know how to spawn a car during a mission, i want to know how to make the player have to bring the car to a sphere, and only succeed if that excact vehicle is brought there.

 

Also fail if the vehicle is destroyed.

 

 

Also this is in CLEO.

you wonna check if the car is a specified model ?

Share this post


Link to post
Share on other sites
Ricky12

well is it possible to make the vehicle unexitable or anything remotly, and then use the sphere that requires the player to be seated insite a vehicle in order for the sphere to work?

Share this post


Link to post
Share on other sites
Dutchy3010

Yeah, that is possible. I scripted something for you, it starts with the code from another topic.

 

 

{$CLEO .cs}0247: request_model #INFERNUS038B: load_requested_modelsrepeatwait 0until Model.Available(#INFERNUS)00A5: [email protected] = create_car #INFERNUS at 2499.2476 -1684.218 11.62760175: set_car [email protected] z_angle_to 102.7758Car.LockInCurrentPosition([email protected]) = Truerepeatwait 0until 00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere 2499.2476 -1684.218 12.9276 radius 10.0 10.0 10.0 Car.LockInCurrentPosition([email protected]) = False03BC: [email protected] = create_sphere_at 2467.5498 -1659.9149 13.2891 radius 2.0 repeatwait 0if 80DB:   not actor $PLAYER_ACTOR in_car [email protected] 0186: [email protected] = create_marker_above_car [email protected] repeat  wait 0  if   0119:   car [email protected] wrecked  then   0164: disable_marker [email protected]   jump @END   end until 00DB:   actor $PLAYER_ACTOR in_car [email protected]   0164: disable_marker [email protected] until 0103:   actor $PLAYER_ACTOR in_sphere 2467.5498 -1659.9149 13.2891 radius 2.0 2.0 2.0 sphere 0 stopped_in_car :END03BD: destroy_sphere [email protected] 0109: player $PLAYER_CHAR money += 10000A93: end_custom_thread

 

 

So, first you create a vehicle. When you are not in the vehicle, there will be a marker above it. If the car is wrecked, the sphere will also disappear. Well, I think you can better just test it yourself. If you have any questions about the code, feel free to ask. wink.gif

Share this post


Link to post
Share on other sites
Ricky12

Well, some of what i would want the script to do, is to make the mission fail if the car is destroyed (like in any race, etc)

 

Does the code do that?

 

also what does the Car.LockInCurrentPosition thingy mean?

 

 

Also, im a guy who likes to see the opcodes for what he does. Does all of these lines even have an opcode? for eksample the lockincurrentposition thingy?

Edited by Ricky12

Share this post


Link to post
Share on other sites
Ricky12

the idea with this mission was basicly this:

 

1. get into a forklift which must not get destroyed

 

2. drive to a spot to pick up some item

 

3. drive back and deliver the item at a specific spot

 

4. halfway back, the cops start chasing you

 

5. you make the delivery, hurray! biggrin.gif

 

 

 

before i proceed with trying to make this mission, i would like to know... is this even possible? confused.gif

Share this post


Link to post
Share on other sites
Dutchy3010

 

also what does the Car.LockInCurrentPosition thingy mean?

Oh, it was another member who started the topic: Click.

 

There was a problem that the car spawns at the nearest path if the player is to far away. That's why we are using "lock in current position".

 

 

Well, some of what i would want the script to do, is to make the mission fail if the car is destroyed (like in any race, etc)

Yeah, in this code, it checks if the player is in the car (else create a marker), and if the car is destroyed. If the car is destroyed, it jumps to "END".

 

 

Also, im a guy who likes to see the opcodes for what he does. Does all of these lines even have an opcode? for eksample the lockincurrentposition thingy?

That is the following opcode:

 

0519: set_car [email protected] locked 1 

 

 

 

before i proceed with trying to make this mission, i would like to know... is this even possible? confused.gif

 

Yeah, it is possible to script. Perhaps you have to use your imagination, but in the mission "Robbing Uncle Sam". Good luck with it. wink.gif

Share this post


Link to post
Share on other sites
Ricky12

OK, i kinda tried using the exanple of mission structure installed along with cleo, and tried to mix it with your code. (The mission is yet not completed)

 

 

{$CLEO .cm}:MyMission 03A4: name_thread 'ammo1' 0050: gosub @MissionStart 00D6: if 0112:  wasted_or_busted then 0050: gosub @MissionFailed end 0050: gosub @MissionCleanup 0A93: end_custom_thread :MissionStart 0001: wait 0 ms0247: request_model #FORKLIFT038B: load_requested_models00D6: if and0248: model #FORKLIFT available004D: jump_if_false @MyMission00A5: [email protected] = create_car #FORKLIFT at 355.221 2469.67 15.910175: set_car [email protected] z_angle_to 140.0Car.LockInCurrentPosition([email protected]) = Truerepeat0001: wait 0 msuntil 00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere 355.221 2469.67 15.91 radius 10.0 10.0 10.0 Car.LockInCurrentPosition([email protected]) = False03BC: [email protected] = create_sphere_at -2478.39 2291.02 4.44712 radius 2.002A8: [email protected] = create_marker 0 at -2478.39 2291.02 4.44712 repeatwait 0if80DB:   not actor $PLAYER_ACTOR in_car [email protected]: [email protected] = create_marker_above_car [email protected] wait 0 if  0119:   car [email protected] wrecked then  0164: disable_marker [email protected]  jump @MissionFailed enduntil 00DB:   actor $PLAYER_ACTOR in_car [email protected]  0164: disable_marker [email protected] 0103:   actor $PLAYER_ACTOR in_sphere 2467.5498 -1659.9149 13.2891 radius 2.0 2.0 2.0 sphere 1 stopped_in_car0050: gosub @MissionPassed 0051: return :MissionPassed0001: wait 500 01E3: text_1number_styled 'M_PASSD' 0 5000 ms 10051: return :MissionFailed 00BA: text_styled 'M_FAIL' 5000 ms 10051: return :MissionCleanup $ONMISSION = 0mission_cleanup014B: $ammo_fork = init_parked_car_generator 530 -1 -1  1 alarm 0 door_lock 0 0 10000 at 355.221 2469.67 15.91 angle 140.0014C: set_parked_car_generator $ammo_fork cars_to_generate_to 101 0051: return

 

 

So, is it very far from good enough, or is it remotly acceptable. I haven't tested it yet, as i heard there would be problems if you made car generators multiple times, and since the reward of doing this mission is unlocking a car generator... well, you get the idea. rolleyes.gif

 

Tell me what you think! tounge.gif

Share this post


Link to post
Share on other sites
Ricky12

no problem

Share this post


Link to post
Share on other sites
Dutchy3010

 

Tell me what you think! tounge.gif

I don't think you will need the "Car.LockInCurrentPosition([email protected]) = True/False" here. Besides, only use the globals that you can find in customvariables.ini.

 

 

00D6: if and0248: model #FORKLIFT available004D: jump_if_false @MyMission

 

This isn't good, because you will use another gosub without using a return. So or jump to MissionStart, but I will advise you to use a repeat-wait-until structure:

 

 

Repeatwait 0until 0248: model #FORKLIFT available

 

 

Next to that, it looks good. But you have to test it to be sure. wink.gif

Edited by Dutchy3010

Share this post


Link to post
Share on other sites
Ricky12

just thought of something vital, i have forgotten to releas the forklift model, and to destroy the car after use...

 

Is there any opcode that makes the player exit the vehicle, so that i can make the actor exit the vehicle immidiatly after he reaches the last sphere?

Share this post


Link to post
Share on other sites
Dutchy3010

 

05CD: AS_actor $PLAYER_ACTOR exit_car [email protected] 

 

Use the opcode search tool next time. wink.gif

Share this post


Link to post
Share on other sites
Ricky12

i did, however i got the impression that opcode was only for AI actors

 

thanks you anyway tounge.gif

 

so this is how my code currently looks:

 

{$CLEO .cm}:MyMission 03A4: name_thread 'ammo1' 0050: gosub @MissionStart 00D6: if 0112:  wasted_or_busted then 0050: gosub @MissionFailed end 0050: gosub @MissionCleanup 0A93: end_custom_thread :MissionStart 0001: wait 0 ms0247: request_model #FORKLIFT038B: load_requested_modelsRepeatwait 0until 0248: model #FORKLIFT available00A5: [email protected] = create_car #FORKLIFT at 355.221 2469.67 15.910175: set_car [email protected] z_angle_to 140.0repeat0001: wait 0 ms03BC: [email protected] = create_sphere_at -2478.39 2291.02 4.44712 radius 2.002A8: [email protected] = create_marker 0 at -2478.39 2291.02 4.44712 repeatwait 0if80DB:   not actor $PLAYER_ACTOR in_car [email protected]: [email protected] = create_marker_above_car [email protected] wait 0 if  0119:   car [email protected] wrecked then  0164: disable_marker [email protected]  jump @MissionFailed enduntil 00DB:   actor $PLAYER_ACTOR in_car [email protected]  0164: disable_marker [email protected] 0103:   actor $PLAYER_ACTOR in_sphere 2467.5498 -1659.9149 13.2891 radius 2.0 2.0 2.0 sphere 1 stopped_in_car0164: disable_marker [email protected]: AS_actor $PLAYER_ACTOR exit_car [email protected]: gosub @MissionPassed 0051: return :MissionPassed0001: wait 500 01E3: text_1number_styled 'M_PASSD' 0 5000 ms 10001: wait 4500016A: fade 0 time 5000051: return :MissionFailed 00BA: text_styled 'M_FAIL' 5000 ms 10051: return :MissionCleanup                              00A6: destroy_car [email protected]: release_model #FORKLIFT$ONMISSION = 0mission_cleanup014B: $ammo_fork = init_parked_car_generator 530 -1 -1  1 alarm 0 door_lock 0 0 10000 at 355.221 2469.67 15.91 angle 140.0014C: set_parked_car_generator $ammo_fork cars_to_generate_to 101 016A: fade 1 time 5000051: return

 

 

will test it after i have added a mission trigger

 

 

EDIT:

Another question:

 

Do i have to define the mission? Like in regular .scm coding you had to find the list of defined missions and add yours there?

Edited by Ricky12

Share this post


Link to post
Share on other sites
Ricky12

The trigger:

 

 :MissionTrigger0001: wait 0 ms00D6: if0256:   player $PLAYER_CHAR defined004D: jump_if_false @MissionTriggerEnd00D6: if0038:   $ONMISSION == 0004D: jump_if_false @MissionTriggerEnd00D6: if00FF: actor $PLAYER_ACTOR 1 near_point_3d_on_foot 354.982 2442.75 16.1004D: jump_if_false @MissionTriggerEnd0004: $ONMISSION = 10001: jump @MyMission:MissionTriggerEnd0002: jump @MissionTrigger

 

 

i have a feeling i will have bad comments on the jump_if_false @MissionTriggerEnd, and jump @MissionTrigger, but i just don't really understand the repeat thingy yet... confused.gif

Share this post


Link to post
Share on other sites
gtasearcher

 

but i just don't really understand the repeat thingy yet... confused.gif

The 'repeat thingy' is equal to this:

:Label// stuff to do, BE SURE TO INCLUDE "WAIT 0"if// condition metjf @Label// etc

Understood?

Oh, and "jf" is equal to "else_jump" and "004D: jump_if_false" smile.gif

Share this post


Link to post
Share on other sites
Ricky12

Like this then?:

 

 :MissionTrigger0001: wait 0 ms00D6: if0256:   player $PLAYER_CHAR definedrepeat00D6: if0038:   $ONMISSION == 0repeat00D6: if00FF: actor $PLAYER_ACTOR 1 near_point_3d_on_foot 354.982 2442.75 16.1repeat0004: $ONMISSION = 10001: jump @MyMission

 

 

EDIT:

"Not enough actual parameters. Expected 8 params."

 

an error came with this script...

 

 

Also when i install this into the game, do i just add this infront of the mission script and insert the file into the GTA San Andreas/CLEO folder?

Edited by Ricky12

Share this post


Link to post
Share on other sites
gtasearcher

 

Like this then?:

 

 :MissionTrigger0001: wait 0 ms00D6: if0256:   player $PLAYER_CHAR definedrepeat00D6: if0038:   $ONMISSION == 0repeat00D6: if00FF: actor $PLAYER_ACTOR 1 near_point_3d_on_foot 354.982 2442.75 16.1repeat0004: $ONMISSION = 10001: jump @MyMission

 

NO!

 

The repeat is useless there and will cause problems there - use your jump if falses, all I did was to tell you how to use repeat.

Use

repeatwait 0until // condition met

 

Share this post


Link to post
Share on other sites
Ricky12

 

:MissionTrigger0001: wait 0 ms00D6: if0256:   player $PLAYER_CHAR defined004D: jump_if_false @MissionTriggerEnd00D6: if0038:   $ONMISSION == 0004D: jump_if_false @MissionTriggerEnd00D6: if00FF: actor $PLAYER_ACTOR 1 near_point_3d_on_foot 354.982 2442.75 16.1004D: jump_if_false @MissionTriggerEnd0004: $ONMISSION = 10001: jump @MyMission:MissionTriggerEnd0002: jump @MissionTrigger

 

 

 

"Not enough actual parameters. Expected 8 params."

 

an error came with this script...

 

 

Also when i install this into the game, do i just add this infront of the mission script and insert the file into the GTA San Andreas/CLEO folder?

Share this post


Link to post
Share on other sites
gtasearcher
Also when i install this into the game, do i just add this infront of the mission script and insert the file into the GTA San Andreas/CLEO folder?

No!

 

Make it a .cs, and instead of "jump @mymissions" choose to start a custom mission [search the opcode].

 

Then put the rest of the mission in a .cm.

 

As for the parameters, I think you need to also specify a 3 float radius.

Share this post


Link to post
Share on other sites
james227uk
:MissionTrigger0001: wait 0 ms00D6: if0256:   player $PLAYER_CHAR defined004D: jump_if_false @MissionTriggerEnd00D6: if0038:   $ONMISSION == 0004D: jump_if_false @MissionTriggerEnd00D6: if00FF: actor $PLAYER_ACTOR 1 near_point_3d_on_foot 354.982 2442.75 16.1004D: jump_if_false @MissionTriggerEnd0004: $ONMISSION = 10001: jump @MyMission:MissionTriggerEnd0002: jump @MissionTrigger

 

 

 

"Not enough actual parameters. Expected 8 params."

 

an error came with this script...

 

 

Also when i install this into the game, do i just add this infront of the mission script and insert the file into the GTA San Andreas/CLEO folder?

When you click Compile, Sanny takes you to the line with the problem

Share this post


Link to post
Share on other sites
Ricky12

 

{$CLEO .cs}0000::MissionTrigger0001: wait 0 ms00D6: if0256:   player $PLAYER_CHAR defined004D: jump_if_false @MissionTriggerEnd00D6: if0038:   $ONMISSION == 0004D: jump_if_false @MissionTriggerEnd00D6: if00FF: actor $PLAYER_ACTOR 1 near_point_3d_on_foot 354.982 2442.75 16.1 radius 2.0 2.0 2.0004D: jump_if_false @MissionTriggerEnd0004: $ONMISSION = 10A94: start_custom_mission "missions\ammo1":MissionTriggerEnd0002: jump @MissionTrigger

 

 

There i think my trigger is finally done. So if i got this right, this trigger should be saved as a .cs

 

 

{$CLEO .cm}:MyMission 03A4: name_thread 'ammo1' 0050: gosub @MissionStart 00D6: if 0112:  wasted_or_busted then 0050: gosub @MissionFailed end 0050: gosub @MissionCleanup 0A93: end_custom_thread :MissionStart 0001: wait 0 ms0247: request_model #FORKLIFT038B: load_requested_modelsRepeatwait 0until 0248: model #FORKLIFT available00A5: [email protected] = create_car #FORKLIFT at 355.221 2469.67 15.910175: set_car [email protected] z_angle_to 140.0repeat0001: wait 0 ms03BC: [email protected] = create_sphere_at -2478.39 2291.02 4.44712 radius 2.002A8: [email protected] = create_marker 0 at -2478.39 2291.02 4.44712 repeatwait 0if80DB:   not actor $PLAYER_ACTOR in_car [email protected]: [email protected] = create_marker_above_car [email protected] wait 0 if  0119:   car [email protected] wrecked then  0164: disable_marker [email protected]  jump @MissionFailed enduntil 00DB:   actor $PLAYER_ACTOR in_car [email protected]  0164: disable_marker [email protected] 0103:   actor $PLAYER_ACTOR in_sphere 2467.5498 -1659.9149 13.2891 radius 2.0 2.0 2.0 sphere 1 stopped_in_car0164: disable_marker [email protected]: AS_actor $PLAYER_ACTOR exit_car [email protected]: gosub @MissionPassed 0051: return :MissionPassed0001: wait 500 01E3: text_1number_styled 'M_PASSD' 0 5000 ms 10001: wait 4500016A: fade 0 time 5000051: return :MissionFailed 00BA: text_styled 'M_FAIL' 5000 ms 10051: return :MissionCleanup                              00A6: destroy_car [email protected]: release_model #FORKLIFT$ONMISSION = 0mission_cleanup014B: $ammo_fork = init_parked_car_generator 530 -1 -1  1 alarm 0 door_lock 0 0 10000 at 355.221 2469.67 15.91 angle 140.0014C: set_parked_car_generator $ammo_fork cars_to_generate_to 101 016A: fade 1 time 5000051: return 

 

 

And there is my mission itself, which i will test after removing the car generator, this will be stored as a .cm

 

 

Have i got everything right now?

 

EDIT: oops forgot the "{cleo .cs}" in the trigger, added it now though

Edited by Ricky12

Share this post


Link to post
Share on other sites
Ricky12

The game crashes when i load my game! cry.gif

 

I really have no idea what is wrong!!

 

HEELP!

 

suicidal.gif

 

 

EDIT:

The game crashes without the mission being in the folder too.........

 

I guess it's time to uninstall San Andreas, and reinstall CLEO, (AGAIN!!! suicidal.gif )

 

 

Im just so f*cking tired of reinstalling my game over, and over, and over, and over again!

barf8bd.gif

 

 

 

WHHYYYYYY GOOOOD???!!!! WHYY DOO YOOOU HATEEE MEEEEEE?????????!!!!!!!!!!!!!!

cryani.gif

Edited by Ricky12

Share this post


Link to post
Share on other sites
Ricky12

just reinstalled the game, sanny builder, downgrade, and CLEO. added the scripts, and start up my game.

 

It seems the trigger works, but when i enter the sphere there is no sign that the actual mission starts, the vehicle doesn't spawn, etc. Can somebody please help?

Share this post


Link to post
Share on other sites
ZAZ

 

{$CLEO .cs}0000::MissionTrigger0001: wait 0 ms00D6: if0256:   player $PLAYER_CHAR defined004D: jump_if_false @MissionTriggerEnd00D6: if0038:   $ONMISSION == 0004D: jump_if_false @MissionTriggerEnd00D6: if00FF: actor $PLAYER_ACTOR 1 near_point_3d_on_foot 354.982 2442.75 16.1 radius 2.0 2.0 2.0004D: jump_if_false @MissionTriggerEnd0004: $ONMISSION = 10A94: start_custom_mission "missions\ammo1":MissionTriggerEnd0002: jump @MissionTrigger

 

 

There i think my trigger is finally done. So if i got this right, this trigger should be saved as a .cs

 

 

{$CLEO .cm}:MyMission 03A4: name_thread 'ammo1' 0050: gosub @MissionStart 00D6: if 0112:  wasted_or_busted then 0050: gosub @MissionFailed end 0050: gosub @MissionCleanup 0A93: end_custom_thread :MissionStart 0001: wait 0 ms0247: request_model #FORKLIFT038B: load_requested_modelsRepeatwait 0until 0248: model #FORKLIFT available00A5: [email protected] = create_car #FORKLIFT at 355.221 2469.67 15.910175: set_car [email protected] z_angle_to 140.0repeat0001: wait 0 ms03BC: [email protected] = create_sphere_at -2478.39 2291.02 4.44712 radius 2.002A8: [email protected] = create_marker 0 at -2478.39 2291.02 4.44712 repeatwait 0if80DB:   not actor $PLAYER_ACTOR in_car [email protected]: [email protected] = create_marker_above_car [email protected] wait 0 if  0119:   car [email protected] wrecked then  0164: disable_marker [email protected]  jump @MissionFailed enduntil 00DB:   actor $PLAYER_ACTOR in_car [email protected]  0164: disable_marker [email protected] 0103:   actor $PLAYER_ACTOR in_sphere 2467.5498 -1659.9149 13.2891 radius 2.0 2.0 2.0 sphere 1 stopped_in_car0164: disable_marker [email protected]: AS_actor $PLAYER_ACTOR exit_car [email protected]: gosub @MissionPassed 0051: return :MissionPassed0001: wait 500 01E3: text_1number_styled 'M_PASSD' 0 5000 ms 10001: wait 4500016A: fade 0 time 5000051: return :MissionFailed 00BA: text_styled 'M_FAIL' 5000 ms 10051: return :MissionCleanup                              00A6: destroy_car [email protected]: release_model #FORKLIFT$ONMISSION = 0mission_cleanup014B: $ammo_fork = init_parked_car_generator 530 -1 -1  1 alarm 0 door_lock 0 0 10000 at 355.221 2469.67 15.91 angle 140.0014C: set_parked_car_generator $ammo_fork cars_to_generate_to 101 016A: fade 1 time 5000051: return 

 

 

And there is my mission itself, which i will test after removing the car generator, this will be stored as a .cm

 

 

Have i got everything right now?

 

EDIT: oops forgot the "{cleo .cs}" in the trigger, added it now though

 

Both scripts above are working by me.

But in the mission script is something wrong

The Missionstart works, forklift appears and two markers are shown (one for forklift, one for destination)

 

Important:

use

004E: end_thread

instaed of 0A93: end_custom_thread in Cleo mission script with extension .cm

read in CLEO Script Tutorial - theme: "Special Particularities in Cleo"

 

The check "if player at point stopped_in_car" includes other coords as the opcode for marker and sphere

And this checkopcode "if actor near point in sphere" displays a sphere with param 1

So it dont need to set a extra sphere (displaying spheres are limited in game with max. 16)

 

Marker and sphere will be not destroyed after mission end in the case if the mission failed before player reach the destination

or before player enter the forklift

 

In opposite the marker of car will be destroyed again and again because its placed in a loop

It needs to add "access checks" read CLEO Script Tutorial - theme: Give access with math coding

 

I compiled and decompiled the script to understand your repeat-until-constract better

 

 

:AMMO1_158//-----Loopadress0001: wait 0 ms 00D6: if 80DB:   not actor $PLAYER_ACTOR in_car [email protected] 004D: jump_if_false @AMMO1_241 0186: [email protected] = create_marker_above_car [email protected] :AMMO1_1890001: wait 0 ms 00D6: if 0119:   car [email protected] wrecked 004D: jump_if_false @AMMO1_221 0164: disable_marker [email protected] 0002: jump @AMMO1_344 :AMMO1_22100DB:   actor $PLAYER_ACTOR in_car [email protected] 004D: jump_if_false @AMMO1_189 0164: disable_marker [email protected]//-------- this code runs permanetly in the case if player is in the forklift :AMMO1_2410103:   actor $PLAYER_ACTOR in_sphere 2467.55 -1659.915 13.2891 radius 2.0 2.0 2.0 sphere 1 stopped_in_car 004D: jump_if_false @AMMO1_158

 

 

Place your parked_car generator in the mission complete part instead in the mission cleanup part

Be attention, parked_car generators can apply doublettes if they are executed at more times

Read CLEO Script Tutorial - theme: "Special Particularities in Cleo" and also "Placing cars by using parked_car_generator"

 

 

additional tips:

give your thread a name

 

{$CLEO .cs}03A4: name_thread 'MSTART':MissionTrigger

 

 

use

 

018A: [email protected] = create_checkpoint_at 2467.55 -1659.915 13.28

 

instead of

02A8: [email protected] = create_marker 0

 

 

Edited by ZAZ

Share this post


Link to post
Share on other sites
Ricky12

thats strange, on my computer the mission doesn't start when i enter the sphere. No forklift, no markers, nothing!

 

Im convinced this is my computer's fault though, as it has messep up alot earlier, as an example it tends not to show markers, etc

Share this post


Link to post
Share on other sites
ZAZ

 

thats strange, on my computer the mission doesn't start when i enter the sphere. No forklift, no markers, nothing!

 

Im convinced this is my computer's fault though, as it has messep up alot earlier, as an example it tends not to show markers, etc

Make shure that you have place the file correct.

According to the mission start opcode:

0A94: start_custom_mission "missions\ammo1"

the mission script must placed in a subfolder

The mission script must be saved as ammo1.txt and compiled as ammo1.cm

and placed in the subfolder "missions"

GTASA\Cleo\missions\ammo1.cm

 

Btw. 02A8: [email protected] = create_marker 0 is not usal. Normaly is it used with an icon number, e.g. 02A8: [email protected] = create_marker 15 at x y z

 

Anyway, I did a bit work and wrote a correct script.

 

1. Make shure that the parked_car generator only for one time will be executed

Therefore it need a global varable which tell the mission starter script that the mission was completed.

Standart global variables of main.scm are not valid, so use the special cleo variable 0AB3: var 12 = 1

Read in CLEO Script Tutorial - theme: CLEO Script Tutorial - theme: "Special Particularities in Cleo" and Give access with math coding

Then place your parked_car generator in the mission complete part

 

2. Because of 05CD: AS_actor $PLAYER_ACTOR exit_car [email protected], you must make shure that the player is in the car [email protected] otherwise it crashs if the player deliver an other vehicle.

Also I think its your wish that the forklift must be delivered

 

if  and00DB:   actor $PLAYER_ACTOR in_car [email protected]:   actor $PLAYER_ACTOR in_sphere -2478.39 2291.02 4.44 radius 2.0 2.0 2.0 sphere 1 stopped_in_car 004D: jump_if_false @AMMO1_main_3

 

 

 

The missionstarter script:

0AB3: var 12 = 0 is used as global variable at scriptbeginn

This needs 0A95: enable_thread_saving to store the scriptstate (if the mission is completed, var 12 will be set to 1 and this lets the starter script ending with 0A93: end_custom_thread.) If you then make a savegame and load this save is the thread not running.

 

Alternative you can remove both:

 

0A95: enable_thread_saving0AB3: var 12 = 0

 

This lets the starter script allways executed from cleo programm, no matter if it was ended because of a mission complete.

In the case if the mission was completed and then a savegame was done is the value of var 12 in the savefile equal to 1

If its not completed so var 12 is not available and if we request then the value of var 12, we will get then 0 (ciro)

 

The MissionTrigger:

 

{$CLEO .cs}03A4: name_thread 'MSTART'0A95: enable_thread_saving0AB3: var 12 = 0:MissionTrigger0001: wait 0 ms00D6: if0256:   player $PLAYER_CHAR defined004D: jump_if_false @MissionTrigger00D6: if0038:   $ONMISSION == 0004D: jump_if_false @MissionTriggerEndcheck0AB4: [email protected] = var 12if  and0039:   [email protected] ==  000FF: actor $PLAYER_ACTOR 1 near_point_3d_on_foot 354.982 2442.75 16.1 radius 2.0 2.0 2.0004D: jump_if_false @MissionTriggerEndcheck0004: $ONMISSION = 10A94: start_custom_mission "missions\ammo1"0002: jump @MissionTrigger:MissionTriggerEndcheck0AB4: [email protected] = var 12if0039:   [email protected] ==  1  // integer values004D: jump_if_false @MissionTrigger0A93: end_custom_thread

 

 

The mission script:

According to the mission start opcode: 0A94: start_custom_mission "missions\ammo1"

The mission script must be saved as ammo1.txt and compiled as ammo1.cm

and placed in the subfolder "missions"

 

 

{$CLEO .cm}:AMMO103A4: name_thread 'AMMO1' 0050: gosub @AMMO1_main_1 00D6: if 0112:   wasted_or_busted // mission only 004D: jump_if_false @AMMO1_2 0050: gosub @AMMO1_fail :AMMO1_20050: gosub @AMMO1_cleanup 004E: end_thread :AMMO1_main_10317: increment_mission_attempts 0001: wait 0 ms 0006: [email protected] =  0  // integer values0247: load_model #FORKLIFT 038B: load_requested_models :AMMO1_main_20001: wait 0 ms 0248:   model #FORKLIFT available 004D: jump_if_false @AMMO1_main_2 00A5: [email protected] = create_car #FORKLIFT at 355.221 2469.67 15.91 0175: set_car [email protected] Z_angle_to 140.0018A: [email protected] = create_checkpoint_at -2478.39 2291.02 4.44 0186: [email protected] = create_marker_above_car [email protected] :AMMO1_main_30001: wait 0 ms 00D6: if 8119:   not car [email protected] wrecked 004D: jump_if_false @AMMO1_fail if  and0039:   [email protected] ==  0  // integer values00DB:   actor $PLAYER_ACTOR in_car [email protected] 004D: jump_if_false @AMMO1_main_4 0164: disable_marker [email protected] 0006: [email protected] =  1:AMMO1_main_4if  and00DB:   actor $PLAYER_ACTOR in_car [email protected]:   actor $PLAYER_ACTOR in_sphere -2478.39 2291.02 4.44 radius 2.0 2.0 2.0 sphere 1 stopped_in_car 004D: jump_if_false @AMMO1_main_3016A: fade 0 time 5000001: wait 500 ms05CD: AS_actor $PLAYER_ACTOR exit_car [email protected]  014B: [email protected] = init_parked_car_generator #FORKLIFT color -1 -1 1 alarm 0 door_lock 0 0 10000 at 355.221 2469.67 15.91 angle 140.0 014C: set_parked_car_generator [email protected] cars_to_generate_to 1010AB3: var 12 = 10001: wait 2000 ms 016A: fade 1 time 50001E3: show_text_1number_styled GXT 'M_PASSD' number 0 time 5000 style 1  // MISSION PASSED! 0051: return :AMMO1_fail00BA: show_text_styled GXT 'M_FAIL' time 5000 style 1  // ~r~MISSION FAILED!0051: return :AMMO1_cleanupif0039:   [email protected] ==  0004D: jump_if_false @AMMO1_cleanup_20164: disable_marker [email protected]:AMMO1_cleanup_200A6: destroy_car [email protected] 0249: release_model #FORKLIFT  0164: disable_marker [email protected]: $ONMISSION = 0 00D8: mission_cleanup  0051: return 

 

 

 

Furthermore I wrote the mission script by using the repeat-until construct.

But I dont know how to make shure that both conditions must be passed to complete the mission:

if and

00DB: actor $PLAYER_ACTOR in_car [email protected]

0103: actor $PLAYER_ACTOR in_sphere -2478.39 2291.02 4.44 radius 2.0 2.0 2.0 sphere 1 stopped_in_car

 

so I used only the check for "if actor in sphere" and replaced 05CD: AS_actor $PLAYER_ACTOR exit_car [email protected]

with 0792: disembark_instantly_actor $PLAYER_ACTOR

 

{$CLEO .cm}:MyMission03A4: name_thread 'AMMO1' 0050: gosub @MyMission_main_1 00D6: if 0112:   wasted_or_busted // mission only 004D: jump_if_false @MyMission_2 0050: gosub @MyMission_fail :MyMission_20050: gosub @MyMission_cleanup 004E: end_thread :MyMission_main_10317: increment_mission_attempts 0001: wait 0 ms 0006: [email protected] =  0  // integer values0247: load_model #FORKLIFT 038B: load_requested_models Repeatwait 0until 0248: model #FORKLIFT available00A5: [email protected] = create_car #FORKLIFT at 355.221 2469.67 15.91 0175: set_car [email protected] Z_angle_to 140.0018A: [email protected] = create_checkpoint_at -2478.39 2291.02 4.44 0186: [email protected] = create_marker_above_car [email protected] repeat   wait 0   if       not Car.Wrecked([email protected])       then           if  and                [email protected] ==  0               Actor.InCar($PLAYER_ACTOR, [email protected])               then               Marker.Disable([email protected])               [email protected] = 1           end       else       jump @MyMission_fail   enduntil 0103:   actor $PLAYER_ACTOR in_sphere -2478.39 2291.02 4.44 radius 2.0 2.0 2.0 sphere 1 stopped_in_car016A: fade 0 time 5000001: wait 500 ms0792: disembark_instantly_actor $PLAYER_ACTOR //05CD: AS_actor $PLAYER_ACTOR exit_car [email protected]: [email protected] = init_parked_car_generator #FORKLIFT color -1 -1 1 alarm 0 door_lock 0 0 10000 at 355.221 2469.67 15.91 angle 140.0 014C: set_parked_car_generator [email protected] cars_to_generate_to 1010AB3: var 12 = 10001: wait 2000 ms 016A: fade 1 time 500 01E3: show_text_1number_styled GXT 'M_PASSD' number 0 time 5000 style 1  // MISSION PASSED!0051: return :MyMission_fail00BA: show_text_styled GXT 'M_FAIL' time 5000 style 1  // ~r~MISSION FAILED!0051: return :MyMission_cleanupif0039:   [email protected] ==  0004D: jump_if_false @MyMission_cleanup_20164: disable_marker [email protected]:MyMission_cleanup_200A6: destroy_car [email protected] 0249: release_model #FORKLIFT  0164: disable_marker [email protected]: $ONMISSION = 0 00D8: mission_cleanup  0051: return 

 

Share this post


Link to post
Share on other sites
Ricky12

i did some very minor changes:

 

:MissionTrigger0001: wait 0 ms00D6: if0256:   player $PLAYER_CHAR defined004D: jump_if_false @MissionTrigger00D6: if0038:   $ONMISSION == 0004D: jump_if_false @MissionTriggerEndcheck02A8: [email protected] = create_marker 55 at 354.982 2442.75 16.1      <------ here0AB4: [email protected] = var 12if  and0039:   [email protected] ==  000FF: actor $PLAYER_ACTOR 1 near_point_3d_on_foot 354.982 2442.75 16.1 radius 2.0 2.0 2.0004D: jump_if_false @MissionTriggerEndcheck0164: disable_marker [email protected]    <------ here0004: $ONMISSION = 10A94: start_custom_mission "missions\ammo1"0002: jump @MissionTrigger

 

 

Added a marker and makes the marker dissappear when the mission starts

 

 

:AMMO1_main_20001: wait 0 ms0248:   model #FORKLIFT available004D: jump_if_false @AMMO1_main_200A5: [email protected] = create_car #FORKLIFT at 355.221 2469.67 15.910175: set_car [email protected] Z_angle_to 140.0018A: [email protected] = create_checkpoint_at -2478.39 2291.02 4.440186: [email protected] = create_marker_above_car [email protected]: set_marker [email protected] color_to 1  <------- here 

 

 

Change the colour of the forklift marker, so that it doesn't seem like an enemy

 

 

The marker that indicates where the mission starts shows, just as supposed to. However when i start the mission the marker does not dissappear, and the markers related to the mission (destination/forklift) does not show!

 

short question:

What went wrong?

Share this post


Link to post
Share on other sites
ZAZ

 

The marker that indicates where the mission starts shows, just as supposed to. However when i start the mission the marker does not dissappear, and the markers related to the mission (destination/forklift) does not show!

 

short question:

What went wrong?

Dont know, my posted scripts work fine by me

 

 

:MissionTrigger0001: wait 0 ms00D6: if0256:   player $PLAYER_CHAR defined004D: jump_if_false @MissionTrigger00D6: if0038:   $ONMISSION == 0004D: jump_if_false @MissionTriggerEndcheck02A8: [email protected] = create_marker 55 at 354.982 2442.75 16.1      <------ wrong place because it will be executed permanently0AB4: [email protected] = var 12if  and0039:   [email protected] ==  000FF: actor $PLAYER_ACTOR 1 near_point_3d_on_foot 354.982 2442.75 16.1 radius 2.0 2.0 2.0004D: jump_if_false @MissionTriggerEndcheck0164: disable_marker [email protected]    <------ here0004: $ONMISSION = 10A94: start_custom_mission "missions\ammo1"0002: jump @MissionTrigger

 

 

 

{$CLEO .cs}03A4: name_thread 'MSTART'0A95: enable_thread_saving0AB3: var 12 = 002A8: [email protected] = create_marker 55 at 354.982 2442.75 16.1   <------ put it here:MissionTrigger

 

 

 

Share this post


Link to post
Share on other sites
Ricky12

next in my mission i want it to be a object for the forklift to pick up and bring back to the starting point, and when the forklift come within a radius i want the forklift to get some cop heat.

 

I have no idea how to make the game check if the object is placed in the right position I tried opcode search, and i have been reading through the coding bible.

 

So im asking for your help again dontgetit.gif

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  

  • 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.