|
 |
|
|
|
|
|
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 ~
 |
|
 |
| |
ZAZ  |
|
Kernlochbohrer

Group: Members
Joined: Jan 10, 2005



|
| QUOTE (Michael-Knight1 @ Friday, Aug 24 2012, 15:06) | | QUOTE (ZAZ @ Friday, Aug 24 2012, 12:40) | | QUOTE (Michael-Knight1 @ Thursday, Aug 23 2012, 16:09) | Hi Zaz , I Need Help into my kitt prison break on main script . i don't knew why the game crashed when i get spawned from the jail ?? Here is the codes !
|
280 isn't a pedtype as i mentioned in earlier post
don't use the actors handle after removing their reference
| CODE | Actor.RemoveReferences($COPBUSTEDPED1_LS) Actor.RemoveReferences($COPBUSTEDPED2_LS) Car.RemoveReferences($COPBUSTEDCAR_LS) 05E2: AS_actor $COPBUSTEDPED1_LS kill_actor $PLAYER_ACTOR 05E2: AS_actor $COPBUSTEDPED2_LS kill_actor $PLAYER_ACTOR |
your script then don't crash, you will just get a black screen because you did a fade but didn't fade back |
every crashed ?? |
no, i didn't got any crash, i edited first big mistakes pedtype 280 is wrong, doesn't matter if it crash or not i didn't tested actors handle after removing their reference because it's wrong, wrong, wrong, wrong, wrong
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
Michael-Knight1  |
|
Never Give UP

Group: Members
Joined: Jul 8, 2012


|
| QUOTE (ZAZ @ Friday, Aug 24 2012, 14:54) | | QUOTE (Michael-Knight1 @ Friday, Aug 24 2012, 15:06) | | QUOTE (ZAZ @ Friday, Aug 24 2012, 12:40) | | QUOTE (Michael-Knight1 @ Thursday, Aug 23 2012, 16:09) | Hi Zaz , I Need Help into my kitt prison break on main script . i don't knew why the game crashed when i get spawned from the jail ?? Here is the codes !
|
280 isn't a pedtype as i mentioned in earlier post
don't use the actors handle after removing their reference
| CODE | Actor.RemoveReferences($COPBUSTEDPED1_LS) Actor.RemoveReferences($COPBUSTEDPED2_LS) Car.RemoveReferences($COPBUSTEDCAR_LS) 05E2: AS_actor $COPBUSTEDPED1_LS kill_actor $PLAYER_ACTOR 05E2: AS_actor $COPBUSTEDPED2_LS kill_actor $PLAYER_ACTOR |
your script then don't crash, you will just get a black screen because you did a fade but didn't fade back |
every crashed ?? |
no, i didn't got any crash, i edited first big mistakes
pedtype 280 is wrong, doesn't matter if it crash or not
i didn't tested actors handle after removing their reference because it's wrong, wrong, wrong, wrong, wrong | ok , i'll try a gain
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
ashwinsjaganaath  |
Posted: Wednesday, Oct 24 2012, 18:45
|
Learner

Group: Members
Joined: Oct 23, 2012


|
@Zaz and @SilentPL : Thanks for the quick response. Actually i was thinking of creating a small script whereby the player creates a series of explosion on punching. I succeeded in doing so, the player did create a series of explosions in front of him. But that seemed so dangerous cuz if u wanna punch normally without any explosions u wouldn't be able to. So i thought of making the script to execute on entering a cheat. Enter a cheat and this mode gets activated and enter it again to deactivate it. I created another script to do the same. I understood the usage of special cleo global variables(finally! phew) and i used it to link both the scripts. The idea was whenever the player punches the script checks for the value of a particular variable, which is defined by that another script which activates(variable value = 1) and deactivates (variable value = 0). So the script(the one that creates explosions) reads the variable value and it will proceed only if the variable value is 1 or else it will loop back to the first line and wait(forever) until the value becomes 1. THIS ACTUALLY WORKED IN GAME. But my doubt now is : i have used the opcode 0AB3: var 0 = 0, will this line affect any other scripts using var 0? if it does i know that i can use some other say var 2 or 3 or 146 or whatever to avoid the confusion. But lets say, if i share this mod with some others, i can't expect them to change their var # to be able to work this script, right? And i wouldn't know which var # is unused by everyone . And for the same reason, is it possible to use any base memories to make the script check whether the cheat is on or off? and here is how my script works and this is the way i want it to work without any confusions with that var 0 thing YouTube videohttp://www.youtube.com/watch?v=zYyl54ED8DUThanks a bunch P.s : Shall i also share the lines that i wrote in both of the above-mentioned scripts? This post has been edited by ashwinsjaganaath on Wednesday, Oct 24 2012, 18:51
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
ashwinsjaganaath  |
Posted: Wednesday, Oct 24 2012, 19:52
|
Learner

