Jump to content

[SA] ~ CLEO Script Tutorial ~


ZAZ

Recommended Posts

 

 

 

 

This Post Have Been Sloved For personal reasons

 

Edited by SA-Modding
G1T
Link to comment
Share on other sites

ZAZ I Knew

Then tell me how to use opcode 0AB3: and 0AB4:

Link to comment
Share on other sites

 

ZAZ I Knew

Then tell me how to use opcode 0AB3: and 0AB4:

loool lol.gif ok zaz do not worry no problem and goodbye

Edited by SA-Modding
G1T
Link to comment
Share on other sites

lol.giflol.giflol.gif I Fix The Problem And I found it very funny Just To Compile it To Cleo Mission Loool , Sorry Zaz And Goodbye inlove.gif

 

G1T
Link to comment
Share on other sites

You still doing it, Ahmed.

Link to comment
Share on other sites

/!\ErManu/!\

 

Hello Zaz!!

 

I can use the codes of this tuturials as reference for my mods?

 

Thanks!!,good work!! wink.gif

Link to comment
Share on other sites

 

Hello Zaz!!

 

I can use the codes of this tuturials as reference for my mods?

 

Thanks!!,good work!! wink.gif

Please add the info that you got it from the tutorial and add the link to tutorial:

http://www.gtaforums.com/index.php?showtopic=403594

 

if you wanna use the CARSTORE script then add the info that it is from me and add this link:

 

http://www.gtaforums.com/index.php?showtopic=403594&st=0#Global

 

 

Link to comment
Share on other sites

/!\ErManu/!\
Hello Zaz!!

 

I can use the codes of this tuturials as reference for my mods?

 

Thanks!!,good work!! wink.gif

Please add the info that you got it from the tutorial and add the link to tutorial:

http://www.gtaforums.com/index.php?showtopic=403594

 

if you wanna use the CARSTORE script then add the info that it is from me and add this link:

 

http://www.gtaforums.com/index.php?showtopic=403594&st=0#Global

 

Very thanks you!!,and of course cool.gificon14.gif

 

If I release a mod put this information and your name in my credits cookie.gif

 

I'm working on a new mods for GTA SA,for more interiors and real things,is a little project,I have a new interiors and details,new interiors of a passengers plane,mmm...new shops,and garages smile.gif made by me biggrin.gif

 

But made a Cleo code is very dificult for me and a veryyy lost of time.... nervous.gif I made a simple Cleo codes but Cleo codes more bigs... suicidal.gif

 

Thanks ZAZ!!

Link to comment
Share on other sites

  • 1 month later...
  • 4 weeks later...

Hi, i wanted to ask, how to make game detect whenever player car crashes into wall, other car or etc ?

Link to comment
Share on other sites

  • 2 weeks later...
Saint Burak

 

Hi, i wanted to ask, how to make game detect whenever player car crashes into wall, other car or etc ?

0119: car $greenwood wrecked

 

by the way how to start 2 threads and make them work at the same time in a cleo file? I've tried create_thread but game crashes.

Edited by Saint Burak
Link to comment
Share on other sites

 

by the way how to start 2 threads and make them work at the same time in a cleo file? I've tried create_thread but game crashes.

use create thread with parameter

it can have up to 32 parameters

 

0A92: create_custom_thread "MultiThread.cs" 1

 

The script must have the same like in the create_custom_thread entry

the values of parameters after the script name will be send the the script of the create_custom_thread entry

in this case the same script

it recives the values by following rule:

0@ will not be 0 by default but it gets the value of first param of 0A92: create_custom_thread "MultiThread.cs" 1

now do a check for 0@ at scriptbeginn to select in different scriptparts

study the script below

name the script MultiThread.cs

 

