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

    3. Suggestions

[SA] ~ CLEO Script Tutorial ~


ZAZ
 Share

Recommended Posts

 

yes, "break" terminates loops,

but script doesn't end

 

 

 

I am not good at high level coding so I tried to convert this script in lower level coding. It is crashing. Please check it.

 

Script -

{$CLEO .cs}
:Gangmember_take_place
thread 'GMSIT'
:GTP_START
wait 0
if
0256: player $PLAYER_CHAR defined
jf @GTP_START
if //and
00DF: actor $PLAYER_ACTOR driving
//0AB0: key_pressed 8
jf @GTP_START
03C0: [email protected] = actor $PLAYER_ACTOR car
01EA: [email protected] = car [email protected] max_passengers
gosub @get_playercar_and_gangmember
gosub @gangmember_into_playercar
wait 1000
jump @GTP_START
:get_playercar_and_gangmember
07AF: [email protected] = player $PLAYER_CHAR group
092B: [email protected] = group [email protected] member 0
092B: [email protected] = group [email protected] member 1
092B: [email protected] = group [email protected] member 2
092B: [email protected] = group [email protected] member 3
092B: [email protected] = group [email protected] member 4
092B: [email protected] = group [email protected] member 5
092B: [email protected] = group [email protected] member 6
for [email protected] = 0 to 6
wait 2000
if
056D: actor [email protected]([email protected],7i) defined
jf @GTP_START
[email protected] += 1 /// ---- [email protected] = amount of gangmembers
return
:gangmember_into_playercar
if///--------------- if player_car have 3 passenger seats
jf @GTP_TAKE2
for [email protected] = 0 to 6
wait 0
if and
00DF: actor $PLAYER_ACTOR driving
056D: actor [email protected]([email protected],7i) defined
jf @GTP_START
05CA: AS_actor [email protected]([email protected],7i) enter_car [email protected] passenger_seat [email protected] delay -1
if
jump @GTP_START
:GTP_TAKE2
if///--------------- if player_car have 2 passenger seats
jf @GTP_TAKE3
for [email protected] = 0 to 6
wait 0
if and
00DF: actor $PLAYER_ACTOR driving
056D: actor [email protected]([email protected],7i) defined
jf @GTP_START
05CA: AS_actor [email protected]([email protected],7i) enter_car [email protected] passenger_seat [email protected] delay -1
if
jump @GTP_START
:GTP_TAKE3
if///--------------- if player_car have 1 passenger seats
jf @gangmember_into_playercar
for [email protected] = 0 to 6
wait 0
if and
00DF: actor $PLAYER_ACTOR driving
056D: actor [email protected]([email protected],7i) defined
jf @GTP_TAKE3
05CA: AS_actor [email protected]([email protected],7i) enter_car [email protected] passenger_seat 1 delay -1
return

Now the next step of script????

 

:gangmember_into_playercar
if///--------------- if player_car have 3 passenger seats
then
for [email protected] = 0 to 6
wait 0
if and
00DF: actor $PLAYER_ACTOR driving
056D: actor [email protected]([email protected],7i) defined
then
05CA: AS_actor [email protected]([email protected],7i) enter_car [email protected] passenger_seat [email protected] delay -1
if
Should I add A situation of load model?? After getting the rest 4 members and make them sit in car 2.
Link to comment
Share on other sites

Okay, I've figured out how to add weapons onto aircraft. The only thing left is to make any aircraft float in water even if they're not being piloted.

 

Is it possible to make a cleo script so that any aircraft can float on water like the Skimmer?

Link to comment
Share on other sites

  • 2 weeks later...
Hayate Kankichi

i want to make a Iron man mod like GTA IV for GTA San Andreas, so i just need to make a txd. file which should spin on radar, but i make a txd. but i can't make a script which make this thing spin on radar, plz someone help me, i don't know how to scripting this thing

Link to comment
Share on other sites

I am not good at high level coding so I tried to convert this script in lower level coding. It is crashing. Please check it.

 

Script -

Now the next step of script????

 

Should I add A situation of load model?? After getting the rest 4 members and make them sit in car 2.

No, it's not so easy, also i helped enough, you need to learn by yourself, especially you need more knowledge about math coding and array coding.

High level isn't required, but it's the better way to create such "array loops" for example.

Next step will be: I make the script and upload it as my mod at gtagarage. Do you want that?

 

Okay, I've figured out how to add weapons onto aircraft. The only thing left is to make any aircraft float in water even if they're not being piloted.

 

Is it possible to make a cleo script so that any aircraft can float on water like the Skimmer?

Yes, maybe, but maybe it looks ugly and it will be much work to test adjustments, change adjustments and test again for thousand times.

It needs to check waterheight with opcode 092E:. Planes are difficult, because they're fast and if it'll be stoped to late, it'll explode.

For the rest, check this mod

 

i want to make a Iron man mod like GTA IV for GTA San Andreas, so i just need to make a txd. file which should spin on radar, but i make a txd. but i can't make a script which make this thing spin on radar, plz someone help me, i don't know how to scripting this thing

First learn scripting, then study cleo speedometer scripts like this one

or write a request in the request topic

Edited by ZAZ
Link to comment
Share on other sites

  • 2 weeks later...

@ZAZ, You wrote in the tutorial that "The IF Player- Defined-check should allway be the first check in a loop". This is howerver not sufficient and it is not the loop that creats the problem. It would be great if you update the tutorial making clear that after a "wait" statements ALL handles (e.g $PLAYER_CHAR, actors, vehicles, objects...) that are used in the script must be checked if they are still defined. It is the following place in the tutorial:

 

 

 

The "IF Player- Defined-check" should allway be the first check in a loop

Script structure simple with 1 Loop:
-Script head
-1.Loop-Adress
-wait code
-IF player_defined-check
-Conditional Check
-Event
-Normal jump instruction to 1.LoopAdress

CODE
{$CLEO .cs}
:Akt
03A4: name_thread 'AKT'

