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

 

{$CLEO}0000: [email protected] = 32.0 0AC7: [email protected] = var [email protected] [email protected] *= 0x90900A8C: write_memory 0x58F91C    size 6 value [email protected] virtual_protect 1     //weapon icon X0A93: end_custom_thread

 

It works for me but of course, only with cleo4

weapon icon placed at left upper border

Link to comment
Share on other sites

I have CLEO v4.1.1.30f. But how would switch to another [email protected] float this effect is the same.

 

 

{$CLEO}0000: [email protected] = 32.00AC7: [email protected] = var [email protected] [email protected] *= 0x90900A8C: write_memory 0x58F91C    size 6 value [email protected] virtual_protect 1     //weapon icon X0A93: end_custom_thread

 

 

[email protected] replace to...

 

 

{$CLEO}0000: [email protected] = 9999.00AC7: [email protected] = var [email protected] [email protected] *= 0x90900A8C: write_memory 0x58F91C    size 6 value [email protected] virtual_protect 1     //weapon icon X0A93: end_custom_thread

 

Link to comment
Share on other sites

  • 2 weeks later...

Hi. I want to unload blood splatter particle on CTRL + R and load on CTRL + E.

Its possible? If yes please make it for me smile.gif

Edited by Kozodoj
Link to comment
Share on other sites

skinnychicken98
Nice Example, EdUaRdO but basicly is a teleport more simple (and the ifs are wrong)

fades and render codes are just to make it nicer

 

016A: fade 0 time 1500// <=== fade effect

0001: wait 2000 ms

04E4: unknown_refresh_game_renderer_at X Y Z // <=== out here the exit coords

03CB: set_rendering_origin_at X Y Z // <=== out here the exit coords

00A1: put_actor $PLAYER_ACTOR at X Y Z // <=== out here the exit coords

0001: wait 2000 ms

016A: fade 1 time 1500

 

Teleport, Sphere (red marker), Location Check

 

Simple example,

red marker in Grovestreet teleports on to roof of CJ's house

 

{$CLEO .cs}:Teleport_103A4: name_thread 'TELE':Teleport_2wait 0 if 0256:   player $PLAYER_CHAR definedjf @Teleport_2 if 00FF:   actor $PLAYER_ACTOR sphere 1 in_sphere 2493.5 -1682.5 13.35 radius 1.0 1.0 1.0 on_foot jf @Teleport_2 00A1: put_actor $PLAYER_ACTOR at 2524.5  -1677.5  19.95jump @Teleport_2

 

 