Group: Members
Joined: Oct 23, 2012


|
| QUOTE (SilentPL @ Wednesday, Oct 24 2012, 19:43) | | You made that sound really complex, but I'm pretty sure you can merge this into one script with ease. Mind showing us the codes? |
Oh for sure man here it is | CODE | //Buddha's palm
{$CLEO .cs}
//Start of thread thread 'Buddha'
:Buddha_0 wait 0 00D6: if 0256: player $PLAYER_CHAR defined jf @Buddha_0 00D6: if or 02D8: actor $PLAYER_ACTOR current_weapon == 0 02D8: actor $PLAYER_ACTOR current_weapon == 1 jf @Buddha_0 0AB4: 0@ = var 0 // - cleo 3 - 00D6: if and 00E1: player 0 pressed_key 17 0039: 0@ == 1 jf @Buddha_0
:Buddha_1 04C4: store_coords_to 1@ 2@ 3@ from_actor $PLAYER_ACTOR with_offset 0.0 2.0 0.2 04C4: store_coords_to 4@ 5@ 6@ from_actor $PLAYER_ACTOR with_offset 0.0 6.0 0.2 04C4: store_coords_to 7@ 8@ 9@ from_actor $PLAYER_ACTOR with_offset 0.0 10.0 0.2 04C4: store_coords_to 10@ 11@ 12@ from_actor $PLAYER_ACTOR with_offset 0.0 14.0 0.2 04C4: store_coords_to 13@ 14@ 15@ from_actor $PLAYER_ACTOR with_offset 0.0 18.0 0.2 02AB: set_actor $PLAYER_ACTOR immunities BP 1 FP 1 EP 1 CP 1 MP 1 020C: create_explosion_with_radius 5 at 1@ 2@ 3@ wait 200 ms 020C: create_explosion_with_radius 5 at 4@ 5@ 6@ wait 200 ms 020C: create_explosion_with_radius 5 at 7@ 8@ 9@ wait 200 ms 020C: create_explosion_with_radius 5 at 10@ 11@ 12@ wait 200 ms 020C: create_explosion_with_radius 5 at 13@ 14@ 15@ 02AB: set_actor $PLAYER_ACTOR immunities BP 0 FP 0 EP 0 CP 0 MP 0 wait 1000 ms jump @Buddha_0
|
This is the script that creates the explosion while he is punching and the script that activates the cheat is as follows | CODE | {$CLEO .cs}
//Cheat thread 'Buddha1'
:Buddha1_0 wait 0 00D6: if 0256: player $PLAYER_CHAR defined jf @Buddha1_0 0A8D: 1@ = read_memory 0x00969110 size 4 virtual_protect 0// - cleo 3 - 0A8D: 2@ = read_memory 0x00969114 size 2 virtual_protect 0// - cleo 3 - 00D6: if 04A4: 1@ == 0x44444841 04A4: 2@ == 0x4255 jf @Buddha1_0 03E5: show_text_box 'CHEAT1' 0A8C: write_memory 0x00969110 size 4 value 0 virtual_protect 0// - cleo 3 - 0A8C: write_memory 0x00969114 size 2 value 0 virtual_protect 0// - cleo 3 - 0AB3: var 0 = 1 jump @Buddha1_1
:Buddha1_1 wait 0 00D6: if 0256: player $PLAYER_CHAR defined jf @Buddha1_1 0A8D: 1@ = read_memory 0x00969110 size 4 virtual_protect 0// - cleo 3 - 0A8D: 2@ = read_memory 0x00969114 size 2 virtual_protect 0// - cleo 3 - 00D6: if 04A4: 1@ == 0x44444841 04A4: 2@ == 0x4255 jf @Buddha1_1 03E5: show_text_box 'CHEAT8' 0A8C: write_memory 0x00969110 size 4 value 0 virtual_protect 0// - cleo 3 - 0A8C: write_memory 0x00969114 size 2 value 0 virtual_protect 0// - cleo 3 - 0AB3: var 0 = 0 jump @Buddha1_0
|
And as u might've seen in the video, these are the scripts that got the explosions to work. My head is spinning around man, thinking of how to merge these without using var 0. No wonder i sounded complicated earlier, i'm not able to think straight. I'm sure u will have a simple clean solution to this. Anyway i'm not too bad for the first script i guess, am i? This post has been edited by ashwinsjaganaath on Wednesday, Oct 24 2012, 19:59
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
Pages:
(31) « First ... 22 23 [24] 25 26 ... 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.
| |
 |
|
 |
|
|
|
|