:Akt_01
0001: wait 0 ms
if
0256: player $PLAYER_CHAR defined
004D: jump_if_false @Akt_01
if
0AB0: key_pressed 8//-----------------key = Backspace
004D: jump_if_false @Akt_01
08B2: toggle_thermal_vision 1
0001: wait 3000 ms
08B2: toggle_thermal_vision 0
0002: jump @Akt_01//--------Normal jump instruction to 1.LoopAdress


Script above activates the Infrarot view after

 

 

 

Suggestion how to write:

Cleo threads are executed using cooperative multitasking (not preemptive). This means that only one cleo thread is executed at a time. The illusion that cleo threads are executed in parallel is because whenever a "wait" statement is called, the scheduler gives execution to the next cleo thread. Hence, whenever you have a loop you must use a "wait" statement to prevent a deadlock of the game.

 

The advantage of this approach is that the game state (e.g. existence and position of objects) does not change while your cleo script executes between two wait-statements. However, BE CAREFUL, "during" execution of a wait-statement anything may happen in the game. For example, objects may be deleted by the game, you may get arrested, a mission could have been started. Therefore, after a "wait" statement you MUST check if all handles (player, objects, vehicles, actors,.etc) that you use in the script are still defined. For this you can use the following opcodes:

0256: player $PLAYER_CHAR defined
056D: actor [email protected] defined
056E: car [email protected] defined

03CA: object [email protected] exists

If you need the negated result, then write for example:

856E: not car CAR_HANDLE defined

Another suggestion: emphasize even more (perhaps bigger font) that people should not use global variables unless they are experts.

Edited by goodidea82
Link to comment
Share on other sites

The reason i don't like to edit the first post is, it contains anchors and the anchors only work with the new forums software because the admins made it working.

The anchors won't work anymore if i edit the post.

anchor 1, anchor 2, anchor 3, anchor 4 and so on

Link to comment
Share on other sites

  • 1 month later...

Bells and Whistles - Easy Audio Events

On 3/23/2009 at 9:42 AM, ZAZ said:

///////SOUNDS/////
A small part of the listed sounds in AudioEvents can be startet with play sound opcodes: 018C: 097A: 09F1:
Find sounds in the range from SOUND_1002 to SOUND_1191. Not all worked by me. It seems that someone only can used from the exe
Someone of these sounds are durable and must be started with 018D: and stoped with 018E:

Some other ones of these sounds have a replay mode (music for minigames) and can be stoped with a stop sound
SOUND_PILOT_AWARD_TRACK_START 1187 start sound
SOUND_PILOT_AWARD_TRACK_STOP 1188 stop sound

 

I wasn't having any luck finding a list of audio events that can be played without loading a wave so I made one for San Andreas.

 

The primary goal here is to identify sounds that don't need to be loaded as waves and are always consistent. I just want to make my scripts go beep, boink and bling when certain actions take place instead of relying on messages all the time. If the wave needs to be loaded then it's not on the list. No loading, no looping until it's loaded, one command to play most sounds, play and forget, sounds can overlap, no need to stop most non-"track" sounds, don't need to unload the wave, and no variables used for audio handles. These sounds are easy to work with.

 

Tested with opcodes 018C: 097A: 097B: 09F1: and 09F7:

See also: 097C: and 03D7:

Not appropriate for 018D: and 018E:

 

Sounds that won't play with 09F1: (actor)

1144 // SOUND_PED_HIT_WATER_SPLASH

 

Sounds that won't play with 018C: or 097A: (coordinates)

1019 // SOUND_CRANE_ENTER

1157 // SOUND_MINITANK_FIRE

1189 // SOUND_PED_DEATH_CRUNCH

 

Sounds that won't play with 097B: (objects) or 09F7: (cars)

1189 // SOUND_PED_DEATH_CRUNCH

 

Easy Audio Events

1002  // SOUND_CEILING_VENT_LAND
1009  // SOUND_BONNET_DENT
1019  // SOUND_CRANE_ENTER
1020  // SOUND_CRANE_MOVE_START
1021  // SOUND_CRANE_MOVE_STOP
1022  // SOUND_CRANE_EXIT
1027  // SOUND_WHEEL_OF_FORTUNE_CLACKER
1035  // SOUND_SHUTTER_DOOR_START
1036  // SOUND_SHUTTER_DOOR_STOP
1039  // SOUND_PARACHUTE_OPEN
1052  // SOUND_AMMUNATION_BUY_WEAPON
1053  // SOUND_AMMUNATION_BUY_WEAPON_DENIED
1054  // SOUND_SHOP_BUY
1055  // SOUND_SHOP_BUY_DENIED
1056  // SOUND_RACE_321
1057  // SOUND_RACE_GO
1058  // SOUND_PART_MISSION_COMPLETE
1062  // SOUND_GOGO_TRACK_START
1063  // SOUND_GOGO_TRACK_STOP
1068  // SOUND_DUAL_TRACK_START
1069  // SOUND_DUAL_TRACK_STOP
1076  // SOUND_BEE_TRACK_START
1077  // SOUND_BEE_TRACK_STOP
1083  // SOUND_ROULETTE_ADD_CASH
1084  // SOUND_ROULETTE_REMOVE_CASH
1085  // SOUND_ROULETTE_NO_CASH
1095  // SOUND_BIKE_PACKER_CLUNK
1097  // SOUND_AWARD_TRACK_START
1098  // SOUND_AWARD_TRACK_STOP
1100  // SOUND_MESH_GATE_OPEN_START
1101  // SOUND_MESH_GATE_OPEN_STOP
1130  // SOUND_PUNCH_PED
1131  // SOUND_AMMUNATION_GUN_COLLISION
1132  // SOUND_CAMERA_SHOT
1133  // SOUND_BUY_CAR_MOD
1134  // SOUND_BUY_CAR_RESPRAY
1135  // SOUND_BASEBALL_BAT_HIT_PED
1136  // SOUND_STAMP_PED
1137  // SOUND_CHECKPOINT_AMBER
1138  // SOUND_CHECKPOINT_GREEN
1139  // SOUND_CHECKPOINT_RED
1140  // SOUND_CAR_SMASH_CAR
1141  // SOUND_CAR_SMASH_GATE
1142  // SOUND_OTB_TRACK_START
1143  // SOUND_OTB_TRACK_STOP
1144  // SOUND_PED_HIT_WATER_SPLASH
1145  // SOUND_RESTAURANT_TRAY_COLLISION
1147  // SOUND_SWEETS_HORN
1148  // SOUND_MAGNET_VEHICLE_COLLISION
1149  // SOUND_PROPERTY_PURCHASED
1150  // SOUND_PICKUP_STANDARD
1153  // SOUND_GARAGE_DOOR_START
1154  // SOUND_GARAGE_DOOR_STOP
1157  // SOUND_MINITANK_FIRE
1159  // SOUND_EXPLOSION
1163  // SOUND_PED_COLLAPSE
1165  // SOUND_SHUTTER_DOOR_SLOW_START
1166  // SOUND_SHUTTER_DOOR_SLOW_STOP
1181  // SOUND_TEMPEST_TRACK_START
1182  // SOUND_TEMPEST_TRACK_STOP
1183  // SOUND_DRIVING_AWARD_TRACK_START
1184  // SOUND_DRIVING_AWARD_TRACK_STOP
1185  // SOUND_BIKE_AWARD_TRACK_START
1186  // SOUND_BIKE_AWARD_TRACK_STOP
1187  // SOUND_PILOT_AWARD_TRACK_START
1188  // SOUND_PILOT_AWARD_TRACK_STOP
1189  // SOUND_PED_DEATH_CRUNCH
1190  // unlisted_Slap_Sound

