|
 |
|
|
|
|
|
Attention:
This is for the discussion and releasing of tutorials for modifying GTA. Anything that isn't a tutorial will be deleted without notification.
- Please read the Official Modification Forum Rules & Procedure BEFORE posting!
- Data topics: The following topics contain information for formatting and writing tutorials.
- Requests are to be made in the pinned topic.
- New topics to this forum are subject to moderation, and will not appear immediately. Pending approval by a moderator, if a topic is deemed unsuitable it will be deleted without notification.
|
GTAGarage.com free mod hosting from GTANet, simply login with your GTAForums account details
GTAModding.com GTANet's modding wiki
GTA Modding Chatroom provided by irc.gtanet.com (Don't have an IRC client? Click here)
|
[GTA SA] ~ CLEO Script Tutorial ~
 |
|
 |
| |
Joni2030  |
|
Prankster

Group: Members
Joined: Jul 6, 2011


|
| QUOTE (kal-el5676 @ Sunday, May 16 2010, 03:48) | | QUOTE (ZAZ @ May 17 2009, 19:07) | Ups, visitors. Thx friends.
| QUOTE (noelgamo @ May 15 2009, 07:55) | uhm how to make savepoints? cause I dont think I seen one from the tut. but if there is can you tell me wich bit is it.sorry for being a noob.  |
Right, I forgot it. Here it is: The classic savescript with savedisk_pickup needs to insert 3 coords points. One for the savedisk_pickup One for the spawnpoint beside the pickup One for the radar marker(If the savedisk is in an interior the location of the radar marker can be very different to pickup)
The savepoint of the script below is in the Atrium of Los Santos/Commerce
| CODE | {$CLEO .cs} :SAVE_1 03A4: name_thread 'SAVE' 0A95: enable_thread_saving 0570: 1@ = create_asset_radar_marker_with_icon 35 at 1722.2682 -1647.6366 42.4687 018B: show_on_radar 1@ 2
:SAVE_2 0001: wait 0 ms 0213: 2@ = create_pickup 1277 type 3 at 1720.7397 -1645.6292 20.2267
:SAVE_5 0001: wait 0 ms 00D6: if 0 0256: player $PLAYER_CHAR defined 004D: jump_if_false @SAVE_5 00D6: if 0 0214: pickup 2@ picked_up 004D: jump_if_false @SAVE_5 0050: gosub @SAVE_14 0002: jump @SAVE_2
:SAVE_14 00D6: if 0 0038: $ONMISSION == 0 // integer values 004D: jump_if_false @SAVE_17 0004: $ONMISSION = 1 // integer values 01B4: set_player $PLAYER_CHAR frozen_state 0 (frozen) 0001: wait 350 ms 03D8: show_SAVE_screen
:SAVE_15 00D6: if 0 83D9: NOT save_done 004D: jump_if_false @SAVE_16 0001: wait 0 ms 0002: jump @SAVE_15
:SAVE_16 00A1: put_actor $PLAYER_ACTOR at 1724.3228 -1646.5193 20.2272 0173: set_actor $PLAYER_ACTOR z_angle_to 176.8 01B4: set_player $PLAYER_CHAR frozen_state 1 (unfrozen) 0004: $ONMISSION = 1 // integer values 0001: wait 350 ms 0004: $ONMISSION = 0 // integer values
:SAVE_17 0051: return |
So much $ONMISSION = 0 and $ONMISSION = 1 Yes its nesssary. Otherwise the colored gangwar teritories will not be shown if a save was done while gangwar is activ.
And again the same script but in the kind of "decompilation without opcodes ":
| CODE | {$CLEO .cs} :SAVE_1 thread 'SAVE' 0A95: enable_thread_saving 0570: 1@ = create_asset_radar_marker_with_icon 35 at 1722.268 -1647.637 42.4687 018B: set_marker 1@ radar_mode 2
:SAVE_42 wait 0 2@ = Pickup.Create(1277, 3, 1720.74, -1645.629, 20.2267)
:SAVE_71 wait 0 if Player.Defined($PLAYER_CHAR) else_jump @SAVE_71 if Pickup.Picked_up(2@) else_jump @SAVE_71 gosub @SAVE_121 jump @SAVE_42
:SAVE_121 if $ONMISSION == 0 else_jump @SAVE_240 $ONMISSION = 1 Player.CanMove($PLAYER_CHAR) = False wait 350 03D8: show_save_screen
:SAVE_160 if 83D9: not save_done else_jump @SAVE_184 wait 0 jump @SAVE_160
:SAVE_184 Actor.PutAt($PLAYER_ACTOR, 1724.323, -1646.519, 20.2272) Actor.Angle($PLAYER_ACTOR) = 176.8 Player.CanMove($PLAYER_CHAR) = True $ONMISSION = 1 wait 350 $ONMISSION = 0
:SAVE_240 return | |
This doesn't seem to work for me. i try to compile and it says not enough parameters, expected 5. | Are you sure? Because when I copy that code and compile it, I don't have any errors. Are you sure you copied it right?
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
ZAZ  |
Posted: Saturday, Mar 17 2012, 05:45
|
Kernlochbohrer

Group: Members
Joined: Jan 10, 2005



|
| QUOTE (kal-el5676 @ Thursday, Mar 15 2012, 20:40) | | Thanks Zaz, but it would seem it only creates a marker and when the player steps out it simply reappears and nothing else happens. Also i was hoping to play an audio file from a specified folder. |
Because the game don't find random actors or cars in "Back o Beyond" to get spawn coords. You have to use another method change this parts: | CODE | if 00DF: actor $PLAYER_ACTOR driving 004D: jump_if_false @Spawn_3 0050: gosub @Spawn_searchCarsub_1//leads the readingprocess to a subscript //the readingprocess continues here with reading as soon as the return of the subscript is readed if 8039: NOT 1@ == -1 // checks if a radondom actor was found to get his coords 004D: jump_if_false @Spawn_1 0006: 1@ = -1 // integer values 0002: jump @Spawn_Actor1
:Spawn_3 0050: gosub @Spawn_searchPedsub_1//leads the readingprocess to a subscript //the readingprocess continues here with reading as soon as the return of the subscript is readed if 8039: NOT 1@ == -1 // checks if a radondom actor was found to get his coords 004D: jump_if_false @Spawn_1 01C2: remove_references_to_actor 1@ 0006: 1@ = -1 // integer values 0002: jump @Spawn_Actor1
:Spawn_Actor1 0247: request_model #WMOICE 0247: request_model #AK47
:Spawn_Actor3 0001: wait 0 ms 00D6: if and 0248: model #WMOICE available 0248: model #AK47 available 004D: jump_if_false @Spawn_Actor3
009A: 2@ = create_actor 24 #WMOICE at 25@ 26@ 27@ 0173: set_actor 2@ z_angle_to 0.0 01B2: give_actor 2@ weapon 30 ammo 99999 // Load the weapon model before using this 02E2: set_actor 2@ weapon_accuracy_to 100//decrease this value if you don't want to be killed 0223: set_actor 2@ health_to 1000 0946: set_actor 2@ actions_uninterupted_by_weapon_fire 1 060B: set_actor 2@ decision_maker_to 32 0187: 5@ = create_marker_above_actor 2@ 018B: set_marker 5@ radar_mode 2//set marker to mode 2 to show it only on radar 05E2: AS_actor 2@ kill_actor $PLAYER_ACTOR 0249: release_model #WMOICE |
into this: _PostMark| CODE | 097A: play_audio_at 0.0 0.0 0.0 event 1057 04C4: create_coordinate 25@ 26@ 27@ from_actor $PLAYER_ACTOR offset 10.0 4.0 0.2
:Spawn_Actor1 0247: request_model #WMOICE 0247: request_model #AK47
:Spawn_Actor3 0001: wait 0 ms 00D6: if and 0248: model #WMOICE available 0248: model #AK47 available 004D: jump_if_false @Spawn_Actor3
009A: 2@ = create_actor 24 #WMOICE at 25@ 26@ 27@ 0173: set_actor 2@ z_angle_to 0.0 01B2: give_actor 2@ weapon 30 ammo 99999 // Load the weapon model before using this 02E2: set_actor 2@ weapon_accuracy_to 100//decrease this value if you don't want to be killed 0223: set_actor 2@ health_to 1000 0946: set_actor 2@ actions_uninterupted_by_weapon_fire 1 060B: set_actor 2@ decision_maker_to 32 0187: 5@ = create_marker_above_actor 2@ 018B: set_marker 5@ radar_mode 2//set marker to mode 2 to show it only on radar
0249: release_model #WMOICE 0337: set_actor 2@ visibility 0 04C4: create_coordinate 24@ 25@ 26@ from_actor $PLAYER_ACTOR offset 0.3 0.7 0.0 068D: 16@ 17@ 18@//get_camera_position 0087: 18@ = 16@ // floating-point values only 0087: 19@ = 17@ // floating-point values only 0063: 18@ -= 24@ // floating-point values 0063: 19@ -= 25@ // floating-point values 0013: 18@ *= -0.5 // floating-point values 0013: 19@ *= -0.5 // floating-point values 005B: 16@ += 18@ // floating-point values 005B: 17@ += 19@ // floating-point values 05D3: AS_actor 2@ goto_point 16@ 17@ 26@ mode 7 500 ms // versionA wait 1000 0337: set_actor 2@ visibility 1 05E2: AS_actor 2@ kill_actor $PLAYER_ACTOR |
with this link http://www.gtaforums.com/index.php?showtop...54542#_PostMarkand with this http://www.gtaforums.com/index.php?act=ST&...54542#_PostMarkand this http://www.gtaforums.com/index.php?act=ST&...154542#PostMark This post has been edited by ZAZ on Tuesday, May 1 2012, 22:50
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
Michael.Knight1  |
|
Knight Rider

Group: BUSTED!
Joined: Dec 15, 2011


|
| QUOTE (SilentPL @ Sunday, Mar 18 2012, 15:41) | | QUOTE (Michael.Knight1 @ Sunday, Mar 18 2012, 16:13) | pleasse what is the Error here ?? |
You. |
You Start The War @SilentPL . . . You are dumb , stupid and also ugly . . . Does not take knowledge from the capital of the Stupid . you must not kidding . that really pissed me off man, you need to have more respect for people man, seriously, stop being such as dick about it and deal with it, learn to accept the word no, because im tired of asking you to please not use my stuff, i dont mind you using my stuff ok , you need to accept this, when someone says no it means no, dont try and argue about it ok, its just a video game, theres no reason to go all bitchy and asshole about it, sure im an ass about it too, but just because they are annoying assholes who wont listen like you are, so please try and be more respectful and maybe i might not have to be a asshole about everything, anyways im done talking about it, i still dont like you and that will not change ever, so please just credit us and drop it already, goodbye
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
Dumbass-Productions  |
|
Crazy Freak

Group: Members
Joined: Oct 17, 2010


|
| QUOTE (Michael.Knight1 @ Sunday, Mar 18 2012, 16:04) | | QUOTE (SilentPL @ Sunday, Mar 18 2012, 15:41) | | QUOTE (Michael.Knight1 @ Sunday, Mar 18 2012, 16:13) | pleasse what is the Error here ?? |
You. |
You Start The War @SilentPL . . . You are dumb , stupid and also ugly . . . Does not take knowledge from the capital of the Stupid . you must not kidding . that really pissed me off man, you need to have more respect for people man, seriously, stop being such as dick about it and deal with it, learn to accept the word no, because im tired of asking you to please not use my stuff, i dont mind you using my stuff ok , you need to accept this, when someone says no it means no, dont try and argue about it ok, its just a video game, theres no reason to go all bitchy and asshole about it, sure im an ass about it too, but just because they are annoying assholes who wont listen like you are, so please try and be more respectful and maybe i might not have to be a asshole about everything, anyways im done talking about it, i still dont like you and that will not change ever, so please just credit us and drop it already, goodbye | @SilentPL Hahaha nice one @Michael.Retard1 Why did he start the war? But even if he did, there's absolutely no need to offend him and write that he is dumb, stupid and ugly. First take a look at yourself, tough guy. You just come here, write your gibberish crap. From what I have seen, you are the troublemaker here. You write that SilentPL has no respect but again look at yourself. You are bitching around every time somebody does not understand your gibberish crap because of your crappy english skill. Instead of wasting your time with III Era Coding that you will never understand anyway, go and learn english. It's more important in life.
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
fastman92  |
|
фастман92 | ف

Group: Members
Joined: Jul 28, 2009


|
| QUOTE (ZAZ @ Friday, Jun 5 2009, 21:34) | read_memory
the cleo opcodes 0A8D: and 0A8C: to read the content of memory adresses at first we must know which adress have a function you can find a list at: gtamodding.com for exemple: 0x863984 - [Int32] Gravity
a simple GRAVITY script with text_draw opcodes to show the content of the adress:
| CODE | {$CLEO .cs} thread 'GRAVITY' wait 3000 :GRAVITY_1 0A8D: 1@ = read_memory 0x863984 size 4 virtual_protect 1 wait 100 03F0: text_draw_toggle 1 0001: wait 50 ms 03F0: text_draw_toggle 0 0001: wait 50 ms 045A: text_draw_1number 250.0 40.0 'NUMBER' 1@ 0A8C: write_memory 0x863984 size 4 value 2 virtual_protect 1 //clear the buffer 0A93: end_custom_thread |
at the end we pushes the value 2 into the memory adress test the script and look for result 2 seems to have the best effect but this adress is really crazy and if we push a float value the effect is different try
| CODE | | 0A8C: write_memory 0x863984 size 4 value 10.0 virtual_protect 1 //clear the buffer |
and you will see the trees deforming | It's actually float value, not Int32. By default GTA SA gravity is equal to 1/125 = 0.008 Why do you draw float value as it was integer then? It will look oddly. There are few ways to draw floats, i'll show you my functions: | CODE | :DrawFloatOnScreen { Description: Draws float on screen using TCFLT or TCFLTN GXT entry.
Parameters: Passed: 0@ - number (float) 1@ - accuracy 2@ - screen pos X 3@ - screen pos Y Result: none Example: 0AB1: call_scm_func @DrawFloatOnScreen 4 number 5@ accuracy 1 position 320.0 240.0 } 0AB1: call_scm_func @FloatPartsToIntegerValuesLengthSpecified 2 num 0@ after_comma_accuraccy 1 before_point_to 4@ after_point 5@ if 0@ < 0.0 then 045B: draw_text_2numbers 2@ 3@ GXT 'TCFLTN' numbers 4@ 5@ else 045B: draw_text_2numbers 2@ 3@ GXT 'TCFLT' numbers 4@ 5@ end 0AB2: ret 0
:FloatPartsToIntegerValuesLengthSpecified { Description: Converts a float part before and after point to integer values
Parameters: Passed: 0@ - number (float) 1@ - precision Result: 0@ - before point 1@ - after point Example: 0AB1: call_scm_func @FloatPartsToIntegerValuesLengthSpecified 2 num 1.0 after_comma_accuraccy 4 before_point_to 1@ after_point 2@ } 0097: make 0@ absolute_float 0092: 2@ = float 0@ to_integer
0093: 3@ = integer 2@ to_float 0063: 0@ -= 3@ // (float)
if 1@ > 0 then 4@ = 10.0 while 1@ > 1 4@ *= 10.0 1@ -= 1 end 006B: 0@ *= 4@ // (float) end
0092: 3@ = float 0@ to_integer 0093: 3@ = integer 3@ to_float 0087: 4@ = 0@ // (float) 0063: 4@ -= 3@ // (float)
0092: 0@ = float 0@ to_integer if 4@ > 0.0 then 0@ += 1 end
0AB2: ret 2 2@ 0@
|
, FloatPartsToIntegerValuesLengthSpecified gives you two parts of number as integer: before comma and after comma. You must specify the accuracy. DrawFloatOnScreen draws it on screen using GXT entries: | CODE | TCFLT ~r~~1~.~1~ TCFLTN ~r~-~1~.~1~ |
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:
Pages:
(31) « First ... 17 18 [19] 20 21 ... Last »
Track this topic
Receive email notification when a reply has been made to this topic and you are not active on the board.
Subscribe to this forum
Receive email notification when a new topic is posted in this forum and you are not active on the board.
Download / Print this Topic
Download this topic in different formats or view a printer friendly version.
| |
 |
|
 |
|
|
|
|