Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!   (85,522 visits to this link)

    2. News

    1. GTA Online

      1. Find Lobbies & Players
      2. Guides & Strategies
      3. Vehicles
      4. Content Creator
      5. Help & Support
    2. Crews

      1. Events
      2. Recruitment
    1. Grand Theft Auto Series

    2. GTA Next

    3. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    4. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA Mods
    5. GTA Chinatown Wars

    6. GTA Vice City Stories

    7. GTA Liberty City Stories

    8. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    9. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    10. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    11. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    12. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    3. Featured Mods

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption 2

    2. Red Dead Redemption

    3. Rockstar Games

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Forum Support

    2. Site Suggestions

ZAZ

[SA] ~ CLEO Script Tutorial ~

Recommended Posts

ZAZ

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

Share this post


Link to post
Share on other sites
Hayate Kankichi

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?

Share this post


Link to post
Share on other sites
ZAZ

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 99999909A0: 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

Share this post


Link to post
Share on other sites
deltaCJ

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?

Edited by deltaCJ

Share this post


Link to post
Share on other sites
BiPolarBear
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

Edited by BiPolarBear

Share this post


Link to post
Share on other sites
ZAZ

your script is uncomplete

Share this post


Link to post
Share on other sites
skatefilter5

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

Share this post


Link to post
Share on other sites
deltaCJ

use AS_pack

Share this post


Link to post
Share on other sites
Steak1337

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

Share this post


Link to post
Share on other sites
deltaCJ

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?

Share this post


Link to post
Share on other sites
Steak1337

 

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

Share this post


Link to post
Share on other sites
Inan-Ahammad

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

Share this post


Link to post
Share on other sites
ZAZ

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)

Edited by ZAZ

Share this post


Link to post
Share on other sites
NCHK

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

Share this post


Link to post
Share on other sites
Arya_Eto

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.

Share this post


Link to post
Share on other sites
deltaCJ

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

Share this post


Link to post
Share on other sites
Arya_Eto

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.

Share this post


Link to post
Share on other sites
guru_guru

>Get player coords

>Get pickup coords

>Get distance between these two

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

>>Do stuff

Share this post


Link to post
Share on other sites
ZAZ

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

Share this post


Link to post
Share on other sites
Arya_Eto

 

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.

Share this post


Link to post
Share on other sites
KCAO

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
Edited by KCAO

Share this post


Link to post
Share on other sites
deltaCJ

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

Share this post


Link to post
Share on other sites
KCAO

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

Edited by KCAO

Share this post


Link to post
Share on other sites
deltaCJ

Send the full script

Share this post


Link to post
Share on other sites
KCAO

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!

Share this post


Link to post
Share on other sites
deltaCJ

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

Share this post


Link to post
Share on other sites
KCAO

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

Share this post


Link to post
Share on other sites
ZAZ

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

Share this post


Link to post
Share on other sites
KCAO

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.

Share this post


Link to post
Share on other sites
ZAZ

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

Share this post


Link to post
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

×

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.