Of the sounds listed above, the sounds listed below appear to be non-directional; they sound the same no mater how far away CJ is from the object.

 

 

 

1052  // SOUND_AMMUNATION_BUY_WEAPON
1053  // SOUND_AMMUNATION_BUY_WEAPON_DENIED
1054  // SOUND_SHOP_BUY
1055  // SOUND_SHOP_BUY_DENIED
1056  // SOUND_RACE_321
1057  // SOUND_RACE_GO
1058  // SOUND_PART_MISSION_COMPLETE
1062  // SOUND_GOGO_TRACK_START
1063  // SOUND_GOGO_TRACK_STOP
1068  // SOUND_DUAL_TRACK_START
1069  // SOUND_DUAL_TRACK_STOP
1076  // SOUND_BEE_TRACK_START
1077  // SOUND_BEE_TRACK_STOP
1083  // SOUND_ROULETTE_ADD_CASH
1084  // SOUND_ROULETTE_REMOVE_CASH
1085  // SOUND_ROULETTE_NO_CASH
1097  // SOUND_AWARD_TRACK_START
1098  // SOUND_AWARD_TRACK_STOP
1100  // SOUND_MESH_GATE_OPEN_START
1101  // SOUND_MESH_GATE_OPEN_STOP
1133  // SOUND_BUY_CAR_MOD
1134  // SOUND_BUY_CAR_RESPRAY
1137  // SOUND_CHECKPOINT_AMBER
1138  // SOUND_CHECKPOINT_GREEN
1139  // SOUND_CHECKPOINT_RED
1142  // SOUND_OTB_TRACK_START
1143  // SOUND_OTB_TRACK_STOP
1149  // SOUND_PROPERTY_PURCHASED
1150  // SOUND_PICKUP_STANDARD
1181  // SOUND_TEMPEST_TRACK_START
1182  // SOUND_TEMPEST_TRACK_STOP
1183  // SOUND_DRIVING_AWARD_TRACK_START
1184  // SOUND_DRIVING_AWARD_TRACK_STOP
1185  // SOUND_BIKE_AWARD_TRACK_START
1186  // SOUND_BIKE_AWARD_TRACK_STOP
1187  // SOUND_PILOT_AWARD_TRACK_START
1188  // SOUND_PILOT_AWARD_TRACK_STOP

 

 

Edited by OrionSR
Code Tags
Link to comment
Share on other sites

Yes, it's an annoying job, needs to find out which code plays which audio.

The SA SCR ini have better descriptions

 

097A REPORT_MISSION_AUDIO_EVENT_AT_POSITION(f,f,f,i)097B REPORT_MISSION_AUDIO_EVENT_AT_OBJECT(i,i)097C ATTACH_MISSION_AUDIO_TO_OBJECT(i,i)09F1 REPORT_MISSION_AUDIO_EVENT_AT_CHAR(i,i)09F7 REPORT_MISSION_AUDIO_EVENT_AT_CAR(i,i)03D7 SET_MISSION_AUDIO_POSITION(i,f,f,f)
seems to be made to work while mission mode ... don't know

 

Have a look to this topic. I was wondering why the Alarm sound didn't work fine

and found out that it needs to load it first as wav with 03CF and 03D0 and then play it with 097A REPORT_MISSION_AUDIO_EVENT_AT_POSITION(f,f,f,i)

it's same methode like in Black Project mission

Link to comment
Share on other sites

Hm... maybe I should repeat some tests using the object and car codes as the location code turned up some sounds that didn't work for the "character" (should be actor) code. My hypothesis is that some of these sounds only play for certain types of codes as both 018C:and 097A: provided similar results for location. So maybe I'll find something new for objects or cars. Updated: No new sounds. Added a short list of non-directional sounds to my previous post.

 

But again, the primary goal here is to identify sounds that don't need to be loaded as waves and are always consistent. I just want to make my scripts go beep, boink and bling when certain actions take place instead of relying on messages all the time. If the wave needs to be loaded then it's not on the list. I don't have much experience with audio, and don't really want to learn just yet. I was having fun with some of the new Cleo 4 opcodes for cheat strings and text display and wanted to spice up the scripts a little without going through a lot of hassle. No loading, no looping until it's loaded, one command to play most sounds, play and forget or overlap, no need to stop most sounds, don't need to unload the wave, no variables used for handles. Yeah, these sounds are easy to work with.

 

