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

    1. GTANet.com

    1. GTA Online

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

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

    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. Grand Theft Auto Series

    2. GTA VI

      1. St. Andrews Cathedral
    3. GTA V

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

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
    6. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
    7. GTA III

      1. Guides & Strategies
      2. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. 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

      1. Documentation
    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. Design Your Own Mission
      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. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

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

    1. Announcements

    2. Support

    3. Suggestions

xXxbBb

CLEO Mission

Recommended Posts

xXxbBb

In the CLEO Folder, there's a file 'CustomMission.txt'.

 

{$CLEO .cm}:MyMission thread "MyMission" gosub @MissionStart if  wasted_or_busted then  gosub @MissionFailed end gosub @MissionCleanup end_thread :MissionStart gosub @MissionPassed return :MissionPassedwait 500 01E3: text_1number_styled 'M_PASSD' 0 5000 ms 1 // MISSION PASSED! return :MissionFailed 00BA: text_styled 'M_FAIL' 5000 ms 1 // ~r~MISSION FAILED! return :MissionCleanup $ONMISSION = 0 // integer values mission_cleanup return 

 

I think it's a temp for CLEO mission. Is that right? If it is, then where should I start the mission? Which label is it? I mean, like when you want to load the models, then create them and other stuffs...

Share this post


Link to post
Share on other sites
gtasearcher

:MissionStart, before gosub @MissionPassed. leave that and return as last commands

Share this post


Link to post
Share on other sites
james227uk

gtasbigfoot posted a much easier template some year back, however I can't find it. I'll keep looking for a bit longer

Share this post


Link to post
Share on other sites
ZAZ

 

gtasbigfoot posted a much easier template some year back, however I can't find it. I'll keep looking for a bit longer

shure you could stripp it and write it shorter

 

{$CLEO .cm}03A4: name_thread "TESTM"  0050: gosub @mission10004: $ONMISSION =  000D8: mission_cleanup004E: end_thread:mission10004: $ONMISSION =  1:mission20001: wait 0 msif80E1:  not key_pressed 0 17jf @mission20051: return

 

but it makes not very much sense because you mostly need a fail part and a cleanup part and must place it anywhere

The main usage is that the first subroutine of the missionscript will be canceled by exe if player dies or gets arrested

 

@xXxbBb: i posted templates for cleo mission scripts here and here and here and here and here and here and here

 

To run a Cleo mission script requires allways 2 Cleo script files

1. A .cs file to start the Cleo mission script file

2. The Cleo mission script file itself with extension .cm

Edited by ZAZ

Share this post


Link to post
Share on other sites
xXxbBb

Anyway, there are some keywords that I don't understand.

 

fadefadingwhile Trueend_thread_named

 

Can you please explain those?

Share this post


Link to post
Share on other sites
james227uk

FADE - Makes the game fade to black

FADING - I believe this one checks if the game is fading

WHILE TRUE - Checks if a statement is true, and while it's true it will do something

END_THREAD_NAMED - Will end a thread of your choice, so that it no longer runs (unless the game is restarted)

Share this post


Link to post
Share on other sites
xXxbBb

There are 2 parameters for fade keyword. I guess the 2nd parameter is for duration, but what's the 1st?

Share this post


Link to post
Share on other sites
gtasearcher
There are 2 parameters for fade keyword. I guess the 2nd parameter is for duration, but what's the 1st?

 

fade {0/1} {duration}

 

0 - fade in

1 - fade out

Share this post


Link to post
Share on other sites
xXxbBb

I tried to make a small CLEO mission.

 

{$CLEO .cs}:THREAD03A4: name_thread 'TSTM':DEF0001: wait  0 ms00D6: if  00256:   player $PLAYER_CHAR defined004D: jump_if_false @DEF00D6: if  00038:   $ONMISSION ==  0  // integer values004D: jump_if_false @DEF:Test_M_Start_600D6: if  000FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 2499.2988 -1653.1989 13.4643 radius  2.0 2.0 2.0004D: jump_if_false @DEF00BA: text_styled 'MISSION_START'  1000 ms  20004: $ONMISSION =  1  // integer values0A94: start_custom_mission "2012-Mission"  //0002: jump @DEF

 

 

