Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

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

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    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. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. 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. Red Dead Redemption 2

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

    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
    1. Announcements

    2. Forum Support

    3. Suggestions

[SA] ~ CLEO Script Tutorial ~


ZAZ
 Share

Recommended Posts

 

hey can u make cleo scripts for me ZAZ??i downloaded many of ur mods and they r wonderful.and if u have a facebook account plzzzz tell me.i can get the hang of this if i can chat directly
Link to comment
Share on other sites

hey can u make cleo scripts for me ZAZ??i downloaded many of ur mods and they r wonderful.and if u have a facebook account plzzzz tell me.i can get the hang of this if i can chat directly

I'm pretty sure he isn't a workhorse. If anything, you would probably need to offer commission.

Link to comment
Share on other sites

  • 2 weeks later...

 

is there any way when CJ answers the phone  the icon appears on the HUD?

 

i mean the cellphone icon.

check if CJ does a phone talk animation and show a textur which overlays the hud icon (or disable hud)

 

{$CLEO .cs}:Phone_Icon03A4: name_thread "PHONICN"wait 1000:Phone_Icon_2wait 0if0256: player $PLAYER_CHAR definedjf @Phone_Icon_2if  or0611:   actor $PLAYER_ACTOR performing_animation "phone_in"0611:   actor $PLAYER_ACTOR performing_animation "phone_talk"0611:   actor $PLAYER_ACTOR performing_animation "carfone_in" 0611:   actor $PLAYER_ACTOR performing_animation "carfone_loopA"0611:   actor $PLAYER_ACTOR performing_animation "carfone_loopA_to_B" 0611:   actor $PLAYER_ACTOR performing_animation "carfone_loopB"0611:   actor $PLAYER_ACTOR performing_animation "carfone_loopB_to_A"jf @Phone_Icon_20390: load_txd_dictionary "LD_SLOT"038F: load_texture "bell" as 1  //0826: enable_hud 0 :Phone_Icon_3wait 0if0256: player $PLAYER_CHAR definedjf @Phone_Icon_4if  or0611:   actor $PLAYER_ACTOR performing_animation "phone_in"0611:   actor $PLAYER_ACTOR performing_animation "phone_talk"0611:   actor $PLAYER_ACTOR performing_animation "carfone_in" 0611:   actor $PLAYER_ACTOR performing_animation "carfone_loopA"0611:   actor $PLAYER_ACTOR performing_animation "carfone_loopA_to_B" 0611:   actor $PLAYER_ACTOR performing_animation "carfone_loopB"0611:   actor $PLAYER_ACTOR performing_animation "carfone_loopB_to_A"jf @Phone_Icon_403F0: enable_text_draw 1038D: draw_texture 1 position 520.0 58.0 size 50.5 70.0 RGBA 255 255 255 255jump @Phone_Icon_3:Phone_Icon_40826: enable_hud 1wait 1000jump @Phone_Icon_2

 

Edited by ZAZ
Link to comment
Share on other sites

It's possible to make it via an ASM hook either.

Link to comment
Share on other sites

 

works fine  biggrin.gif  thanks.

 

I edit the position.

fine, i was sure you would solve it by yourself

and for jetpack, you can also simply check for jetpack

 

if0A0C:   player $PLAYER_CHAR on_jetpack jf @next

 

Edited by ZAZ
Link to comment
Share on other sites

To avoid checking lots of animations, check for task instead:

 

062E: get_actor $PLAYER_ACTOR task 1833 status_store_to [email protected] if  [email protected] <> 7 then // Player is holding the cellphoneend

 

012          345
678   9A   BCD
EFG HIJK LMN
OPQR  STUV
WX    YZ

Link to comment
Share on other sites

You should apply 03E3 opcode before rendering the texture to make it look better.

 

Also, you can hide the fist icon easily by using:

 

 

0A8C: write_memory 0x58F944 size 4 value 0x90909090 virtual_protect 10A8C: write_memory 0x58F948 size 1 value 0x90 virtual_protect 1

 

 

Bring it back using:

 

 

0A8C: write_memory 0x58F944 size 1 value 0xE8 virtual_protect 10A8C: write_memory 0x58F945 size 4 value 0xFFFFDE87 virtual_protect 1

 

 

(untested)

Link to comment
Share on other sites

 

works fine  biggrin.gif  thanks.

 

I edit the position.

fine, i was sure you would solve it by yourself

and for jetpack, you can also simply check for jetpack

 

if0A0C:   player $PLAYER_CHAR on_jetpack jf @next

 

yes i use opcode 0A0C

 

 

You should apply 03E3 opcode before rendering the texture to make it look better.

 

yes thanks the texture whas a litle bit crapy.

Edited by direstraits
Link to comment
Share on other sites

 

You should apply 03E3 opcode before rendering the texture to make it look better.

 

Also, you can hide the fist icon easily by using:

 

 

0A8C: write_memory 0x58F944 size 4 value 0x90909090 virtual_protect 10A8C: write_memory 0x58F948 size 1 value 0x90 virtual_protect 1

 

 

Bring it back using:

 

 