The exceptions are the continuous sounds that need control or stop events to manipulate them properly. Don't count on hearing a stop sound if the start isn't playing. I think the control and stop events jump to different parts of the track, so they can't play without the track active. Maybe. Again, I was looking for the easy stuff. I doubt I'll be trying to control the crane sounds any time soon.

 

I got very inconsistent results during some tests. It seems that some events get used by peds in the area. Or maybe the event pointers aren't initialized yet and are pointing to null events. Many sounds tended to repeat, such as "Hey, that's police property!" or phones ringing, or ringing loudly. Perhaps sounds are loaded based on location or other factors. To reduce false positives I would quit the game and load in an isolated area in the LV airport (just happened to have a save there on the other side of the hangar from the air race start). This procedure eliminated the phones and cops sounds that tended to repeat a lot, and didn't match their descriptions in Audio Event anyway. It could be that the gate opening and closing sounds were loaded by the airport gate scripts which are active in the area.

Edited by OrionSR
Link to comment
Share on other sites

seems to be made to work while mission mode ... don't know

 

Have a look to this topic. I was wondering why the Alarm sound didn't work fine

and found out that it needs to load it first as wav with 03CF and 03D0 and then play it with 097A REPORT_MISSION_AUDIO_EVENT_AT_POSITION(f,f,f,i)

it's same methode like in Black Project mission

 

A summary from the other topic is the TC was trying to play the claxon from Black Project and found the wave at SOUND__SECURITY_ALARM 42801, but could not find reference to this sound in the mission. ZAZ demonstrated playing the audio by loading SOUND_BANK_BLACK_PROJECT 1809 and playing SOUND_CLAXON_START 1005 as used in the mission, but there seemed to be some mystery as to how these sounds are connected. I think I finally have a basic hypothesis for how these sounds are connected.

 

pdescobar documented a GTA:SA SFX Directory that includes a lot of basic info on the sound effects. The sounds that have event IDs start at 2000. There is no reference to audio events in the 1000s and 1100s like I was working with for Easy Audio Events, or the 1800 sound bank events. It is my hypothesis that these are not really sounds, but audio control events that can play, jump to, or stop the actual wave files, or banks that load groups of sounds. It's still hard to tell which banks are loaded and which sounds are included. I found what appears to be two "banks" for the blast door sounds.

 

SOUND_BANK_BLACK_PROJECT 180921 	9369896 	4 (sfx)	8k/12k/15k	6000 - 6003	Area 69 SFXSOUND__BLAST_DOOR_SLIDE_LOOP_2 6000SOUND__CLAXON_LOOP 6001SOUND__HEAVY_DOOR 6002SOUND__SHOOT_CONTROLS 6003199	293262668	5 (sfx)	12k/15k	41600 - 41604	Blast Door SFXSOUND__BLAST_DOOR_SLIDE_LOOP 41600SOUND__BLAST_DOOR_SLIDE_START 41601SOUND__BLAST_DOOR_SLIDE_STOP 41602SOUND__KEYPAD_BEEP2 41603SOUND__SHOOT_CONTROLS2 41604SOUND_SECURITY_ALARM 41800 (closer to Blast Door sounds)SOUND__SECURITY_ALARM 42801 (near Vertical Bird lift sounds)

 

Audio events used in the mission, besides waves loaded for specific playback.

SOUND_CLAXON_START 1005SOUND_CLAXON_STOP 1006SOUND_BLAST_DOOR_SLIDE_START 1007SOUND_BLAST_DOOR_SLIDE_STOP 1008SOUND_SHUTTER_DOOR_START 1035SOUND_SHUTTER_DOOR_STOP 1036

The shutter sounds work without loading so I guess those can be ignored. The Shoot Controls sound looks like it's active but I can't see how it's used in the mission. I don't think bank 1809 is loading the Blast Door SFX as that wouldn't include the claxon sound. But it would include the keypad beep so that's something to look into if anyone is really curious.

 

So... Not a complete answer as I still can't tell which sounds get loaded with each bank, but it seems to explain some of the existing mysteries a little.

Edited by OrionSR
Link to comment
Share on other sites

Is that Possible to create my custom HUD?
Yes? then how?

____________________________________

 

I want to add my [logo] [black transparent solid area to put armor/hp/oxygen/ time/money/wanted star/selected weapon/in minimum area.]

Link to comment
Share on other sites

Is that Possible to create my custom HUD?

Yes? then how?

Download this mod. Install only vcshud.txd and hud.cs!!!

vcshud.txd >> models\txd folder

hud.cs >> cleo folder

Test it

Then decompile hud.cs or open vcs hud mod 1.5\source\hud.txt

There you can see that the author manipulated some memory adresses to disable the sa hud and then displayed textures on screen

 

Then read the readme.txd, he wrote following:"Wesser for the original script and textures (Windshield GUI and Location Text mods)"

so download and study also Wessers Windshield GUI

 

Edited by ZAZ
Link to comment
Share on other sites

  • 1 month later...

Hey dude!!!! I need really help... :panic: I want to create a cleo script for samp but i dont know how to start.. im beginner.. :/ I want to create a auto reputation script on gta samp .. I really need help. If you can, asnwer me here, or you can leave yours skype .. :/

 

( My skype : buoozeq )

Link to comment
Share on other sites

  • 2 weeks later...

In this script for Sliding Door (GTA-SA), it is used only the right rear door (095F: get_car [email protected] door 5 angle_to [email protected] ).
It uses a non-standard 3D object, which is difficult to identify in the script.
I have not found a match in dff using RW Analyze...
And also it is not clear even when it add the parameter lateral and transverse displacement...
If it was understandable it might also use the left rear door, the Holy Grail of the opening door! :D

