Quantcast

Jump to content

» «
Photo

[SA] ~ CLEO Script Tutorial ~

931 replies to this topic
ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union
  • Contribution Award [Mods]
    Helpfulness Awards [Mods]

#901

Posted 26 March 2017 - 12:40 PM

I Got a question: How to do I Coding of a CLEO Mission for Liberty City Stories PC edition (GTA San Andreas Mods) by using a Sanny Builder through?

in same way as described here
Because it's a total convertion, make shure that the main.scm contain this code
0180: set_on_mission_flag_to $ONMISSION
and take care by using objects, because the map system has changed, object id's can now be different

Hayate Kankichi
  • Hayate Kankichi

    Player Hater

  • Members
  • Joined: 31 Jul 2015
  • India

#902

Posted 07 April 2017 - 02:47 AM

Hey guys, I want to make another script. but Don't know professonal. so I need help in making object attach to Player. like War Machine have Minigun on it's shoulder, so please tell me how I can mount any object or model to player?


ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union
  • Contribution Award [Mods]
    Helpfulness Awards [Mods]

#903

Posted 08 April 2017 - 12:11 PM

Hey guys, I want to make another script. but Don't know professonal. so I need help in making object attach to Player. like War Machine have Minigun on it's shoulder, so please tell me how I can mount any object or model to player?

First method: opcode 069B: attach object with offset to actor model center like parachute is done
object keeps position, while actor makes animation
0247: load_model #PARACHUTE 

:PLCHUTE_274 
00D6: if 
0248:   model #PARACHUTE available 
004D: jump_if_false @PLCHUTE_377 
0107: [email protected] = create_object #PARACHUTE at $TEMPVAR_X_COORD $TEMPVAR_Y_COORD $TEMPVAR_Z_COORD 
069B: attach_object [email protected] to_actor $PLAYER_ACTOR with_offset 0.0 0.0 0.0 rotation 0.0 0.0 0.0 
0750: set_object [email protected] visibility 0

Second method: opcode 070A: attach object to bone, like smoking cigar
 
070A: AS_actor $PLAYER_ACTOR attach_to_object [email protected] offset 0.0 0.0 -0.5 on_bone 6 1 perform_animation "NULL" IFP_file "NULL" time 999999
If 2 objects should be attached, then use 070A: for first object and 09A0: for second object
 
070A: AS_actor $PLAYER_ACTOR attach_to_object [email protected] offset 0.0 0.0 -0.5 on_bone 6 1 perform_animation "NULL" IFP_file "NULL" time 999999
09A0: actor $PLAYER_ACTOR attach_object [email protected] with_offset 0.0 0.0 -0.5 on_bone 5 1 perform_animation "NULL" IFP_file "NULL" time 999999

Bones ID list

Crashes the Game = 0
Chest = 1
Neck = 2
Left Shoulder = 3
Right Shoulder = 4
Left Hand = 5
Right Hand = 6
Root = 7
- = 8
Left Foot = 9
Right Foot = 10
Right Knee = 11
- = 12
Left Elbow = 13
Right Elbow = 14
Left Clavicle = 15
Right Clavicle = 16
Back of Neck = 17
Mouth or Chin = 18
Crashes the Game = 19

deltaCJ
  • deltaCJ

    BUSTED!

  • Members
  • Joined: 27 Dec 2013
  • None

#904

Posted 13 April 2017 - 03:34 AM Edited by deltaCJ, 13 April 2017 - 03:36 AM.

How can I play music during a mission?

 

I want to make it play during a car chase.

 

EDIT: Also, how would I make a cutscene where the car flips over and explodes?


BiPolarBear
  • BiPolarBear

    Moody

  • Members
  • Joined: 13 Jan 2013
  • Unknown

#905

Posted 22 May 2017 - 07:18 AM Edited by BiPolarBear, 22 May 2017 - 07:19 AM.