{$CLEO .cs}:MultiThread//-- 0@ = 0 by defaultif0@ == 0jf @MultiThread_2003A4: name_thread 'MULTHRD'  :MultiThread_10wait 003F0: enable_text_draw 1  045A: draw_text_1number 200.0 40.0 GXT 'NUMBER' number 0@  // ~1~  if 0AB0:   key_pressed 8//---------------------- Backspace 004D: jump_if_false @MultiThread_10 0A92: create_custom_thread "MultiThread.cs" 1 2 3 4 //The started(second)thread assignes now the first param of 0A92: to 0@, the second param to 1@ and so on// the second thread beginns also with//:MultiThread//-- but 0@ = 1 because of the  first param of 0A92://if//0@ == 0//jf @MultiThread_20:MultiThread_11wait 003F0: enable_text_draw 1  045A: draw_text_1number 200.0 40.0 GXT 'NUMBER' number 0@  // ~1~  jump @MultiThread_11 /////////////////////////////////////////////////////////////// second thread:MultiThread_20if0@ == 1jf @MultiThread_5003A4: name_thread 'SECONDT':MultiThread_21wait 003F0: enable_text_draw 1  045A: draw_text_1number 200.0 60.0 GXT 'NUMBER' number 0@  // ~1~ 045A: draw_text_1number 240.0 60.0 GXT 'NUMBER' number 1@  // ~1~ 045A: draw_text_1number 260.0 60.0 GXT 'NUMBER' number 2@  // ~1~ 045A: draw_text_1number 280.0 60.0 GXT 'NUMBER' number 3@  // ~1~ jump @MultiThread_21:MultiThread_500A93: end_custom_thread

 

 

 

the mod below creates for each rocket it's own thread inside the same script

 

 

Edited by ZAZ
Link to comment
Share on other sites

ItsAllAboutGTA
I have a question,I trying to make IV style weapon camera but,in tut index there's no tut on how to change/add camera angle
Link to comment
Share on other sites

 

I have a question,I trying to make IV style weapon camera but,in tut index there's no tut on how to change/add camera angle

There are a lot of different codes and methods for camera viewing

The tutorial should teach how to write cleo scripts in praxis

You should study the lessons and make experience with scripting and learn to find codes by yourself before you realize your plan

 

weapon aim view is hardcoded and it's difficult to simulate it with scripting

 

Example scripts depending to camera view:

main.scm

Dutchy3010's Cutscene tut

FreeMovingCamera cleoscript

First Person Camera

 

Link to comment
Share on other sites

Michael-Knight1

ZAZ I Need Help By You !

I Finish Making All Knight Rider Characters For San Andreas .

I Add Them on GTA3.Img Then I Make A Simple Script To Spawn Them But The Problem When I Start The Game , This Peds Will Fight Me ! I Need Any Help .

 

MAIN.SCM

 

 

:KR_CHARACTERSthread 'KR_CHARACTERS' :KR_CHARACTERS_19wait 0 if   Player.Defined($PLAYER_CHAR)jf @KR_CHARACTERS_19 if  $ONMISSION == 0 jf @KR_CHARACTERS_19 023C: load_special_actor 'DEVON' as 1 // models 290-299 023C: load_special_actor 'APRIL' as 2 // models 290-299 023C: load_special_actor 'BONNIE' as 3 // models 290-299 :KR_CHARACTERS_96wait 0 if or823D:   not special_actor 1 loaded 823D:   not special_actor 2 loaded 823D:   not special_actor 3 loaded jf @KR_CHARACTERS_169 023C: load_special_actor 'DEVON' as 1 // models 290-299 023C: load_special_actor 'APRIL' as 2 // models 290-299 023C: load_special_actor 'BONNIE' as 3 // models 290-299 jump @KR_CHARACTERS_96 :KR_CHARACTERS_169$DEVON = Actor.Create(290, #SPECIAL01, 1136.713, -2037.447, 70.5234)$APRIL = Actor.Create(291, #SPECIAL02, 1143.179, -2034.245, 70.5234)$BONNIE = Actor.Create(292, #SPECIAL03, 1139.073, -2039.869, 70.5234)Actor.Angle($DEVON) = 268.1029Actor.Angle($APRIL) = 356.0249Actor.Angle($BONNIE) = 0.210406B0: AS_actor $DEVON sit_down 1E12 ms 06B0: AS_actor $APRIL sit_down 1E12 ms 06B0: AS_actor $BONNIE sit_down 1E11 ms Actor.SetImmunities($DEVON, 1, 1, 1, 1, 1)Actor.SetImmunities($APRIL, 1, 1, 1, 1, 1)Actor.SetImmunities($BONNIE, 1, 1, 1, 1, 1)0296: unload_special_actor 1 0296: unload_special_actor 2 0296: unload_special_actor 3 end_thread 

 