:F14_NPC_CHECK_19wait 0if and056D:   actor $PLAYER_ACTOR defined   Player.Defined($PLAYER_CHAR)else_jump @F14_NPC_CHECK_190A8D: [email protected] = read_memory 12010644 size 4 virtual_protect [email protected] += 40A8D: [email protected] = read_memory [email protected] size 4 virtual_protect [email protected] = 0jump @F14_NPC_CHECK_91:F14_NPC_CHECK_910A8D: [email protected] = read_memory [email protected] size 1 virtual_protect [email protected] += 1if and  [email protected] >= 0  128 > [email protected]_jump @F14_NPC_CHECK_514005A: [email protected] += [email protected] // (int)if   Car.Model([email protected]) == #MOONBEAMelse_jump @F14_NPC_CHECK_5140A97: [email protected] = car [email protected] [email protected] += 16120A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0if   not [email protected] == 0else_jump @[email protected] += 1520A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0if   not [email protected] == 0else_jump @[email protected] += 16jump @F14_NPC_CHECK_261:F14_NPC_CHECK_261095F: get_car [email protected] door 5 angle_to [email protected]   not [email protected] == 0.0else_jump @[email protected] *= -1.00AA6: call_method 5878048 struct [email protected] num_params 3 pop 0 0.0 0.0 0.0 [email protected] += 480A8C: write_memory [email protected] size 4 value 0.1 virtual_protect [email protected] += 40A8C: write_memory [email protected] size 4 value [email protected] virtual_protect [email protected] += 40A8C: write_memory [email protected] size 4 value 0.0 virtual_protect [email protected] -= 56jump @F14_NPC_CHECK_514:F14_NPC_CHECK_4070AA6: call_method 5878048 struct [email protected] num_params 3 pop 0 0.0 0.0 0.0 [email protected] += 480A8C: write_memory [email protected] size 4 value 0.0 virtual_protect [email protected] += 40A8C: write_memory [email protected] size 4 value 0.0 virtual_protect [email protected] += 40A8C: write_memory [email protected] size 4 value 0.0 virtual_protect [email protected] -= 56jump @F14_NPC_CHECK_514:[email protected] += 256  [email protected] > 35584else_jump @F14_NPC_CHECK_91jump @F14_NPC_CHECK_19

EDIT:

I solved the position:

0AA6: call_method 5878048 struct [email protected] num_params 3 pop 0 0.0 0.0 0.0 [email protected] += 480A8C: write_memory [email protected] size 4 value 0.1 virtual_protect 0 // transverse +0.1 [email protected] += 40A8C: write_memory [email protected] size 4 value -1.0 virtual_protect 0 // lateral -1.0 [email protected] += 40A8C: write_memory [email protected] size 4 value 0.0 virtual_protect [email protected] -= 56

The 3D mesh is positional, is the 2nd after chassis, but still have not found in the script...

Edited by Automan
Link to comment
Share on other sites

  • 2 weeks later...

could u give me opcodes of below ?

 

if

somebody killed by player

move camera to somebody

wait 5000

restore camera

Link to comment
Share on other sites

could u give me opcodes of below ?

 

if

somebody killed by player

move camera to somebody

wait 5000

restore camera

It needs check who is getting attacked by the player

Try to use the CLEO opcode 0AD2

 

:LABEL_1if0AD2: [email protected] = player $PLAYER_CHAR targeted_actor //IF and SETjf @LABEL_1
And then check if the actor is dead

 

00D6: if0118:   actor [email protected] deadjf @LABEL_1//Get position in front of the actor and put the camera in that pos04C4: store_coords_to [email protected] [email protected] [email protected] from_actor [email protected] with_offset 0.0 5.0 1.0015F: set_camera_position [email protected] [email protected] [email protected] rotation 0.0 0.0 0.0//Then get the actor position and make the camera point at him04C4: store_coords_to [email protected] [email protected] [email protected] from_actor [email protected] with_offset 0.0 0.0 0.00160: set_camera_point_at [email protected] [email protected] [email protected] switchstyle 2wait 500002EB: restore_camera_with_jumpcut
It worked fine on my 'Bullet Show Time' mod

And remember to use the Opcode Search Tool :lol:

 

Here is a example script:

{$CLEO .cs}03A4: name_thread 'DIECAM':DIECAM_1wait 0if0256:   player $PLAYER_CHAR definedjf @DIECAM_1if0AD2:   [email protected] = player $PLAYER_CHAR targeted_actor //IF and SETjf @DIECAM_1if0118:   actor [email protected] deadjf @DIECAM_304C4: store_coords_to [email protected] [email protected] [email protected] from_actor [email protected] with_offset 0.0 5.0 1.0015F: set_camera_position [email protected] [email protected] [email protected] rotation 0.0 0.0 0.004C4: store_coords_to [email protected] [email protected] [email protected] from_actor [email protected] with_offset 0.0 0.0 0.00160: set_camera_point_at [email protected] [email protected] [email protected] switchstyle 2wait 500002EB: restore_camera_with_jumpcut:DIECAM_301C2: remove_references_to_actor [email protected] @DIECAM_1
Edited by LucassBR
Link to comment
Share on other sites

 

could u give me opcodes of below ?

 

if

somebody killed by player

move camera to somebody

wait 5000

restore camera

It needs check who is getting attacked by the player

Try to use the CLEO opcode 0AD2

 

:LABEL_1if0AD2: [email protected] = player $PLAYER_CHAR targeted_actor //IF and SETjf @LABEL_1
And then check if the actor is dead

 

00D6: if0118:   actor [email protected] deadjf @LABEL_1//Get position in front of the actor and put the camera in that pos04C4: store_coords_to [email protected] [email protected] [email protected] from_actor [email protected] with_offset 0.0 5.0 1.0015F: set_camera_position [email protected] [email protected] [email protected] rotation 0.0 0.0 0.0//Then get the actor position and make the camera point at him04C4: store_coords_to [email protected] [email protected] [email protected] from_actor [email protected] with_offset 0.0 0.0 0.00160: set_camera_point_at [email protected] [email protected] [email protected] switchstyle 2wait 500002EB: restore_camera_with_jumpcut
It worked fine on my 'Bullet Show Time' mod

And remember to use the Opcode Search Tool :lol:

 

