Jump to content

[SA] ~ CLEO Script Tutorial ~


ZAZ

Recommended Posts

 

{$CLEO}0000: NOP4@ = 32.0 0AC7: 5@ = var 4@ offset5@ *= 0x90900A8C: write_memory 0x58F91C    size 6 value 5@ 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 4@ float this effect is the same.

 

 

{$CLEO}0000: NOP4@ = 32.00AC7: 5@ = var 4@ offset5@ *= 0x90900A8C: write_memory 0x58F91C    size 6 value 5@ virtual_protect 1     //weapon icon X0A93: end_custom_thread

 

 

4@ replace to...

 

 

{$CLEO}0000: NOP4@ = 9999.00AC7: 5@ = var 4@ offset5@ *= 0x90900A8C: write_memory 0x58F91C    size 6 value 5@ 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: 1@ = create_sphere_at 2493.5  -1682.5  13.35 radius 1.0 //eventual needs to remove the sphere at any time03BD: destroy_sphere 1@

 

Radarmarker with sphere

 

02A7: 0@ = create_icon_marker_and_sphere 35 at 2493.5  -1682.5  13.35//as well as0570: 1@ = 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 0@ 0164: disable_marker 1@ 

 

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 1@ radius 15.0 15.0 15.0 sphere 1 0105:   actor $PLAYER_ACTOR near_actor 1@ radius 5.0 5.0 2.0 sphere 1 on_foot 

 

Location checks for car

 

01AD:   car 1@ sphere 1 near_point 2493.5  -1682.5 radius 6.0 6.0 01AE:   car 1@ sphere 1 near_point 2493.5  -1682.5 radius 3.0 3.0 stopped 01AF:   car 1@ sphere 1 in_sphere 2493.5  -1682.5 radius 0.2 0.2 1.0 01B0:   car 1@ 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: 1@ = 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 1@ 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: 1@ = 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 1@ 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: 0@ = 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 0@ cars_to_generate_to 101014B: 1@ = 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 1@ cars_to_generate_to 101 05DC: end_custom_thread

 

 

HOTRING in Downtown and STRETCH at Vercetti Estate

Link to comment
Share on other sites

thanks i have a cordinter for gta vc

sannybuilder have an integrated coords-tool, works with san andreas as well with vice city

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: 1@ = 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 1@ 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...

 

Did you add my armour example? Thx

yes, look for last edit date

Link to comment
Share on other sites

So if I stored the Player's health to a local variable (0@) 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 (0@) 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: 1@ = actor $PLAYER_ACTOR health0085: 3@ = 1@ // (int)if3 > 3@jf @HEAL005A: 1@ += 3@ // (int)0223: set_actor $PLAYER_ACTOR health_to 1@

 

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: 1@ = actor $PLAYER_ACTOR health0085: 3@ = 1@ // (int)0093: 3@ = integer 3@ to_float3@ *= 30.03@ /= 20.0if8184: not  actor $PLAYER_ACTOR health >= 3jf @HEAL0092: 3@ = float 3@ to_integer005A: 1@ += 3@ // (int)0223: set_actor $PLAYER_ACTOR health_to 1@

 

 

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

 

0085: 3@ = 1@ // (int)005A: 1@ += 3@ // (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: 1@ = 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: 11@ = actor $PLAYER_ACTOR health0093: 11@ = integer 11@ to_float0087: 12@ = 11@  // floating-point values only0013: 12@ *=  1.5  // floating-point values0013: 11@ *=  0.8  // floating-point values0007: 13@ =  450.0  // floating-point values0063: 13@ -= 11@  // 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 13@  20.0 size 12@  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 13@  21.0 size 12@  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
  • 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.