ZAZ, Please can you could help me out :) ?
I am on the verge to finish my mod but i  am facing 2 big problems :-/
1-Actor [email protected] is NOT performing his animations (DEALER_DEAL)
2-How do i disable what usually happens if i press Y? How do i make cj NOT tell the dealer to go away if i press y, and make my mod instead to take place?
:SMOKE_1
0001: wait 0 ms 
00D6: if 
0256:   player $PLAYER_CHAR defined 
004D: jump_if_false @SMOKE_1 
0001: wait 0 ms 
00D6: if 
80DF:   not actor $PLAYER_ACTOR driving 
004D: jump_if_false @SMOKE_1 
0001: wait 0 ms  
00D6: if 
03EE:   player $PLAYER_CHAR controllable 
004D: jump_if_false @SMOKE_1 
0AB5: store_actor $PLAYER_ACTOR closest_vehicle_to [email protected] closest_ped_to [email protected] 
0001: wait 0 ms 
00D6: if 
8039:   not  [email protected] == -1 
004D: jump_if_false @SMOKE_1 
00D6: if or
02F2:   actor [email protected] model == #BMYDRUG 
02F2:   actor [email protected] model == #WMYDRUG 
02F2:   actor [email protected] model == #HMYDRUG 
02F2:   actor [email protected] model == #BIKDRUG 
004D: jump_if_false @SMOKE_1
0001: wait 0 ms
00D6: if
00F2:   actor [email protected] near_actor $PLAYER_ACTOR radius 1.5 1.5 sphere 0
004D: jump_if_false @SMOKE_1
0001: wait 0 ms 
00D6: if 
0AB0:   key_pressed 69 
004D: jump_if_false @SMOKE_1
0002: jump @SMOKE_2 

:SMOKE_2
04ED: load_animation "GANGS"
04ED: load_animation "DEALER" 
04ED: load_animation  "SMOKING"
0247: load_model 1212
038B: load_requested_models
0001: wait 0 ms 
00D6: if 
04EE:   animation "GANGS" loaded 
004D: jump_if_false @SMOKE_2
0001: wait 0 ms 
00D6: if 
04EE:   animation "DEALER" loaded 
004D: jump_if_false @SMOKE_2 
067E: put_camera_on_actor $PLAYER_ACTOR offset 0.5 -1.0 1.1 target_actor [email protected] tilt 0.0 switchstyle 2
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 0
03BF: set_player $PLAYER_CHAR ignored_by_everyone 1
029B: [email protected] = init_object 1212 at 0.0 0.0 0.0
0382: set_object [email protected] collision_detection 0 
05C1: AS_actor $PLAYER_ACTOR speak_from_audio_table 194 
0812: AS_actor $PLAYER_ACTOR perform_animation "SHOP_PAY" IFP "DEALER" framedelta 4.0 loopA 1 lockX 0 lockY 0 lockF 0 time 4500
0001: wait 500 ms
070A: AS_actor $PLAYER_ACTOR attach_to_object [email protected] offset 0.03 0.030 0.02 on_bone 6 16 perform_animation "NULL" IFP_file "NULL" time 0
0001: wait 4000 ms
0108: destroy_object [email protected] 
0249: release_model 1212
0647: AS_actor [email protected] clear_look_task
0109: player $PLAYER_CHAR money = -20
05C1: AS_actor [email protected] speak_from_audio_table 84 
0812: AS_actor [email protected] perform_animation "DEALER_DEAL" IFP "DEALER" framedelta 4.0 loopA 0 lockX 0 lockY 0 lockF 0 time 3200
0812: AS_actor $PLAYER_ACTOR perform_animation "DRUGS_BUY" IFP "DEALER" framedelta 4.0 loopA 0 lockX 0 lockY 0 lockF 0 time 3200
0001: wait 3200 ms
0687: clear_actor [email protected] task
02EB: restore_camera_with_jumpcut

ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union
  • Contribution Award [Mods]
    Helpfulness Awards [Mods]

#906

Posted 23 May 2017 - 02:48 AM

your script is uncomplete


skatefilter5
  • skatefilter5

    Controlling Both Players

  • Members
  • Joined: 30 Apr 2016
  • Canada

#907

Posted 12 June 2017 - 09:52 PM

I was testing to make a ped route to follow the path by walking into the short-cut but he skips the first route, I can't find loop to route or walk to the next route.

 

So I have this test script

{$CLEO .cs}