Here is a example script:

{$CLEO .cs}03A4: name_thread 'DIECAM':DIECAM_1wait 0if0256:   player $PLAYER_CHAR definedjf @DIECAM_1if0AD2:   [email protected] = player $PLAYER_CHAR targeted_actor //IF and SETjf @DIECAM_1if0118:   actor [email protected] deadjf @DIECAM_304C4: store_coords_to [email protected] [email protected] [email protected] from_actor [email protected] with_offset 0.0 5.0 1.0015F: set_camera_position [email protected] [email protected] [email protected] rotation 0.0 0.0 0.004C4: store_coords_to [email protected] [email protected] [email protected] from_actor [email protected] with_offset 0.0 0.0 0.00160: set_camera_point_at [email protected] [email protected] [email protected] switchstyle 2wait 500002EB: restore_camera_with_jumpcut:DIECAM_301C2: remove_references_to_actor [email protected] @DIECAM_1

This doesn't work with Sniper Rifle

one more thing:

do you know what opcode returns true when player is using nitro?

Link to comment
Share on other sites

This doesn't work with Sniper Rifle

one more thing:

do you know what opcode returns true when player is using nitro?

There's only opcode to check if nitro is installed

 

03C0: [email protected] = actor $PLAYER_ACTOR car 096D: get_car [email protected] car_component 8 on_slot [email protected]

 

To check if nitro is used needs to read mem adress of car struct

 

03C0: [email protected] = actor $PLAYER_ACTOR car 0A97: [email protected] = car [email protected] struct 000A: [email protected] += 2424 0A8D: [email protected] = read_memory [email protected] size 1 virtual_protect 0
it returns not true or false but any value

if it returns 0, then nitro isn't used or it's empty

Edited by ZAZ
Link to comment
Share on other sites

 

This doesn't work with Sniper Rifle

one more thing:

do you know what opcode returns true when player is using nitro?

There's only opcode to check if nitro is installed

 

03C0: [email protected] = actor $PLAYER_ACTOR car 096D: get_car [email protected] car_component 8 on_slot [email protected]

 

To check if nitro is used needs to read mem adress of car struct

 

03C0: [email protected] = actor $PLAYER_ACTOR car 0A97: [email protected] = car [email protected] struct 000A: [email protected] += 2424 0A8D: [email protected] = read_memory [email protected] size 1 virtual_protect 0
it returns not true or false but any value

if it returns 0, then nitro isn't used or it's empty

 

could u give me an example?

(if nitro used zoom in camera and after 2 seconds return camera)

Link to comment
Share on other sites

Camera manipulation can you do yourself
Script below displays the containing value of the mem adress on screen

{$CLEO .cs}thread 'NITRO':NITRO_1wait 0if0256: player $PLAYER_CHAR definedjf @NITRO_1if00DF: actor $PLAYER_ACTOR drivingjf @NITRO_103C0: [email protected] = actor $PLAYER_ACTOR car:NITRO_5wait 0if0256: player $PLAYER_CHAR definedjf @NITRO_1if and00DF: actor $PLAYER_ACTOR driving8119: not car [email protected] wreckedjf @NITRO_10A97: [email protected] = car [email protected] [email protected] += 24240A8D: [email protected] = read_memory [email protected] size 1 virtual_protect 003F0: enable_text_draw 1045A: draw_text_1number 100.0 200.0 GXT 'NUMBER' number [email protected] @NITRO_5
Link to comment
Share on other sites

  • 4 months later...

Hola! (is Hello in spanish), good work in this amazing tutorial, Mr. ZAZ, but how can create several weapons pickups in one only CLEO Script? And if one of these is picked up, then wait a time and create again.

 

Thanks and Congratulations, good work Sir!

Link to comment
Share on other sites

Hola! (is Hello in spanish), good work in this amazing tutorial, Mr. ZAZ, but how can create several weapons pickups in one only CLEO Script? And if one of these is picked up, then wait a time and create again.

 

Thanks and Congratulations, good work Sir!

read this extra lesson: Placing Cars by Using Parked_Car_Generator and Weapon Pickups

and consider what i wrote about preventing duplicates, because pickups will be stored in stock savegames

 

The Cleo scripts with extension .cs are started allways from new by loading a save game or start new game,

If such a script includes for exemble a parked car generator and execute it and after this a save game is made,

and then this save game is loaded,

will be created a duplicate of the item, in this case a duplicate of a parked car generator.

This happens with parked car generator, pickups as well as placed objects.

use 0A95: enable_thread_saving to prevent such a failure

it instruct Cleo to store the script state by making a savegame

Link to comment
Share on other sites

Hola, is me again, sorry for the lack of information, I play GTA Vice City and would like to create more of a "pickup" in a .cs file and learn to create more than one "thread" in a .cs file

And sorry for my english, i speak spanish.

Link to comment
Share on other sites

Hola, is me again, sorry for the lack of information, I play GTA Vice City and would like to create more of a "pickup" in a .cs file and learn to create more than one "thread" in a .cs file

And sorry for my english, i speak spanish.

Example for a simple pickup script:

 

{$CLEO}thread 'VCPICK'0213: [email protected] = create_pickup #MP5LNG type 1 at -317.5 -551.5 10.3540213: [email protected] = create_pickup #MOLOTOV type 2 at -315.5 -551.5 10.3540213: [email protected] = create_pickup #LASER type 3 at -313.5 -551.5 10.3540213: [email protected] = create_pickup #M60 type 15 at -311.5 -551.5 10.3540213: [email protected] = create_pickup #ROCKETLA type 2 at -309.5 -551.5 10.35405DC: end_custom_thread{type 1 = pickup with price for purchase, permanently presenttype 2 = standart pickup, appears again after a minute after picked uptype 3 = pickup only for one timetype 15 = pickup appears again after picked up, after i made a savegame (or maybe after some game hours)}
Opcode 05DC changed to 0A93: by new cleo version CLEO2

05DC still works but if using cleo2, it's recommanded to use 0A93

 