The red marker (sphere) will be displayed by opcode 00FF:, 2. parameter: sphere 1 (sphere 0 don't show a red sphere)

Furthermore is it very important to have 0 ms wait time as maximum in the Loop

With more than 0 ms wait time it won't display a red sphere

Example:

 

:Teleport_2wait 10 now the sphere won't be shown

 

 

Also is it important to know that there are limits for spheres

Look in Sanny Builder Help: SCM Documentation: GTA Limits

 

There are several opcodes which show a sphere

 

Just to create a sphere

 

03BC: [email protected] = create_sphere_at 2493.5  -1682.5  13.35 radius 1.0 //eventual needs to remove the sphere at any time03BD: destroy_sphere [email protected]

 

Radarmarker with sphere

 

02A7: [email protected] = create_icon_marker_and_sphere 35 at 2493.5  -1682.5  13.35//as well as0570: [email protected] = create_asset_radar_marker_with_icon  35 at -2007.8 189.1 27.5//eventual needs to remove the marker at any time0164: disable_marker [email protected] 0164: disable_marker [email protected] 

 

Location checks for actor

 

00FE:   actor $PLAYER_ACTOR sphere 1 in_sphere 2493.5  -1682.5  13.35 radius 15.0 15.0 15.0 00FF:   actor $PLAYER_ACTOR sphere 1 in_sphere 2493.5  -1682.5  13.35 radius 1.0 1.0 2.0 on_foot 0100:   actor $PLAYER_ACTOR in_sphere 2493.5  -1682.5  13.35 radius 4.0 4.0 4.0 sphere 1 in_car 0101:   actor $PLAYER_ACTOR in_sphere 2493.5  -1682.5  13.35 radius 5.0 5.0 3.0 sphere 1 stopped 0102:   actor $PLAYER_ACTOR in_sphere 2493.5  -1682.5  13.35 radius 1.2 1.2 3.0 sphere 1 stopped_on_foot 0103:   actor $PLAYER_ACTOR in_sphere 2493.5  -1682.5  13.35 radius 4.0 4.0 6.0 sphere 1 stopped_in_car 0104:   actor $PLAYER_ACTOR near_actor [email protected] radius 15.0 15.0 15.0 sphere 1 0105:   actor $PLAYER_ACTOR near_actor [email protected] radius 5.0 5.0 2.0 sphere 1 on_foot 

 

Location checks for car

 

01AD:   car [email protected] sphere 1 near_point 2493.5  -1682.5 radius 6.0 6.0 01AE:   car [email protected] sphere 1 near_point 2493.5  -1682.5 radius 3.0 3.0 stopped 01AF:   car [email protected] sphere 1 in_sphere 2493.5  -1682.5 radius 0.2 0.2 1.0 01B0:   car [email protected] sphere 1 in_sphere 2493.5  -1682.5  13.35 radius 4.0 4.0 4.0 stopped 

 

 

The location checks with integrated sphereparameter are more useful in praxis but consider to have 0 ms wait time as maximum in the Loop

 

Now we can extend the simple script from above to have more teleports in the script by binding the location checks in a chain

4 teleports in Grovestreet:

 

{$CLEO .cs}:Teleport_103A4: name_thread 'TELE':Teleport_2wait 0 if 0256:   player $PLAYER_CHAR definedjf @Teleport_2 if 00FF:   actor $PLAYER_ACTOR sphere 1 in_sphere 2493.5 -1682.5 13.35 radius 1.0 1.0 1.0 on_foot jf @Teleport_3 00A1: put_actor $PLAYER_ACTOR at 2524.5  -1677.5  19.95jump @Teleport_2 :Teleport_3if 00FF:   actor $PLAYER_ACTOR sphere 1 in_sphere 2530.5 -1678.5 19.95 radius 1.0 1.0 1.0 on_foot jf @Teleport_4 00A1: put_actor $PLAYER_ACTOR at 2512.5  -1670.5  13.5jump @Teleport_2 :Teleport_4if 00FF:   actor $PLAYER_ACTOR sphere 1 in_sphere 2507.5 -1673.5 13.4 radius 1.0 1.0 1.0 on_foot jf @Teleport_5 00A1: put_actor $PLAYER_ACTOR at 2490.5  -1717.5  18.6jump @Teleport_2 :Teleport_5if 00FF:   actor $PLAYER_ACTOR sphere 1 in_sphere 2504.5 -1719.5 18.6 radius 1.0 1.0 1.0 on_foot jf @Teleport_2 00A1: put_actor $PLAYER_ACTOR at 2497.5  -1681.5  13.4jump @Teleport_2

 

hey iam making a toilet mod and when i want the red sphere to be next to the toilet i cant make it. i use sa place manger for the cordinates but when i paste the cordinates in the right place it says: "8 params are exepted"

so basicly i cant change the location of the red sphere help me please sad.gifpanic.gif

Link to comment
Share on other sites

hey iam making a toilet mod and when i want the red sphere to be next to the toilet i cant make it. i use sa place manger for the cordinates but when i paste the cordinates in the right place it says: "8 params are exepted"

so basicly i cant change the location of the red sphere help me please sad.gifpanic.gif

post your script instead quoting mine

Link to comment
Share on other sites

@ZAZ : ZAZ, i like your mods because it's stable, fun, and more importantly it's compatible with cleo 3 and cleo 4 colgate.gifcolgate.gif

so i'm wondering could you share your knowledge about how to make a cleo 3 mod become compatible with cleo 4?

 

i'm really sorry for my terrible english smile.gif

Edited by adoel488
Link to comment
Share on other sites

skinnychicken98

HELLO, can somebody show me how to change the positon of the red sphere thingy cause i changed the cordinates to the ones i pasted form san andreas place manager but it says : 8 params are exepted what should i do can some one help me?

Link to comment
Share on other sites

 

HELLO, can somebody show me how to change the positon of the red sphere thingy cause i changed the cordinates to the ones i pasted form san andreas place manager but it says : 8 params are exepted what should i do can some one help me?

Ok, again. POST YOUR SCRIPT!

 

 

 

 

 

@ZAZ : ZAZ, i like your mods because it's stable, fun, and more importantly it's compatible with cleo 3 and cleo 4  colgate.gif  colgate.gif

so i'm wondering could you share your knowledge about how to make a cleo 3 mod become compatible with cleo 4?

 

i'm really sorry for my terrible english  smile.gif

I never made one of my mods compatible with cleo4

My Car-Saloon mod don't work with cleo4

adoel488, this a big dilemma. Cleo4 was planed to work full for cleo3 scripts but it didn't.

To make the save feature of my Car-Saloon mod compatiple needs weired methods which is not acceptable for me.

My usage is, that cleo4 needs corrections.

 

I can only say: Use cleo4 only if you wanna run mods which requires cleo4. Otherwise keep cleo3

Edited by ZAZ
Link to comment
Share on other sites

hi Zaz can u teach me ow to make reverse lights for like in VC for gta sa plz

Use the effect files of Pimp my Car final or PROJECT FANTASIA and attach the effect "blinkred_nf"

to your car, similar i did in the policelight script, look vid:

read about effects >here<

Link to comment
Share on other sites

direstraits

please say how make a car generator fot GTA VC

 

like this

 

014B: [email protected] = init_parked_car_generator #STRETCH color -1 -1 1 alarm 100 door_lock 0 0 10000 at 2491.581 -1683.158 13.33706 angle 90.0

014C: set_parked_car_generator [email protected] cars_to_generate_to 101

 

i tried but it don't works can you help-me?

Link to comment
Share on other sites

 

please say how make a car generator fot GTA VC

 

like this

 

014B: [email protected] = init_parked_car_generator #STRETCH color -1 -1 1 alarm 100 door_lock 0 0 10000 at 2491.581 -1683.158 13.33706 angle 90.0

014C: set_parked_car_generator [email protected] cars_to_generate_to 101

 

i tried but it don't works can you help-me?

GTA VC? Vice City? and you wanna use coordinates of San Andreas-Grovestreet?

Try this:

 

{$CLEO}:Parked_Car03A4: name_thread 'PRKCAR'wait 1000014B: [email protected] = init_parked_car_generator #HOTRING -1 -1 1 alarm 0 door_lock 0 0 10000 at -881.6409 1334.6316 11.5 angle 12.0 014C: set_parked_car_generator [email protected] cars_to_generate_to 101014B: [email protected] = init_parked_car_generator #STRETCH color -1 -1 1 alarm 100 door_lock 0 0 10000 at -380.4976 -518.5238 12.8 angle 90.0014C: set_parked_car_generator [email protected] cars_to_generate_to 101 05DC: end_custom_thread

 

 

HOTRING in Downtown and STRETCH at Vercetti Estate

Link to comment
Share on other sites

 

did the same script works on GTA III ? (with GTA III cordinates)

yes, but HOTRING don't exist and it needs to edit the coords

this works:

 

{$CLEO}:Parked_Car03A4: name_thread 'PRKCAR'wait 1000014B: [email protected] = init_parked_car_generator #STRETCH color -1 -1 1 alarm 100 door_lock 0 0 10000 at 164.0822 -527.3588 26.5 angle 12.0014C: set_parked_car_generator [email protected] cars_to_generate_to 10105DC: end_custom_thread

 

Edited by ZAZ
Link to comment
Share on other sites

05DC does exist, you just don't have the newest opcode.txt tounge.gif

004E will screw up the game.

Link to comment
Share on other sites

 

05DC does exist, you just don't have the newest opcode.txt tounge.gif

004E will screw up the game.

right, i didn't had cleo installed, thx for the bollocking

Edited by ZAZ
Link to comment
Share on other sites

  • 4 weeks later...

So if I stored the Player's health to a local variable ([email protected]) and then transferred it to an integer (via opcode 0085), how would I update that integer in real time to match the player's health?

Link to comment
Share on other sites

 

So if I stored the Player's health to a local variable ([email protected]) and then transferred it to an integer (via opcode 0085), how would I update that integer in real time to match the player's health?

 

yes opcode 0085: to make a copy of the healthvalue

 

0226: [email protected] = actor $PLAYER_ACTOR health0085: [email protected] = [email protected] // (int)if3 > [email protected] @HEAL005A: [email protected] += [email protected] // (int)0223: set_actor $PLAYER_ACTOR health_to [email protected]

 

you can can do with the copy what you want, for example convert int to float, make any calculations and maybe any check,

then convert float to int

and use opcode 005A: to add another variable value to the original health value

 

0226: [email protected] = actor $PLAYER_ACTOR health0085: [email protected] = [email protected] // (int)0093: [email protected] = integer [email protected] [email protected] *= [email protected] /= 20.0if8184: not  actor $PLAYER_ACTOR health >= 3jf @HEAL0092: [email protected] = float [email protected] to_integer005A: [email protected] += [email protected] // (int)0223: set_actor $PLAYER_ACTOR health_to [email protected]

 

 

the opcodes must be written for these two mathfunctions!!!

 

0085: [email protected] = [email protected] // (int)005A: [email protected] += [email protected] // (int)

 

 

 

HEALTH CODES

 

increase Healthbar to maximum062A: change_float_stat 24 to 1440.0

 

 

double the Healthindikator, max 200055E: set_player $PLAYER_CHAR max_health += 100

 

 

reduce first amour then health0851: set_actor $PLAYER_ACTOR decrease_health_by 10 flag 1

 

 

get actor health0226: [email protected] = actor $PLAYER_ACTOR health

 

 

set actor health0223: set_actor $PLAYER_ACTOR health_to 100

 

Edited by ZAZ
Link to comment
Share on other sites

Awesome thanks. And what if I wanted to make another healthbar for the player? I never understood how to make bars that can increase and decrease like Sweet's health on the mission Sweet's Girl.

Link to comment
Share on other sites

 

Awesome thanks. And what if I wanted to make another healthbar for the player? I never understood how to make bars that can increase and decrease like Sweet's health on the mission Sweet's Girl.

They used in the storymissions the StatusText or StatusBar opcode

But these codes are working only with global variables

 

Look first to the script below

it shows a healthbar with draw_texture opcode

 

{$CLEO .cs}:TXD_Bar_103A4: name_thread 'STSB':TXD_Bar_4wait 0if0256:   player $PLAYER_CHAR definedjf @TXD_Bar_40390: load_txd_dictionary 'LD_DUAL' 038F: request_texture "Health" as  1  // Load dictionary with 0390 first038F: request_texture "black" as  2  // Load dictionary with 0390 firstwait 500:TXD_Bar_16wait 0if0256:   player $PLAYER_CHAR definedjf @TXD_Bar_320226: [email protected] = actor $PLAYER_ACTOR health0093: [email protected] = integer [email protected] to_float0087: [email protected] = [email protected]  // floating-point values only0013: [email protected] *=  1.5  // floating-point values0013: [email protected] *=  0.8  // floating-point values0007: [email protected] =  450.0  // floating-point values0063: [email protected] -= [email protected]  // floating-point values03F0: text_draw_toggle  1038D: draw_texture 2 position 300.0  21.0 size 304.0  14.0 RGBA 180  180  180  255 038D: draw_texture 1 position [email protected]  20.0 size [email protected]  10.0 RGBA 180  180  180  255 jump @TXD_Bar_16:TXD_Bar_3203F0: toggle_text_draw 0jump @TXD_Bar_4

 

 

and there is an opcode to display a box, but it works unstable for me (used in minigames like Duality)

i assume it needs first to fade the screen black

 

038E: draw_box_position [email protected]  21.0 size [email protected]  14.0 RGBA 150  0  0  255

 

 

 

StatusText or StatusBar opcode

these codes are working only with global variables which can cause bugs

At first the StatusText opcode which displays only a value as numbers

It displays not the time but it displays automaticly the value of the global variable

 

{$CLEO .cs}:Status_1thread 'STATUS'0004: $time2 =  1000  // integer values03C4: set_status_text $time2 type 0 GXT 'fem_ok' // global_variable  // Score ~1~:Status_2wait 0$time2 -= 1if$time2 == 0jf @Status_20151: remove_status_text $time200BA: show_text_styled GXT 'fem_off' time 1000 style 10A93: end_custom_thread

 

type 0 shows the value as numbers

type 1 shows the value as an bar

 

also there exist other opcodes to displays more StatusTexts or StatusBars

in more rows among each other

 

for the statusBar you must consider that a full bar have allways the value 100

and to show the correct bar needs to calculate the value relativ to 100

in other words: the bar shows percents

 

{$CLEO .cs}:Status2_1thread 'STATUS2'0004: $time1 =  100  // integer values0004: $time2 =  1000  // integer values04F7: status_text $time1 type 1 line 1 GXT 'fem_ok' // global_variable  // Score04F7: status_text $time2 type 0 line 2 GXT 'fem_on' // global_variable  // Score:Status2_2wait 0$time2 -= 10084: $time1 = $time2$time1 /= 10if$time2 == 0jf @Status2_20151: remove_status_text $time10151: remove_status_text $time200BA: show_text_styled GXT 'fem_off' time 1000 style 10A93: end_custom_thread

 

Edited by ZAZ
Link to comment
Share on other sites

these codes are working only with global variables which can cause bugs

Actually it's possible and quite easy to make it work with local variables, using CLEO.

All I can provide is

 

http://www.gta-mods.pl/artykuly/48/liczniki-timery

 

Solution how to do a status text using locals is in "Dla zaawansowanych" ("For advanced users") section.

 

Note that I didn't found it by myself (except status text flashing func), Seemann did it instead and posted it on Sannybuilder forums. This site is still 'in weird language' for most of the users, but SCM functions names are in English and pretty clear, covering real opcode names.

 

Note 2 that my codes are CLEO3 compatible.

 

Note 3 that you can download an example code here:

 

http://www.gta-mods.pl/pliki/497/pasek-stanu-przyklad-w-cleo

 

Both in CLEO3 & CLEO4 and CLEO4-only versions. Click on "Pobierz" to download.

 

 

Sorries, ZAZ tounge.gif

Link to comment
Share on other sites

 

these codes are working only with global variables which can cause bugs

Actually it's possible and quite easy to make it work with local variables, using CLEO.

All I can provide is

 

http://www.gta-mods.pl/artykuly/48/liczniki-timery

 

Solution how to do a status text using locals is in "Dla zaawansowanych" ("For advanced users") section.

 

Note that I didn't found it by myself (except status text flashing func), Seemann did it instead and posted it on Sannybuilder forums. This site is still 'in weird language' for most of the users, but SCM functions names are in English and pretty clear, covering real opcode names.

 

Note 2 that my codes are CLEO3 compatible.

 

Note 3 that you can download an example code here:

 

http://www.gta-mods.pl/pliki/497/pasek-stanu-przyklad-w-cleo

 

Both in CLEO3 & CLEO4 and CLEO4-only versions. Click on "Pobierz" to download.

 

 

Sorries, ZAZ tounge.gif

nice addon, SilentPL, i 'll test the templats by time

Link to comment
Share on other sites

Are there any ways to size and scale that bar? I wanted to reposition, color, and size the status text bar. Is there any way to do that?

Link to comment
Share on other sites

 

Are there any ways to size and scale that bar? I wanted to reposition, color, and size the status text bar. Is there any way to do that?

which method do you mean?

With draw_texture opcodes can you make any size and position you like

It's a hard work to find the multiplicator for size and position calculations of a de/increasing bar

Link to comment
Share on other sites

Well I tried making my own custom healthbar with textures I made in PS, but when I added the bars to read the player's health, the texture was white and just flickered really badly. Not sure what went wrong, but yeah.

 

So I just was asking if there was a way to scale and size the status text bar. Like reposition it and scale it up in size a bit.

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.