Link to comment
Share on other sites

Use a valid pedtype, look in sannybuilder Help

 

$DEVON = Actor.Create(290, #SPECIAL01, 1136.713, -2037.447, 70.5234)

 

 

actorhandle = Actor.Create(PEDTYPE, SPECIAL_ACTOR-ID, X, Y, Z)

 

 

290 isn't a valid pedtype number

 

290 would be a valid SPECIAL_ACTOR-ID

290 would be the same like #SPECIAL01

 

read "Load a special actor"

 

 

Link to comment
Share on other sites

Michael-Knight1

Yes , Thanks You Zaz .

Edited by Michael-Knight1
Link to comment
Share on other sites

hi ZAZ.. i going to make player get drunk vision when hitting wall using a motorcycle..

but i dont know what opcodes should i use please halp me

Link to comment
Share on other sites

 

hi ZAZ.. i going to make player get drunk vision when hitting wall using a motorcycle..

but i dont know what opcodes should i use please halp me

 

052C: set_player $PLAYER_CHAR drunk_visuals 255

 

Link to comment
Share on other sites

thanks.. but i need opcodes 'when player hit somethings'..

glad if you understand what i mean

Link to comment
Share on other sites

 

thanks.. but i need opcodes 'when player hit somethings'..

glad if you understand what i mean

there don't exist such opcodes

there exist just opcodes to check collision with defined actors, vehicles, objects

Link to comment
Share on other sites

Michael-Knight1

Zaz I Need You To Help Me into My KITT Call Script .

I Try To Make KITT Drive To Player When I Press The Key .

But I Wanna While KITT Be Far of Player , he will destroy and create behind player ! how ??

 

 

:CALLKITTthread 'CALLKITT' 054C: use_GXT_table 'KRBTS' :CALLKITT_19wait 0 if   Player.Defined($PLAYER_CHAR)jf @CALLKITT_19 if 0AB0:   key_pressed 77 jf @CALLKITT_19 033F: set_text_draw_letter_size 0.5 2.0 0342: enable_text_draw_centered 1 0340: set_text_draw_RGBA 250 250 250 235 033E: set_draw_text_position 330.0 05.0 GXT 'KITCAL2' 0001: wait 1000 ms 03F0: enable_text_draw 0 04C4: store_coords_to $CALL_XYZ1 $CALL_XYZ2 $CALL_XYZ3 from_actor $PLAYER_ACTOR with_offset $CALL_XYZ1 $CALL_XYZ2 0.0 02C1: store_to $CALL_XYZ1 $CALL_XYZ2 $CALL_XYZ3 car_path_coords_closest_to $CALL_XYZ1 $CALL_XYZ2 $CALL_XYZ3 $CALL1 = Marker.CreateAboveCar($KITT)07E0: set_marker $CALL1 type_to 1 Marker.SetColor($CALL1, 0)0001: wait 0 ms033F: set_text_draw_letter_size 0.5 2.0 0342: enable_text_draw_centered 1 0340: set_text_draw_RGBA 250 250 250 235 033E: set_draw_text_position 330.0 05.0 GXT 'KITCALL1' :CALLKITT_121wait 0 if and $ACTIVE_INTERIOR == 0   not Player.Wasted($PLAYER_CHAR)  not Car.Wrecked($KITT)8741:   not actor $PLAYER_ACTOR busted jf @CALLKITT_340 04C4: store_coords_to $CALL_XYZ4 $CALL_XYZ5 $CALL_XYZ6 from_actor $PLAYER_ACTOR with_offset 0.0 0.0 0.0 0407: store_coords_to $CALL_XYZ7 $CALL_XYZ8 $CALL_XYZ9 from_car $KITT with_offset 0.0 0.0 0.0 050A: $CALLKITT_XYZ = distance_between_XYZ $CALL_XYZ4 $CALL_XYZ5 $CALL_XYZ6 and_XYZ $CALL_XYZ7 $CALL_XYZ8 $CALL_XYZ9 if  $CALLKITT_XYZ >= 26.0 jf @CALLKITT_277 $CALLKITT_XYZ = 25.0 jf @CALLKITT_121 :CALLKITT_277Car.SetMaxSpeed($KITT, $CALLKITT_XYZ)Car.DriveTo($KITT, $CALL_XYZ4, $CALL_XYZ5, $CALL_XYZ6)if and01C1:   car $KITT stopped 0205:   actor $PLAYER_ACTOR near_car $KITT radius 10.0 10.0 5.0 flag 0 jf @CALLKITT_121 :CALLKITT_340Car.RemoveReferences($KITT)Marker.Disable($CALL1)03F0: enable_text_draw 0 0001: wait 0 msjump @CALLKITT_19 end_thread

 

 

 

Link to comment
Share on other sites

 

But I Wanna While KITT Be Far of Player , he will destroy and create behind player ! how ??

and what if there is a building behind player?

i recommand to find and replace a random car in traffic

study this: click

BTW. this is a cleo tut, not main.scm

in addition can you use in main.scm a stuck car check

Link to comment
Share on other sites

Michael-Knight1

 

But I Wanna While KITT Be Far of Player , he will destroy and create behind player ! how ??

and what if there is a building behind player?

i recommand to find and replace a random car in traffic

study this: click

BTW. this is a cleo tut, not main.scm

in addition can you use in main.scm a stuck car check

so no need to create the car behind player but i'll use coordinate :

 

 

04C4: store_coords_to $CALL2_XYZ1 $CALL2_XYZ2 $CALL2_XYZ3 from_actor $PLAYER_ACTOR with_offset 30.0 0.0 5.0 02C1: store_to $CALL3_XYZ1 $CALL3_XYZ2 $CALL3_XYZ3 car_path_coords_closest_to $CALL2_XYZ1 $CALL2_XYZ2 $CALL2_XYZ3 

 

 

so just i want to knew where i put the codes.

When The Car Be Not Far , kitt will drive to player .

And When The Car Be far KITT Will Destroy Then Create at thoes coordinate and drive to player .

But I Just Create Car Drive to player while not far .

 

so if you can modify it just with car far codes .

Link to comment
Share on other sites

:beginnif keypressedspawn car:loopwait 0if0202:   actor $PLAYER_ACTOR near_car 1@ radius  200.0  200.0 unknown  0jf @cleanupdrive car to playerjump @loop:cleanupremove reference to carjump @beginn

 

Link to comment
Share on other sites

Michael-Knight1
:beginnif keypressedspawn car:loopwait 0if0202:   actor $PLAYER_ACTOR near_car 1@ radius  200.0  200.0 unknown  0jf @cleanupdrive car to playerjump @loop:cleanupremove reference to carjump @beginn

 

Thanks You My Friend !

I Design This Logo For You , you can to use it in your mods video biggrin.gif .lol...

I hope you like it

 

Link to comment
Share on other sites

hi ZAZ.. can i ask how to make a new opcodes in sanny builder (opcodes.txt)??

Load the decompiled original main into sannybuilder then choose TOOLS on sanny menue, then: make opcodes.txt

but cleo opcode are missing

Link to comment
Share on other sites

stevendabuffman

Hi Zaz, I'm impressed on how you're helping everyone biggrin.gif lol

I have CLEO 4 and would like to know how to assign a certain music track when every they spawn that would loop, I'm making some missions and it's for a fight.

Any help would be appreciated smile.gif

 

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