{$CLEO}thread 'VCPICK'0213: [email protected] = create_pickup #MP5LNG type 1 at -317.5 -551.5 10.3540213: [email protected] = create_pickup #MOLOTOV type 2 at -315.5 -551.5 10.3540213: [email protected] = create_pickup #LASER type 3 at -313.5 -551.5 10.3540213: [email protected] = create_pickup #M60 type 15 at -311.5 -551.5 10.3540213: [email protected] = create_pickup #ROCKETLA type 2 at -309.5 -551.5 10.3540A93: end_custom_thread{type 1 = pickup with price for purchase, permanently presenttype 2 = standart pickup, appears again after a minute after picked uptype 3 = pickup only for one timetype 15 = pickup appears again after picked up, after i made a savegame (or maybe after some game hours)}
Attention!!! you need to prevent duplicates!

I try to explain again the case:

 

load savegame >> cs script starts >> pickups are applied

 

if making savegame >> pickups will be stored in stock savegame file

 

when loading this new savegame >> stored pickups will be applied >> cs script starts again >> pickups are applied, so you get duplicated pickups

 

 

 

 

 

 

 

 

 

 

 

 

learn to create more than one "thread" in a .cs file

The start of an additional thread by cleo script requires CLEO2 because opcode 05DE: create_custom_thread doesn't work.

It needs to use opcode 0A92:

It allows for example to start another script.

 

Assuming you have a cleo script and change the extension to *.s, e.g. myscript.s

so myscript.s doesn't start automaticly by gameload

then it can be started by another script that execute this code:

 

0A92: create_custom_thread "myscript.s"
Opcode 0A92 can be extended with additional parameter

Example:

 

0A92: create_custom_thread "myscript.s" 1 [email protected] 3 [email protected]
up to 30 parameter

 

So it's possible to submit informations as "script start options"

The started thread recieves the parameter data by following rule

[email protected] get data of 1.parameter

[email protected] get data of 2.parameter

[email protected] get data of 3.parameter

[email protected] get data of 4.parameter

[email protected] get data of 5.parameter

etc...

 

It's possible to start more threads in one and the same Cleo script, started from the same script which recieve the create_thread commands

 

Put a check for the variable [email protected] at script beginn and let the else_jump go to additional thread

So, because [email protected] is 0 by default, this check will be passed by default script start

and can then go to read the command to start the new thread with parameter:

 

0A92: create_custom_thread "cleoscript.cs" 1
this start again the same cleoscript but [email protected] won't be 0 by default but it will be 1

so the check at script beginn can't be passed but the else_jump will lead the code to another adress

 

Important: make shure that you insert the correct script name as entry of 0A92: create_custom_thread "<correct cleoscript name>.cs" 1

 

Example, the script below displays [email protected] on screen by default

the second thread starts after 5 seconds and displays then values of the parameters

 

{$CLEO .cs}:MultiThreadwait [email protected] == 0else_jump @MultiThread_20thread 'MULTHRD'0A92: create_custom_thread "myscript.cs" 1 2 3 4    while true    wait 0    03F0: enable_text_draw 1    0050: gosub @textsub_1      045A: draw_text_1number 100.0 100.0 GXT 'NUMBER' number [email protected]     end :MultiThread_20// second [email protected] == 1then    03A4: name_thread 'SECONDT'    wait 5000    while true        wait 0        03F0: enable_text_draw 1        0050: gosub @textsub_1          045A: draw_text_1number 150.0 150.0 GXT 'NUMBER' number [email protected]        0050: gosub @textsub_1        045A: draw_text_1number 180.0 150.0 GXT 'NUMBER' number [email protected]         0050: gosub @textsub_1        045A: draw_text_1number 210.0 150.0 GXT 'NUMBER' number [email protected]        0050: gosub @textsub_1        045A: draw_text_1number 240.0 150.0 GXT 'NUMBER' number [email protected]     endend05DC: end_custom_thread:textsub_10340: set_text_draw_color 204 0 204 255 03E4: set_text_draw_align_right 1 0343: set_text_linewidth 500.0033F: set_text_draw_letter_width_height 1.0 1.8return
don't forget to insert the correct script name as entry of 0A92: create_custom_thread "myscript.cs" 1 2 3 4

or save and compile this script as myscript.cs

Edited by ZAZ
Link to comment
Share on other sites

Thanks for the quick reply, I will try to create more than one thread in a .cs and then I will report.

Link to comment
Share on other sites

how i can put a textbox in a specific sphere? i tried but i have a loop

i edit the car wash by junior_djjr

{$CLEO .cs}

//-------------MAIN---------------
thread 'CARWASH1'