0A8C: write_memory 0x58F944 size 1 value 0xE8 virtual_protect 10A8C: write_memory 0x58F945 size 4 value 0xFFFFDE87 virtual_protect 1

 

 

(untested)

 

How did you find the address? Did you do it by yourself? I had a hard time finding those HUD rendering calls in VC? So far, I have found only two addresses, one for health number and the other for the love icon next to HUD sad.gif . Also I plan it to do by redirecting those address, not by simply disabling the HUD.

 

Also how would you modify the HUD, by suppose, redirecting the original call? Just state what to do man!!

Link to comment
Share on other sites

  • 2 weeks later...

 

Does this tutorial also show how to create a Rockstar type mission?  If so which section does it give in detail most.

Yes, there is a Rockstar type mission template which needs just to remove the cleo directive

but you're misleaded by the word "mission"

you should learn to write a script, called "thread"

 

 

Basicly can you add a cleo script into main.scm

But consider folling differences:

 

 

1.)Cleoscript must beginn with {$CLEO .cs} but remove it to can add it into main.scmTo start a cleo script requires to add this directive at beginn of your modscript:{$CLEO .cs}and compile and copy it into the cleo folderand it requires the running cleo pluginTo start a modscript in main.scm needs to intialize it by:004F: create_thread @modscriptand add the script in the main part of main.scm2.)The code for thread-end is inmain.scm: 004E: end_threadCleo *.cs files: 0A93: end_custom_threadCleo *.cm files: 004E: end_thread3.)The code to start a thread is inmain.scm: 004F: create_thread @modscriptCleo *.cs files: 0A92: create_custom_thread "modscript.cs"Cleo *.cm files: 0A92: create_custom_thread "modscript.cs"in cleo is it used to start another thread because the first script will be loaded by Cleo programma second script can have the extension *.sCleo *.cs files: 0A92: create_custom_thread "one_more_script.s"4.)In Cleo scripts can be used new created codes which work in main.scm as long as Cleo is runningIf Cleo isn't installed you must remove or change these codes to can run the script in main.scmThen the script maybe won't work anymoreBut maybe it needs only to change the keypress codeCleo code: 0AB0:   key_pressed 8main.scm : 00E1:   key_pressed  0  17

 

 

 

 

Example:

 

for cleo

 

{$CLEO .cs}:DEMOTEXT03A4: name_thread "DEMO"wait 1000:DEMOTEXT_1wait 0if0256:   player $PLAYER_CHAR defined004D: jump_if_false @DEMOTEXT_1if0AB0:   key_pressed 8//-----------------key = Backspace004D: jump_if_false @DEMOTEXT_100BA: text_styled 'FEM_OK'  1000 ms  10A93: end_custom_thread

 

 

for main.scm

 

004F: create_thread @DEMOTEXT

 

 

 

:DEMOTEXT03A4: name_thread "DEMO"wait 1000:DEMOTEXT_1wait 0if0256:   player $PLAYER_CHAR defined004D: jump_if_false @DEMOTEXT_1if00E1:   key_pressed  0  17//----------- Fire button004D: jump_if_false @DEMOTEXT_100BA: text_styled 'FEM_OK'  1000 ms  1004E: end_thread

 

Edited by ZAZ
Link to comment
Share on other sites

 

Example:

 

for cleo

 

if0AB0:   key_pressed 8//-----------------key = Backspace004D: jump_if_false @DEMOTEXT_1

 

 

for main.scm

 

 

 

if00E1:   key_pressed  0  17//----------- Fire button004D: jump_if_false @DEMOTEXT_1

 

 

I lol'd.

Link to comment
Share on other sites

I want to create a sound suppressor for the m4 or the ak-47, there is some code for it?

this is not a request, just looking for guidance.

 

Link to comment
Share on other sites

I want to create a sound suppressor for the m4 or the ak-47, there is some code for it?

this is not a request, just looking for guidance.

No, there isn't just some code. It needs to write a script.

and what do mean? how to put a suppressor object at weapon?

or how to disable the sound?

Link to comment
Share on other sites

I want to create a sound suppressor for the m4 or the ak-47, there is some code for it?

this is not a request, just looking for guidance.

No, there isn't just some code. It needs to write a script.

and what do mean? how to put a suppressor object at weapon?

or how to disable the sound?

 

how to disable the sound and shoot without drawing attention whith the m4.

Link to comment
Share on other sites

It's not easy to do via SCM. I'd say, it's even impossible to do it without memory hacking*.

 

 

* Okay, at least "no sound" thing.

Link to comment
Share on other sites

Guys, do not ask for coding help here. Use this section instead.

012          345
678   9A   BCD
EFG HIJK LMN
OPQR  STUV
WX    YZ

Link to comment
Share on other sites

gangsterboyyasin

Well om comming to learn something about cleo and i see a forum that gave tips and evryone ask zaz he is good

Link to comment
Share on other sites

gangsterboyyasin

Zaz dude your tut's are hard to understand im just from netherlands and just a kid can't understand that much

Link to comment
Share on other sites

It's impossible to write anything simplier. If you don't understand it, coding isn't for you yet.