{$CLEO .cm}03A4: name_thread "TESTM"  0050: gosub @mission10004: $ONMISSION =  000D8: mission_cleanup004E: end_thread:mission10004: $ONMISSION =  1:GANG_LOADModel.Load(#FAM1)Model.Load(#FAM2)Model.Load(#FAM3):GANG_MODELSwait 0if   Model.Available(#FAM1)   Model.Available(#FAM2)   Model.Available(#FAM3)else_jump @GANG_LOAD:GANG_CAMwait 0fade 0 4000iffadingelse_jump @GANG_CAM04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.0 3.0 [email protected] = Actor.Create(gang2, #FAM1, [email protected], [email protected], [email protected])Actor.Health([email protected]) = 20000946: set_actor [email protected] actions_uninterupted_by_weapon_fire 10A1D: AS_actor [email protected] rotate_to_and_look_at_actor $PLAYER_ACTOR05B9: AS_actor [email protected] stay_idle 15750 ms 04C4: store_coords_to [email protected] [email protected] [email protected] from_actor [email protected] with_offset 2.0 0.0 0.0 [email protected] = Actor.Create(gang2, #FAM2, [email protected], [email protected], [email protected])Actor.Health([email protected]) = 20000946: set_actor [email protected] actions_uninterupted_by_weapon_fire 1              0A1D: AS_actor [email protected] rotate_to_and_look_at_actor $PLAYER_ACTOR05B9: AS_actor [email protected] stay_idle 15750 ms04C4: store_coords_to [email protected] [email protected] [email protected] from_actor [email protected] with_offset -2.0 0.0 0.0 [email protected] = Actor.Create(gang2, #FAM3, [email protected], [email protected], [email protected])Actor.Health([email protected]) = 20000946: set_actor [email protected] actions_uninterupted_by_weapon_fire 10A1D: AS_actor [email protected] rotate_to_and_look_at_actor $PLAYER_ACTOR05B9: AS_actor [email protected] stay_idle 15750 msPlayer.CanMove($PLAYER_CHAR) = FALSECamera.PointAt(2495.1787, -1655.7921, 13.3727, 289.7683)07AF: $GANG = player $PLAYER_CHAR group 0631: put_actor [email protected] in_group $GANG 0631: put_actor [email protected] in_group $GANG0631: put_actor [email protected] in_group $GANG02A3: enable_widescreen 1 :GANG_D_LOADwait 004ED: load_animation "PED"if   04EE: animation_loaded "PED"else_jump @GANG_D_LOAD    :CONVwait 0fade 1 4000ifnot fadingelse_jump @CONV00BC: show_text_highpriority GXT 'CJ1' time 1750 flag 1wait 17500812: AS_actor [email protected] perform_animation "ENDCHAT_01" IFP_file "PED" 50.0 LoopA 1 LockX 1 LockY 1 LockF 0 time -100BC: 'FAM1' 1750 1wait 175000BC: 'CJ2' 1750 1wait 175000BC: 'FAM2' 1750 1wait 1750Camera.Shake(3000)0687: clear_actor [email protected] task wait 300000BC: 'FAM3' 1750 1wait 175000BC: 'CJ3' 1750 1:VEHICLE_MODELwait 0Model.Load(#GREENWOO)if   Model.Available(#GREENWOO)else_jump @[email protected] = Car.Create(#GREENWOO, 2513.05, -1667.8521, 13.5651) Car.Angle([email protected]) = 4.029       Marker.CreateAboveCar([email protected], [email protected]):INCARwait 0if and00DB:   actor $PLAYER_ACTOR in_car [email protected]:   actor [email protected] in_car [email protected]:   actor [email protected] in_car [email protected]:   actor [email protected] in_car [email protected]_jump @INCAR0051: return

 

When I stepped on the marker, the game automatically quits. Please tell me what's wrong... sad.gif

Share this post


Link to post
Share on other sites
james227uk

First thing I spotted is that you need

 

 

:GANG_MODELSwait 0if AND  Model.Available(#FAM1)  Model.Available(#FAM2)  Model.Available(#FAM3)else_jump @GANG_MODELS

 

Share this post


Link to post
Share on other sites
ZAZ

 

I tried to make a small CLEO mission.

 

When I stepped on the marker, the game automatically quits. Please tell me what's wrong... sad.gif

 

If you check more than one condition in a conditional check you must declare if it should mean if and or if or

 

:GANG_LOAD

Model.Load(#FAM1)

Model.Load(#FAM2)

Model.Load(#FAM3)

 

:GANG_MODELS

wait 0

if //------------------------ if variation is missing

Model.Available(#FAM1)

Model.Available(#FAM2)

Model.Available(#FAM3)

else_jump @GANG_LOAD// <--- critical jump because IT JUMPS BACK TO A PREVIOUS LABEL

 

if the reading process jumps to a previous label so you must add a wait after that label

 

either in this way

 

 

:GANG_LOADwait 0Model.Load(#FAM1)Model.Load(#FAM2)Model.Load(#FAM3):GANG_MODELSif  and  Model.Available(#FAM1)  Model.Available(#FAM2)  Model.Available(#FAM3)else_jump @GANG_LOAD

 

 

 

or in this way

 

 

:GANG_MODELSwait 0if  and  Model.Available(#FAM1)  Model.Available(#FAM2)  Model.Available(#FAM3)else_jump @GANG_MODELS

 

 

actor [email protected] don't exist at that moment and opcode 0946 cause a crash

 

[email protected] = Actor.Create(gang2, #FAM1, [email protected], [email protected], [email protected])Actor.Health([email protected]) = 2000//0946: set_actor [email protected] actions_uninterupted_by_weapon_fire 1 // actor [email protected] don't exist at that [email protected] = Actor.Create(gang2, #FAM2, [email protected], [email protected], [email protected])Actor.Health([email protected]) = 2000//0946: set_actor [email protected] actions_uninterupted_by_weapon_fire 1 // actor [email protected] don't exist at that moment            0A1D: AS_actor [email protected] rotate_to_and_look_at_actor $PLAYER_ACTOR

 

 

 

 

 

the condition if fading checks if a fading prOcess is in progress

it don't check if a fade was done

so in this case it loops endless and let it always fade

 

:GANG_CAM

wait 0

fade 0 4000

if

fading

else_jump @GANG_CAM

 

remove the fade check, you don't need it

 

:GANG_CAMwait 0fade 0 4000//if//fading//else_jump @GANG_CAM

 

 

 

 

don't load the ifp file "PED" because it's always loaded

 

:GANG_D_LOAD

wait 0

04ED: load_animation "PED"

if

04EE: animation_loaded "PED"

else_jump @GANG_D_LOAD

 

to load the ifp file "PED" cause a crash

this belongs only to the ifp file "PED"

other ifp files must be loaded to can use it's animations

 

 

you must discharge the stuff when the script ends, remove reference of actor and cars or delete them

 

 

 

0164: disable_marker [email protected]: remove_references_to_car [email protected]  // Like turning a car into any random car01C2: remove_references_to_actor [email protected] // Like turning an actor into a random pedestrian01C2: remove_references_to_actor [email protected] // Like turning an actor into a random pedestrian01C2: remove_references_to_actor [email protected] // Like turning an actor into a random pedestrian0004: $ONMISSION =  000D8: mission_cleanup004E: end_thread

 

 

 

 

AS_actor [email protected] don't follow because you wrote 0687: clear_actor [email protected] task

and without 0687: clear_actor [email protected] task he walks endless in the "ENDCHAT_01" animation

remove 0687:

and change the LoopA-param to 0

 

0812: AS_actor [email protected] perform_animation "ENDCHAT_01" IFP_file "PED" 50.0 LoopA 0 LockX 1 LockY 1 LockF 0 time -1

 

 

use locals in cleo instead globals

 

07AF: [email protected] = player $PLAYER_CHAR group0631: put_actor [email protected] in_group [email protected]: put_actor [email protected] in_group [email protected]: put_actor [email protected] in_group [email protected]

 

Edited by ZAZ

Share this post


Link to post
Share on other sites
xXxbBb

 

AS_actor [email protected] don't follow because you wrote 0687: clear_actor [email protected] task

and without 0687: clear_actor [email protected] task he walks endless in the "ENDCHAT_01" animation

remove 0687:

and change the LoopA-param to 0

 

0812: AS_actor [email protected] perform_animation "ENDCHAT_01" IFP_file "PED" 50.0 LoopA 0 LockX 1 LockY 1 LockF 0 time -1

 

Then how do I stop the actor animation without 0687? What I want it to be is for them to talk with CJ and then after CJ's done talking with them, CJ will get in the car with them. dozingoff.gif

Share this post


Link to post
Share on other sites
Deji

 

05B9: AS_actor [email protected] stay_idle 1 ms

 

 

Make the actor do nothing for 1 millisecond.

 

 

0687: clear_actor [email protected] task

 

 

The actor must stop doing anything he is currently doing.

Share this post


Link to post
Share on other sites
ZAZ

 

Then how do I stop the actor animation without 0687?

 

with 1 as LoopA parameter he repeats the animation

0812: AS_actor [email protected] perform_animation "ENDCHAT_01" IFP_file "PED" 50.0 LoopA 1 LockX 1 LockY 1 LockF 0 time -1

 

with 0 as LoopA parameter he do the animation only for one time

0812: AS_actor [email protected] perform_animation "ENDCHAT_01" IFP_file "PED" 50.0 LoopA 0 LockX 1 LockY 1 LockF 0 time -1

 

 

 

What I want it to be is for them to talk with CJ and then after CJ's done talking with them, CJ will get in the car with them. dozingoff.gif

step by step, learn first writing a working mission script

Share this post


Link to post
Share on other sites
xXxbBb

The gangs that I created won't stop moving even after I put the opcode 05B9. The actors also won't do the animations. And after the car is spawned and the actors have to be in the car to accomplish the mission, the gang walks 1 step and then stop, then 1 step and stop. That wastes time. The 'fade' doesn't work either. And even though I've put the opcode

 

0394: play_music 1

 

It still won't play

Here's all the code:

 

{$CLEO .cm}:MyMission thread "MyMission" gosub @MissionStart if  wasted_or_busted then  gosub @MissionFailed end gosub @MissionCleanup end_thread :MissionStart 0004: $ONMISSION =  1:GANG_LOADModel.Load(#FAM1)Model.Load(#FAM2)Model.Load(#FAM3):GANG_MODELSwait 0if and   Model.Available(#FAM1)   Model.Available(#FAM2)   Model.Available(#FAM3)else_jump @GANG_LOAD:GANG_CAMwait 0fade 0 100004C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.0 3.0 [email protected] = Actor.Create(gang2, #FAM1, [email protected], [email protected], [email protected])Actor.Health([email protected]) = 20000946: set_actor [email protected] actions_uninterupted_by_weapon_fire 10A1D: AS_actor [email protected] rotate_to_and_look_at_actor $PLAYER_ACTOR05B9: AS_actor [email protected] stay_idle 15750 ms 04C4: store_coords_to [email protected] [email protected] [email protected] from_actor [email protected] with_offset 2.0 0.0 0.0 [email protected] = Actor.Create(gang2, #FAM2, [email protected], [email protected], [email protected])Actor.Health([email protected]) = 20000946: set_actor [email protected] actions_uninterupted_by_weapon_fire 1              0A1D: AS_actor [email protected] rotate_to_and_look_at_actor $PLAYER_ACTOR05B9: AS_actor [email protected] stay_idle 15750 ms04C4: store_coords_to [email protected] [email protected] [email protected] from_actor [email protected] with_offset -2.0 0.0 0.0 [email protected] = Actor.Create(gang2, #FAM3, [email protected], [email protected], [email protected])Actor.Health([email protected]) = 20000946: set_actor [email protected] actions_uninterupted_by_weapon_fire 10A1D: AS_actor [email protected] rotate_to_and_look_at_actor $PLAYER_ACTOR05B9: AS_actor [email protected] stay_idle 15750 msPlayer.CanMove($PLAYER_CHAR) = FALSECamera.PointAt(2495.1787, -1655.7921, 13.3727, 289.7683)07AF: [email protected] = player $PLAYER_CHAR group 0631: put_actor [email protected] in_group [email protected] 0631: put_actor [email protected] in_group [email protected]: put_actor [email protected] in_group [email protected]: enable_widescreen 1fade 1 1000    :CONVwait 000BC: show_text_highpriority GXT 'CJ1' time 1750 flag 1wait 17500812: AS_actor [email protected] perform_animation "ENDCHAT_01" IFP_file "PED" 50.0 LoopA 1 LockX 1 LockY 1 LockF 0 time -100BC: 'FAM1' 1750 1wait 175000BC: 'CJ2' 1750 1wait 175000BC: 'FAM2' 1750 1wait 1750Camera.Shake(3000)wait 300000BC: 'FAM3' 1750 1wait 175000BC: 'CJ3' 1750 1fade 0 100002A3: enable_widescreen 0 :VEHICLE_MODELwait 0Model.Load(#GREENWOO)if   Model.Available(#GREENWOO)else_jump @[email protected] = Car.Create(#GREENWOO, 2513.05, -1667.8521, 13.5651) Car.Angle([email protected]) = 4.029       Marker.CreateAboveCar([email protected], [email protected]):INCARfade 1 1000wait 0Player.CanMove($PLAYER_CHAR) = TRUE0812: AS_actor [email protected] perform_animation "XPRESS_SCRATCH" IFP_file "PED" 50.0 LoopA 0 LockX 0 LockY 0 LockF 0 time 1870wait 5000812: AS_actor [email protected] perform_animation "XPRESS_SCRATCH" IFP_file "PED" 50.0 LoopA 0 LockX 0 LockY 0 LockF 0 time 18700812: AS_actor [email protected] perform_animation "XPRESS_SCRATCH" IFP_file "PED" 50.0 LoopA 0 LockX 0 LockY 0 LockF 0 time 1870if and00DB:   actor $PLAYER_ACTOR in_car [email protected]:   actor [email protected] in_car [email protected]:   actor [email protected] in_car [email protected]:   actor [email protected] in_car [email protected]_jump @INCARMarker.Disable([email protected])Car.RemoveReferences([email protected])Actor.RemoveReferences([email protected])Actor.RemoveReferences([email protected])Actor.RemoveReferences([email protected])gosub @MissionPassed return :MissionPassedwait 500 0394: play_music 101E3: text_1number_styled 'M_PASSD' 0 5000 ms 1 // MISSION PASSED! return :MissionFailed 00BA: text_styled 'M_FAIL' 5000 ms 1 // ~r~MISSION FAILED! return :MissionCleanup $ONMISSION = 0 // integer values mission_cleanup return

 

Pleaaase... Somebody help me. smile.gif

Edited by xXxbBb

Share this post


Link to post
Share on other sites
james227uk

A while late, but who the hell cares. It's for future reference

Here's the easier template gtasbigfoot posted

 

 

{$CLEO .cm}                                                    03A4: name_thread 'NoName'0050: gosub @Noname2 00D6: if 0112:  wasted_or_busted // mission only 004D: jump_if_false @Noname10050: gosub @Failed_End:Noname10050: gosub @Mission_End004E: end_thread:Noname20317: increment_mission_attempts 0004: $ONMISSION = 1 //-----------------------------------------------------//// Mission Script//-----------------------------------------------------//:Failed_End00BA: show_text_styled GXT 'M_FAIL' time 5000 style 1  // ~r~MISSION FAILED!0051: return:Passed_End01E3: show_text_1number_styled GXT 'M_PASS' number 2000 time 5000 style 1  // MISSION PASSED!~n~~w~$~1~0051: return                                               :Mission_End 0004: $ONMISSION = 000D8: mission_cleanup 0051: return

 

Share this post


Link to post
Share on other sites
TheSiggi

I like that one...looks cleaner than the standart one

*copied 'n' saved*

Share this post


Link to post
Share on other sites
xXxbBb

Okay, let's just say, according to the code I posted previously, I want to make the game fade to black. And when it fades out, the actors have been created so I won't see the actors spawn. Please... Just tell me a piece of the code.

Edited by xXxbBb

Share this post


Link to post
Share on other sites
james227uk

 

fade 0 500repeatwait 0until 816B:   not fading//====================// Spawn actors and what not//====================fade 1 500repeatwait 0until 816B:  not fading

 

 

Share this post


Link to post
Share on other sites
xXxbBb

Maybe this is a little bit stupid question, but what's repeat for?

Share this post


Link to post
Share on other sites
Deji

It just repeats "wait 0" over and over again until the fade has finished.

 

wait's are critical for all loops in San Andreas. Otherwise a crash would occur. For example:

 

 

:LOOPjump @LOOP

 

 

Would cause a crash, because we have 1,000,000,000,000+ (infinite) loops instantly, so an overload would be likely.

 

A thing to remember is "wait 0" doesn't actually mean the game wait's for 0 milliseconds. It means that the game waits for the shortest time possible at that particular moment. It basically just waits until the game is ready to do something else.

 

 

:LOOPwait 0jump @LOOP

 

 

Is fine.

 

 

Like the repeat...end structure, this is also valid:

 

 

while fadingwait 0end

 

 

It creates a loop that waits until the screen has finished fading completely. So while the game is fading, we have to wait.

 

 

repeatwait 0until 816B:  not fading

 

 

This just means until the screen is not fading, we have to wait.

 

 

I actually find the while loop much easier as a while for loop is very pretty when combined with Sanny's keywords. And pretty code can be quite attractive... If code is at all attractive (it doesn't seem to impress the ladies, but does confuse them enough that they think you're like, a genius wink.gif).

Share this post


Link to post
Share on other sites
TheSiggi
skipped

Share this post


Link to post
Share on other sites
xXxbBb

Well, I used the 'While-end' structure in 1 label and the game quits by it's self. confused.gif

 

wait 0fade 0 1000while fadingwait 0(My code)end fade 1 1000   wait 1000

 

Please, tell me what's wrong... dontgetit.gif

Edited by xXxbBb

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.


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