:CARWASH_11
wait 0
if and
Actor.Driving($PLAYER_ACTOR)
89AE: not actor $PLAYER_ACTOR driving_train
not Actor.DrivingVehicleType($PLAYER_ACTOR, #BIKE)
not Actor.DrivingVehicleType($PLAYER_ACTOR, #BMX)
not Actor.DrivingVehicleType($PLAYER_ACTOR, #MTBIKE)
00EE: actor $PLAYER_ACTOR sphere 1 near_point 2467.811 -1461.398 radius 2.0 2.0 in_car
00E1: player 0 pressed_key 19
jf @CARWASH_545
0811: [email protected] = actor $PLAYER_ACTOR used_car
[email protected] = Car.Angle([email protected])
Player.Money($PLAYER_CHAR) += -10
if and
[email protected] > 80.0
not [email protected] >= 100.0
jf @CARWASH_125
gosub @CARWASH_552

:CARWASH_125
if and
00EE: actor $PLAYER_ACTOR sphere 1 near_point 1911.573 -1768.766 radius 2.0 2.0 in_car
00E1: player 0 pressed_key 19
jf @CARWASH_230
0811: [email protected] = actor $PLAYER_ACTOR used_car
[email protected] = Car.Angle([email protected])
Player.Money($PLAYER_CHAR) += -10
if and
[email protected] > 160.0
not [email protected] >= 200.0
jf @CARWASH_230
gosub @CARWASH_709

:CARWASH_230
if and
00EE: actor $PLAYER_ACTOR sphere 1 near_point 1018.29 -925.5046 radius 2.0 2.0 in_car
00E1: player 0 pressed_key 19
jf @CARWASH_335
0811: [email protected] = actor $PLAYER_ACTOR used_car
[email protected] = Car.Angle([email protected])
Player.Money($PLAYER_CHAR) += -10
if and
[email protected] > 0.0
not [email protected] >= 15.0
jf @CARWASH_335
gosub @CARWASH_866

:CARWASH_335
if and
00EE: actor $PLAYER_ACTOR sphere 1 near_point 2139.225 2714.34 radius 2.0 2.0 in_car
00E1: player 0 pressed_key 19
jf @CARWASH_440
0811: [email protected] = actor $PLAYER_ACTOR used_car
[email protected] = Car.Angle([email protected])
Player.Money($PLAYER_CHAR) += -10
if and
[email protected] > 260.0
not [email protected] >= 280.0
jf @CARWASH_440
gosub @CARWASH_1023

:CARWASH_440
if and
00EE: actor $PLAYER_ACTOR sphere 1 near_point 2162.736 2464.786 radius 2.0 2.0 in_car
00E1: player 0 pressed_key 19
jf @CARWASH_545
0811: [email protected] = actor $PLAYER_ACTOR used_car
[email protected] = Car.Angle([email protected])
Player.Money($PLAYER_CHAR) += -10
if or
[email protected] > 350.0
not [email protected] >= 10.0
jf @CARWASH_545
gosub @CARWASH_1180

:CARWASH_545
jump @CARWASH_11

:CARWASH_552
[email protected] = 2433.484
[email protected] = -1466.877
[email protected] = 26.0
[email protected] = 2450.988
[email protected] = -1460.31
[email protected] = 24.0
[email protected] = 2464.935
[email protected] = -1461.254
[email protected] = 23.6362
[email protected] = 90.0
[email protected] = 2452.374
[email protected] = -1461.254
[email protected] = 23.0
[email protected] = 2442.825
[email protected] = -1461.042
jump @CARWASH_1337

:CARWASH_709
[email protected] = 1906.545
[email protected] = -1789.316
[email protected] = 15.0
[email protected] = 1912.231
[email protected] = -1779.717
[email protected] = 13.3828
[email protected] = 1910.709
[email protected] = -1768.905
[email protected] = 12.8471
[email protected] = 180.0
[email protected] = 1911.698
[email protected] = -1777.418
[email protected] = 12.3
[email protected] = 1911.659
[email protected] = -1784.818
jump @CARWASH_1337

:CARWASH_866
[email protected] = 1020.053
[email protected] = -906.0007
[email protected] = 44.0
[email protected] = 1016.677
[email protected] = -913.4736
[email protected] = 42.1797
[email protected] = 1018.8
[email protected] = -926.1744
[email protected] = 41.6421
[email protected] = 8.0
[email protected] = 1017.254
[email protected] = -916.9676
[email protected] = 41.808
[email protected] = 1016.277
[email protected] = -908.9207
jump @CARWASH_1337

:CARWASH_1023
[email protected] = 2168.984
[email protected] = 2708.609
[email protected] = 12.0
[email protected] = 2156.173
[email protected] = 2715.638
[email protected] = 10.0
[email protected] = 2139.225
[email protected] = 2714.34
[email protected] = 10.2835
[email protected] = 270.0
[email protected] = 2147.923
[email protected] = 2714.255
[email protected] = 10.2825
[email protected] = 2158.041
[email protected] = 2714.293
jump @CARWASH_1337

:CARWASH_1180
[email protected] = 2168.888
[email protected] = 2490.21
[email protected] = 12.0
[email protected] = 2162.631
[email protected] = 2479.663
[email protected] = 10.0
[email protected] = 2162.736
[email protected] = 2464.786
[email protected] = 10.2878
[email protected] = 0.0
[email protected] = 2162.9
[email protected] = 2474.468
[email protected] = 10.2825
[email protected] = 2162.735
[email protected] = 2481.288
jump @CARWASH_1337

:CARWASH_1337
03E5: show_text_box '_WASH'
Player.CanMove($PLAYER_CHAR) = False
Camera.SetPosition([email protected], [email protected], [email protected], 0.0, 0.0, 0.0)
Camera.PointAt([email protected], [email protected], [email protected], 2)
0A97: [email protected] = car [email protected] struct
[email protected] += 1200
0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0
Car.PutAt([email protected], [email protected], [email protected], [email protected])
Car.Angle([email protected]) = [email protected]
Car.SetSpeedInstantly([email protected], 0.0)
064B: [email protected] = create_particle "CARWASHSPRAY" at [email protected] [email protected] [email protected] type 1
064C: make_particle [email protected] visible
[email protected] = 0

:CARWASH_1496
81AD: not car [email protected] sphere 0 near_point [email protected] [email protected] radius 4.0 4.0
jf @CARWASH_1708
wait 0
Car.SetSpeedInstantly([email protected], 5.0)
Car.Angle([email protected]) = [email protected]
if
[email protected] > 0.1
jf @CARWASH_1622
[email protected] -= 0.1
0878: set_car [email protected] dirt_level [email protected]
0AD0: show_formatted_text_lowpriority "SUCIEDAD:~N~~R~%F" time 500 [email protected]
jump @CARWASH_1675

:CARWASH_1622
0878: set_car [email protected] dirt_level 0.0
0ACC: show_text_lowpriority "SUCIEDAD:~N~~R~0.0~N~VEHICULO LIMPIO" time 1000

:CARWASH_1675
if
[email protected] > 10000
jf @CARWASH_1701
jump @CARWASH_1708

:CARWASH_1701
jump @CARWASH_1496

:CARWASH_1708
0650: destroy_particle [email protected]
Camera.Restore
Player.CanMove($PLAYER_CHAR) = True
return

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

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