Link to comment
Share on other sites

  • 4 weeks later...
gangsterboyyasin
It's impossible to write anything simplier. If you don't understand it, coding isn't for you yet.

Thx but im smart enough to underatand the coding but dont now what they do or how you enable

Link to comment
Share on other sites

It's impossible to write anything simplier. If you don't understand it, coding isn't for you yet.

Thx but im smart enough to underatand the coding but dont now what they do or how you enable

what's your problem? what didn't you understand?

Link to comment
Share on other sites

  • 1 month later...
Michael.Knight1

Hello ZAZ

I Went To Create

 

Call For Car Model Type

And Car Drive Juste To Actor ,, He Is Be Stop in The Actor Stop in Point

 

Thanks colgate.gif

Link to comment
Share on other sites

 

Hello ZAZ

I Went To Create

 

Call For Car Model Type

And Car Drive Juste To Actor ,, He Is Be Stop in The Actor Stop in Point

 

Thanks  colgate.gif

Read the tutorial from beginning and try every example script, especially the 1. chapter.

Read it again and again. It includes also a template to spawn a car by calling the model name.

Then look for the Car Drive Tutorial

Link to comment
Share on other sites

  • 1 month later...
Ups, visitors. Thx friends.

 

uhm how to make savepoints? cause I dont think I seen one from the tut. but if there is can you tell me wich bit is it.sorry for being a noob. smile.gif  smile.gif

Right, I forgot it.

Here it is:

The classic savescript with savedisk_pickup needs to insert 3 coords points.

One for the savedisk_pickup

One for the spawnpoint beside the pickup

One for the radar marker(If the savedisk is in an interior the location of the radar marker can be very different to pickup)

 

The savepoint of the script below is in the Atrium of Los Santos/Commerce

 

{$CLEO .cs}:SAVE_103A4: name_thread 'SAVE'0A95: enable_thread_saving0570: [email protected] = create_asset_radar_marker_with_icon 35 at 1722.2682 -1647.6366 42.4687018B: show_on_radar [email protected] 2:SAVE_20001: wait 0 ms0213: [email protected] = create_pickup 1277 type 3 at 1720.7397 -1645.6292 20.2267:SAVE_50001: wait 0 ms00D6: if 00256: player $PLAYER_CHAR defined004D: jump_if_false @SAVE_500D6: if 00214: pickup [email protected] picked_up004D: jump_if_false @SAVE_50050: gosub @SAVE_140002: jump @SAVE_2 :SAVE_1400D6: if  00038:   $ONMISSION ==  0  // integer values004D: jump_if_false @SAVE_170004: $ONMISSION =  1  // integer values01B4: set_player $PLAYER_CHAR frozen_state  0 (frozen)0001: wait  350 ms03D8: show_SAVE_screen:SAVE_1500D6: if  083D9:   NOT   save_done004D: jump_if_false @SAVE_160001: wait  0 ms0002: jump @SAVE_15:SAVE_1600A1: put_actor $PLAYER_ACTOR at 1724.3228 -1646.5193 20.22720173: set_actor $PLAYER_ACTOR z_angle_to 176.801B4: set_player $PLAYER_CHAR frozen_state  1 (unfrozen)0004: $ONMISSION =  1  // integer values0001: wait  350 ms0004: $ONMISSION =  0  // integer values:SAVE_170051: return

 

 

So much $ONMISSION = 0 and $ONMISSION = 1

Yes its nesssary. Otherwise the colored gangwar teritories will not be shown if a save was done while gangwar is activ.

 

And again the same script but in the kind of "decompilation without opcodes ":

 

{$CLEO .cs}:SAVE_1thread 'SAVE' 0A95: enable_thread_saving 0570: [email protected] = create_asset_radar_marker_with_icon 35 at 1722.268 -1647.637 42.4687 018B: set_marker [email protected] radar_mode 2 :SAVE_42wait 0 [email protected] = Pickup.Create(1277, 3, 1720.74, -1645.629, 20.2267):SAVE_71wait 0 if   Player.Defined($PLAYER_CHAR)else_jump @SAVE_71 if   Pickup.Picked_up([email protected])else_jump @SAVE_71 gosub @SAVE_121 jump @SAVE_42 :SAVE_121if  $ONMISSION == 0 else_jump @SAVE_240 $ONMISSION = 1 Player.CanMove($PLAYER_CHAR) = Falsewait 350 03D8: show_save_screen :SAVE_160if 83D9:   not save_done else_jump @SAVE_184 wait 0 jump @SAVE_160 :SAVE_184Actor.PutAt($PLAYER_ACTOR, 1724.323, -1646.519, 20.2272)Actor.Angle($PLAYER_ACTOR) = 176.8Player.CanMove($PLAYER_CHAR) = True$ONMISSION = 1 wait 350 $ONMISSION = 0 :SAVE_240return 

 

This doesn't seem to work for me. i try to compile and it says not enough parameters, expected 5.

Are you sure? Because when I copy that code and compile it, I don't have any errors. Are you sure you copied it right?

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
 Share

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