Model.Load(#swmotr2)

:TEST
wait 0
if and
   Player.Defined($PLAYER_CHAR)
0ADC:   test_cheat "walk"

jf @TEST
00A1: put_actor $PLAYER_ACTOR at -2655.6997 163.9048 4.3281
[email protected] = Actor.Create(Gang1, #swmotr2, -2662.04, 164.9193, 4.3281)
Actor.Angle($PLAYER_ACTOR) = 82.9693
Actor.Angle([email protected]) = 82.9693
060F: set_actor [email protected] melee_accuracy_to 100.0
0817: assign_actor [email protected] to_animation_path_with_walk_mode 3 route_mode 2 //Run Mode

07CD: AS_actor [email protected] walk_to -2697.2449 165.4548 4.3281 stop_with_angle 90.9 within_radius 1.0
wait 5000
07CD: AS_actor [email protected] walk_to -2698.2651 197.7581 4.3281 stop_with_angle 359.6 within_radius 1.0




end_thread
 


deltaCJ
  • deltaCJ

    BUSTED!

  • Members
  • Joined: 27 Dec 2013
  • None

#908

Posted 13 June 2017 - 12:23 AM

use AS_pack 


Steak1337
  • Steak1337

    Player Hater

  • Members
  • Joined: 14 Jun 2017
  • None

#909

Posted 14 June 2017 - 09:42 AM

Hey, i want to make a mod like when i write something like /myname, to show in chat my name without writing my ID


deltaCJ
  • deltaCJ

    BUSTED!

  • Members
  • Joined: 27 Dec 2013
  • None

#910

Posted 14 June 2017 - 12:26 PM

Hey, i want to make a mod like when i write something like /myname, to show in chat my name without writing my ID

 

For SAMP is my guess?


Steak1337
  • Steak1337

    Player Hater

  • Members
  • Joined: 14 Jun 2017
  • None

#911

Posted 14 June 2017 - 12:27 PM

 

Hey, i want to make a mod like when i write something like /myname, to show in chat my name without writing my ID

 

For SAMP is my guess?

 

Yes


Inan-Ahammad
  • Inan-Ahammad

    Project Props - Mapper

  • Members
  • Joined: 15 Jul 2016
  • Bangladesh

#912

Posted 30 June 2017 - 04:38 AM

well i want to display a text right after the game starts.So how should i arranhe the script.Which opcodes should i use

ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union
  • Contribution Award [Mods]
    Helpfulness Awards [Mods]

#913

Posted 30 June 2017 - 03:01 PM Edited by ZAZ, 30 June 2017 - 03:01 PM.

There're several different methods to display text

use opcode search tool and search for text

-textbox (shows help and infos)

-styled text (shows mission titel)

-text high priority (shows instructions)

-text draw(can show everything in different style, different size, positions, assignement, color)


NCHK
  • NCHK

    Player Hater

  • Members
  • Joined: 03 Apr 2017
  • India

#914

Posted 28 August 2017 - 01:07 PM

Is there anyway to lauch exe files using cleo script in gta sa ?

Arya_Eto
  • Arya_Eto

    HustlerBustler

  • Members
  • Joined: A week ago
  • India

#915

Posted A week ago

Awesome Tutorial Zaz  :colgate:

 

i need some help with coding.

 

Issue/Problem:

 

i want to check if player is near to a pickup and when he is near to certain distance from pickup, then pickups appear.

when he goes away to certain distance then pickups should be released from memory.

 

Reason:

 

i want to do this because i added several pickups and then saved game. now i am not able to get normal in-game pickups like certain savegame disk pickup, weapon pickup on killing cops etc because maybe pickups limit is reached. i removed the script from cleo but still my pickups were visible instead of disappearing.

 

so i read upon it and got info that pickups and in game car generators will be saved with savegame and then it will be duplicated with every game load.

 

so basically first requirement is, i want to free up my pickups from my savegame, once this issue is solved then i want to make them appear  when player is nearby to pickups and once he picks up and goes to certain distance then pickups should be released.

 

i googled alot, went through sanny help content but didnt get any opcode to check if player is near a pickup.

 

so please help me with this, i just started coding in cleo. like 3 days.


deltaCJ
  • deltaCJ

    BUSTED!

  • Members
  • Joined: 27 Dec 2013
  • None

#916

Posted A week ago

I'm not ZAZ but maybe you shouldn't be doing such complex codes. Start simple. You need to practice for a while.

Arya_Eto
  • Arya_Eto

    HustlerBustler

  • Members
  • Joined: A week ago
  • India

#917

Posted A week ago

I'm not ZAZ but maybe you shouldn't be doing such complex codes. Start simple. You need to practice for a while.

Since i posted my question under Zaz's tutorial, that's why referred him bro.

 

Totally agree with you Delta and that's how i am going to proceed bro. 

 

i am going through Zaz's cleo tutorial now and parallelly writing small scripts to practice and for that reason i thought to play with above code.

 

but in meantime i am really very curious to know the solution for my issue that how can we check if player is near a pickup because opcode for player near car or object is available but i didnt find any opcode which checks if player near pickup.

  • deltaCJ likes this

guru_guru
  • guru_guru

    pajaro culiao

  • Members
  • Joined: 22 Jul 2017
  • Chile

#918

Posted A week ago

>Get player coords

>Get pickup coords

>Get distance between these two

>If distance <= desired radius aka Player is near Pickup

>>Do stuff

  • deltaCJ and Arya_Eto like this

ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union
  • Contribution Award [Mods]
    Helpfulness Awards [Mods]

#919

Posted A week ago

i want to do this because i added several pickups and then saved game. now i am not able to get normal in-game pickups like certain savegame disk pickup, weapon pickup on killing cops etc because maybe pickups limit is reached. i removed the script from cleo but still my pickups were visible instead of disappearing.
 
so i read upon it and got info that pickups and in game car generators will be saved with savegame and then it will be duplicated with every game load.
 
so basically first requirement is, i want to free up my pickups from my savegame, once this issue is solved then i want to make them appear  when player is nearby to pickups and once he picks up and goes to certain distance then pickups should be released.

No chance, you only can edit the savegame, ask OrionSR

 

My advice: delete your corrupted savegame

And for the future: don't install script mods and play story line and make savegames

Maybe only 2 or 3 simple and good cleo scripts like this Teleport to marker and this carspawner

 

Then use your favorite savegame to play script mods, but avoid savegames

  • Arya_Eto likes this

Arya_Eto
  • Arya_Eto

    HustlerBustler

  • Members
  • Joined: A week ago
  • India

#920

Posted A week ago

 

i want to do this because i added several pickups and then saved game. now i am not able to get normal in-game pickups like certain savegame disk pickup, weapon pickup on killing cops etc because maybe pickups limit is reached. i removed the script from cleo but still my pickups were visible instead of disappearing.
 
so i read upon it and got info that pickups and in game car generators will be saved with savegame and then it will be duplicated with every game load.
 
so basically first requirement is, i want to free up my pickups from my savegame, once this issue is solved then i want to make them appear  when player is nearby to pickups and once he picks up and goes to certain distance then pickups should be released.

No chance, you only can edit the savegame, ask OrionSR

 

My advice: delete your corrupted savegame

And for the future: don't install script mods and play story line and make savegames

Maybe only 2 or 3 simple and good cleo scripts like this Teleport to marker and this carspawner

 

Then use your favorite savegame to play script mods, but avoid savegames

 

True Zaz...i understood after messing around that we shouldnt install too many scripts. instead should stick to few useful mods.

 

man i am never going to make a savegame again if i have any script mod [specially written by me :p]

 

Thanks for advice, needed this.


>Get player coords

>Get pickup coords

>Get distance between these two

>If distance <= desired radius aka Player is near Pickup

>>Do stuff

Thanks bro :)... will try it right away.


KCAO
  • KCAO

    Player Hater

  • Members
  • Joined: 6 days ago
  • Singapore

#921

Posted 6 days ago Edited by KCAO, 6 days ago.

Yo, could anyone lend a hand here? Trying to further modify zaz's girlxxx mod. I've been trying to include the transition animations between sex positions instead of having them zip into each one. However, every time I edit the script, I either cause the entire animation to freeze or the mini-game stops working. I tried editing the jumptable for those animations because I thought it was causing the animations to be skipped. Here's the part of the original script, without any edits:  


:GFXXXA_10009
if 
else_jump @GFXXXA_10354 
0871: init_jump_table [email protected] total_jumps 3 default_jump 0 @GFXXXA_10347 jumps 1 @GFXXXA_10097 2 @GFXXXA_10178 3 @GFXXXA_10259 -1 @GFXXXA_10347 -1 @GFXXXA_10347 -1 @GFXXXA_10347 -1 @GFXXXA_10347  
 
:GFXXXA_10097
0812: AS_actor [email protected] perform_animation "SEX_1TO2_W" IFP "SEX" framedelta 4.0 loopA 0 lockX 0 lockY 0 lockF 0 time 0 // versionB 
0812: AS_actor $PLAYER_ACTOR perform_animation "SEX_1TO2_P" IFP "SEX" framedelta 4.0 loopA 0 lockX 0 lockY 0 lockF 0 time 0 // versionB 
jump @GFXXXA_10347 
 
:GFXXXA_10178
0812: AS_actor [email protected] perform_animation "SEX_2TO3_W" IFP "SEX" framedelta 4.0 loopA 0 lockX 0 lockY 0 lockF 0 time 0 // versionB 
0812: AS_actor $PLAYER_ACTOR perform_animation "SEX_2TO3_P" IFP "SEX" framedelta 4.0 loopA 0 lockX 0 lockY 0 lockF 0 time 0 // versionB 
jump @GFXXXA_10347 
 
:GFXXXA_10259
0812: AS_actor [email protected] perform_animation "SEX_3TO1_W" IFP "SEX" framedelta 4.0 loopA 0 lockX 0 lockY 0 lockF 0 time 0 // versionB 
0812: AS_actor $PLAYER_ACTOR perform_animation "SEX_3TO1_P" IFP "SEX" framedelta 4.0 loopA 0 lockX 0 lockY 0 lockF 0 time 0 // versionB 
jump @GFXXXA_10347 
 
:GFXXXA_10347
 
:GFXXXA_10354
return 

deltaCJ
  • deltaCJ

    BUSTED!

  • Members
  • Joined: 27 Dec 2013
  • None

#922

Posted 6 days ago

Why do you have the animations time to be 0? Put it to -1


KCAO
  • KCAO

    Player Hater

  • Members
  • Joined: 6 days ago
  • Singapore

#923

Posted 6 days ago Edited by KCAO, 6 days ago.

Why do you have the animations time to be 0? Put it to -1

That's how I found the file. There are more instances of it being that way in the script. Anyway I'll give that a shot and report back.

Edit: Tried it, and changing the value from 0 to -1 doesn't affect the animation. Unless there's a step after that I'm missing, I still believe it has to do with the jumptable


deltaCJ
  • deltaCJ

    BUSTED!

  • Members
  • Joined: 27 Dec 2013
  • None

#924

Posted 6 days ago

Send the full script


KCAO
  • KCAO

    Player Hater

  • Members
  • Joined: 6 days ago
  • Singapore

#925

Posted 5 days ago

The full script is pretty long. Here's the pastebin for it:
https://pastebin.com/9UKb4Q7z

I focused on the parts of the script that had the transition animations in it (i.e., 'sex_1to2_w', 'sex_1to2_p', sex_2to3_p, etc.)
But perhaps I'm looking at it the wrong way.

 

Thanks for the help!


deltaCJ
  • deltaCJ

    BUSTED!

  • Members
  • Joined: 27 Dec 2013
  • None

#926

Posted 5 days ago

It looks like the animations are set to 1.0 second then it switches, try making it so when the animation time is 2.0 seconds

 

 

go to the cleo file and press ctrl + f and search: 1TO2 and you should find it.

 

 

But it's better off you wait for ZAZ as it's his own mod :p


KCAO
  • KCAO

    Player Hater

  • Members
  • Joined: 6 days ago
  • Singapore

#927

Posted 5 days ago

Just tried that too, and it also didn't change anything. Can't help but feel like I'm missing something.

Anyway, thanks for trying! Yeah, Zaz can probably give us more insight


ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union
  • Contribution Award [Mods]
    Helpfulness Awards [Mods]

#928

Posted 2 days ago

I've been trying to include the transition animations between sex positions instead of having them zip into each one.

But it already works with transition animations and what means zip into each one?
Also, enable frame limiter to watch it in a propper way

 

 

I focused on the parts of the script that had the transition animations in it (i.e., 'sex_1to2_w', 'sex_1to2_p', sex_2to3_p, etc.)
But perhaps I'm looking at it the wrong way.

There're 3 positions in the script that have these codes, because the complete animation algorithm is available 3 times, for 3 different situations


KCAO
  • KCAO

    Player Hater

  • Members
  • Joined: 6 days ago
  • Singapore

#929

Posted A day ago

But it already works with transition animations and what means zip into each one?

Also, enable frame limiter to watch it in a propper way

 Just tot be clear here, the mini-game animations, which are SEX_1_P, SEX_2_P, etc. are all working perfectly.
The animations that I am referring to are the ones which are supposed to play when you press 'shift'. You are right in that there are supposed to be 3 transition animations, but they do not play. Instead, the models snap into the next position of the mini-game when you press the shift key.
The animation files are present in the game and in your script. My question is how to access them.


ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union
  • Contribution Award [Mods]
    Helpfulness Awards [Mods]

#930

Posted A day ago

 You are right in that there are supposed to be 3 transition animations, but they do not play.

Yes they do. But they're very short and quick.

For the player_actor you can't really see a change.

 

For the girl you can see that arms and legs rotate quick, from doggy to missionary pose and also from the other front pose to doggy pose





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users