|
 |
|
|
|
|
|
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  |
Posted: Tuesday, Apr 30 2013, 15:19
|
Kernlochbohrer

Group: Members
Joined: Jan 10, 2005



|
| QUOTE (MRobinson @ Tuesday, Apr 30 2013, 13:02) | | 1. how to use ~k~~PED_FIREWEAPON~ in cleo coding? I want to use this as a IF KEY PRESSED. |
PED_FIREWEAPON is a gamefunction with keypress allocation in controler setup can you allocate a key for PED_FIREWEAPON ~k~~PED_FIREWEAPON~ is a "gxt-variable" to show the allocated Key instead ~k~~PED_FIREWEAPON~ To check if PED_FIREWEAPON was pressed needs to use opcode 00E1 and check for 17 | CODE | if 00E1: key_pressed 0 17//--------- PED_FIREWEAPON key jf @next |
Have a look now to Sannybuilder HELP >> GTA SA >> Keypress numbers script: | CODE | | 00BC: show_text_highpriority GXT 'GA_6' time 1000 flag 1 |
GXT: | CODE | | GA_6 Park it, prime it by pressing ~k~~PED_FIREWEAPON~ and LEG IT! |
it shows this text: | QUOTE | | "Park it, prime it by pressing LMB and LEG IT!" |
if LMB is set as PED_FIREWEAPON key | QUOTE | | 2. is there a key press code for LMB as for other keys? |
what are "other keys?" , you can do it as shown above if LMB is set as PED_FIREWEAPON key or use 0AB0 and check for 1 virtual keycode 1 = left mouse button | CODE | if 0AB0: key_pressed 1 // -- LMB jf @next |
| QUOTE | | 3. what does this code means? |
056D: actor 0@ defined opcode 056D is a condition to check if the variable contains a valid handle value of an actor(ped) which is availble in game at that moment can also be Player_actor This post has been edited by ZAZ on Tuesday, Apr 30 2013, 15:32
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
ZAZ  |
|
Kernlochbohrer

Group: Members
Joined: Jan 10, 2005



|
looks like Seemanns Polmav script after decompiling i advice to avoid using globals unless you need it indeed in another script | QUOTE | | tell me if they are not bullet proof |
they are immune_to_car_headshots, but i think it's enough if they are in a vehicle, unless motorbike your check if actor $COPPILT_1 is defined .... ....if he's not defenied, then the code jumps to COPSYST_100 what happens at COPSYST_100? My tip: I often use 03F0: and 045A: to display script values in your case i would add these codes to display the content of $COPPILT_1 | CODE | :COPSYST_13 0001: wait 0 ms 00D6: if 0256: player $PLAYER_CHAR defined 004D: jump_if_false @COPSYST_13 03F0: enable_text_draw 1 045A: draw_text_1number 100.0 160.0 GXT 'NUMBER' number $COPPILT_1 |
| QUOTE (MRobinson @ Friday, May 3 2013, 13:22) | you remember zaz .. that I faced a problem about "walkstyles" a long ago.. ? Thats not fixed yet. I want an actor to perform "Cop_move_FWD" from ifp "police" which is present in gta3.img. The animation should not stop in one loop and also not be upto infinity as I have to use opcode 07CD after that. That means I want the guy to stop at a point.. something like this:
| CODE | :START 00D6: if 0039: 28@ == 1 004D: jf @back 00A0: store_actor $PLAYER_ACTOR position_to 1@ 2@ 3@ xxxx: [B]want the actor 10@ to move with gun pointed in front but my game crashes on using opcode 0245 and nothing budges on using 0A1A[/B] 07CD: AS_actor 10@ walk_to 1@ 2@ 3@ stop_with_angle 0.0 within_radius 0.5 \\ I dont want the walkstyle to go on forever 00D6: if 09ED: actor 10@ is_within_field_of_view_actor $PLAYER_ACTOR 004D: jf @back 0792: disembark_instantly_actor $PLAYER_ACTOR 01F7: set_player $PLAYER_CHAR ignored_by_cops 1 |
|
Either let the actor walk/run by walkstyle or let him do animation both at same time isn't possible some animations are suitably for "walking" (walk animation) like "Cop_move_FWD" First about walk/run by walkstyle0792: is normaly the last chance to to clear the actors behavior but it don't removes the walkstyle overwrite the walkstyle with another one can fix that and then use 0792 before he should do an animation | CODE | {$CLEO .cs} :ActorWalk_1 03A4: name_thread 'WALKACT'
:ActorWalk_2 wait 0 00D6: if 0 0256: player $PLAYER_CHAR defined jf @ActorWalk_2 if 0AB0: key_pressed 8//--------------------------------- key Backspace jf @ActorWalk_2 0247: load_model #FBI 0247: load_model #M4 04ED: load_animation "GHANDS"
:ActorWalk_5 wait 0 if and 0248: model #FBI available 0248: model #M4 available 04EE: animation "GHANDS" loaded jf @ActorWalk_5
:ActorWalk_7 04C4: create_coordinate 1@ 2@ 3@ from_actor $PLAYER_ACTOR offset 4.0 4.0 0.2 009A: 10@ = create_actor_pedtype 24 model #FBI at 1@ 2@ 3@ 0249: release_model #fbi 00A0: store_actor $PLAYER_ACTOR position_to 1@ 2@ 3@ 05D3: AS_actor 10@ goto_point 1@ 2@ 3@ mode 4 999999 ms // versionA 0245: set_actor 10@ walk_style_to "Drunkman" 0@ = 0
:ActorWalk_13 wait 0 if 0256: player $PLAYER_CHAR defined jf @ActorWalk_57 if 8118: not actor 10@ dead jf @ActorWalk_57 if and 0@ == 0 00FE: actor 10@ sphere 0 in_sphere 1@ 2@ 3@ radius 1.5 1.5 1.5 jf @ActorWalk_13 0245: set_actor 10@ walk_style_to "Swat" 0792: disembark_instantly_actor 10@ 0812: actor 10@ perform_animation_sequence "gsign4LH" IFP_file "GHANDS" 4.0 0 1 1 0 -1 ms
0@ = 1 jump @ActorWalk_13
:ActorWalk_57 04EF: release_animation "GHANDS" 01C2: remove_references_to_actor 10@ jump @ActorWalk_2 |
| QUOTE | | I have 3ds max too, tell me if changing the walkcycles or adding a new walkcycle will work in this. |
yes, it will work. I made a zombimod with Beeswax, he made the zombies and the zombi walk animation to replace it with WALK_drunk then i let them walk by drunkman style like in script above Then about Cop_move_FWDYou need to set the actors angle permanetly while he do the animation and let the animation loop, parameter loopA must be 1 0812: actor 10@ perform_animation_sequence "Cop_move_FWD" IFP_file "POLICE" 4.0 loopA 1 lockX 1 lockY 1 lockF 0 time -1 ms | CODE | {$CLEO .cs} :ActorWalk_1 03A4: name_thread 'WALKACT'
:ActorWalk_2 wait 0 00D6: if 0 0256: player $PLAYER_CHAR defined jf @ActorWalk_2 if 0AB0: key_pressed 8//--------------------------------- key Backspace jf @ActorWalk_2 0247: load_model #FBI 0247: load_model #M4 04ED: load_animation "POLICE"
:ActorWalk_5 wait 0 if and 0248: model #FBI available 0248: model #M4 available 04EE: animation "POLICE" loaded jf @ActorWalk_5
:ActorWalk_7 04C4: create_coordinate 1@ 2@ 3@ from_actor $PLAYER_ACTOR offset 8.0 4.0 0.2 009A: 10@ = create_actor_pedtype 24 model #FBI at 1@ 2@ 3@ 0249: release_model #fbi 0@ = 0
:ActorWalk_13 wait 0 if 0256: player $PLAYER_CHAR defined jf @ActorWalk_57 if 8118: not actor 10@ dead jf @ActorWalk_57 if 0@ == 0 jf @ActorWalk_13 00A0: store_actor $PLAYER_ACTOR position_to 1@ 2@ 3@ 00A0: store_actor 10@ position_to 11@ 12@ 13@ 00A0: store_actor $PLAYER_ACTOR position_to 21@ 22@ 23@ 0063: 11@ -= 21@ // (float) 0063: 12@ -= 22@ // (float) 0604: get_Z_angle_for_point 11@ 12@ store_to 30@ 000B: 30@ += 180.0 0173: set_actor 10@ Z_angle_to 30@ 0812: actor 10@ perform_animation_sequence "Cop_move_FWD" IFP_file "POLICE" 4.0 loopA 1 lockX 1 lockY 1 lockF 0 time -1 ms if 00FE: actor 10@ sphere 0 in_sphere 1@ 2@ 3@ radius 1.5 1.5 1.5 jf @ActorWalk_13 0812: actor 10@ perform_animation_sequence "Door_Kick" IFP_file "POLICE" 4.0 0 1 1 0 -1 ms 0@ = 1 jump @ActorWalk_13
:ActorWalk_57 04EF: release_animation "POLICE" 01C2: remove_references_to_actor 10@ jump @ActorWalk_2 |
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
MRobinson  |
Posted: Saturday, May 4 2013, 10:19
|
Secret Agent

Group: Members
Joined: Jul 5, 2012


|
| QUOTE | i advice to avoid using globals unless you need it indeed in another script
|
being used in all my 3 scripts. | QUOTE | they are immune_to_car_headshots, but i think it's enough if they are in a vehicle, unless motorbike
|
Yea they die and that too very akwardly... they stick to the bottom of heli..  , that I will fix by stimulating helicopter crash opcode zaz. | QUOTE | your check if actor $COPPILT_1 is defined .... ....if he's not defenied, then the code jumps to COPSYST_100 what happens at COPSYST_100? |
the script checks further if the player is in view of cops and then the cops are to ignore the player if negative and the script continues and goes on.. the cops go to the last place but.. they walk like a cool headed noob.. so I decided to add some realism.. I also added weapon detection. if player fires the script loops back to ignored 0. My tip: I often use 03F0: and 045A: to display script values in your case i would add these codes to display the content of $COPPILT_1 | CODE | :COPSYST_13 0001: wait 0 ms 00D6: if 0256: player $PLAYER_CHAR defined 004D: jump_if_false @COPSYST_13 03F0: enable_text_draw 1 045A: draw_text_1number 100.0 160.0 GXT 'NUMBER' number $COPPILT_1
|
I didnt get ya.. what it is supposed to do here...? | QUOTE | Either let the actor walk/run by walkstyle or let him do animation both at same time isn't possible some animations are suitably for "walking" (walk animation) like "Cop_move_FWD"
First about walk/run by walkstyle 0792: is normaly the last chance to to clear the actors behavior but it don't removes the walkstyle overwrite the walkstyle with another one can fix that and then use 0792 before he should do an animation CODE {$CLEO .cs} :ActorWalk_1 03A4: name_thread 'WALKACT'
:ActorWalk_2 wait 0 00D6: if 0 0256: player $PLAYER_CHAR defined jf @ActorWalk_2 if 0AB0: key_pressed 8//--------------------------------- key Backspace jf @ActorWalk_2 0247: load_model #FBI 0247: load_model #M4 04ED: load_animation "GHANDS"
:ActorWalk_5 wait 0 if and 0248: model #FBI available 0248: model #M4 available 04EE: animation "GHANDS" loaded jf @ActorWalk_5
:ActorWalk_7 04C4: create_coordinate 1@ 2@ 3@ from_actor $PLAYER_ACTOR offset 4.0 4.0 0.2 009A: 10@ = create_actor_pedtype 24 model #FBI at 1@ 2@ 3@ 0249: release_model #fbi 00A0: store_actor $PLAYER_ACTOR position_to 1@ 2@ 3@ 05D3: AS_actor 10@ goto_point 1@ 2@ 3@ mode 4 999999 ms // versionA 0245: set_actor 10@ walk_style_to "Drunkman" 0@ = 0
:ActorWalk_13 wait 0 if 0256: player $PLAYER_CHAR defined jf @ActorWalk_57 if 8118: not actor 10@ dead jf @ActorWalk_57 if and 0@ == 0 00FE: actor 10@ sphere 0 in_sphere 1@ 2@ 3@ radius 1.5 1.5 1.5 jf @ActorWalk_13 0245: set_actor 10@ walk_style_to "Swat" 0792: disembark_instantly_actor 10@ 0812: actor 10@ perform_animation_sequence "gsign4LH" IFP_file "GHANDS" 4.0 0 1 1 0 -1 ms
0@ = 1 jump @ActorWalk_13
:ActorWalk_57 04EF: release_animation "GHANDS" 01C2: remove_references_to_actor 10@ jump @ActorWalk_2 QUOTE I have 3ds max too, tell me if changing the walkcycles or adding a new walkcycle will work in this. yes, it will work. I made a zombimod with Beeswax, he made the zombies and the zombi walk animation to replace it with WALK_drunk then i let them walk by drunkman style like in script above
Then about Cop_move_FWD You need to set the actors angle permanetly while he do the animation and let the animation loop, parameter loopA must be 1 0812: actor 10@ perform_animation_sequence "Cop_move_FWD" IFP_file "POLICE" 4.0 loopA 1 lockX 1 lockY 1 lockF 0 time -1 ms CODE {$CLEO .cs} :ActorWalk_1 03A4: name_thread 'WALKACT'
:ActorWalk_2 wait 0 00D6: if 0 0256: player $PLAYER_CHAR defined jf @ActorWalk_2 if 0AB0: key_pressed 8//--------------------------------- key Backspace jf @ActorWalk_2 0247: load_model #FBI 0247: load_model #M4 04ED: load_animation "POLICE"
:ActorWalk_5 wait 0 if and 0248: model #FBI available 0248: model #M4 available 04EE: animation "POLICE" loaded jf @ActorWalk_5
:ActorWalk_7 04C4: create_coordinate 1@ 2@ 3@ from_actor $PLAYER_ACTOR offset 8.0 4.0 0.2 009A: 10@ = create_actor_pedtype 24 model #FBI at 1@ 2@ 3@ 0249: release_model #fbi 0@ = 0
:ActorWalk_13 wait 0 if 0256: player $PLAYER_CHAR defined jf @ActorWalk_57 if 8118: not actor 10@ dead jf @ActorWalk_57 if 0@ == 0 jf @ActorWalk_13 00A0: store_actor $PLAYER_ACTOR position_to 1@ 2@ 3@ 00A0: store_actor 10@ position_to 11@ 12@ 13@ 00A0: store_actor $PLAYER_ACTOR position_to 21@ 22@ 23@ 0063: 11@ -= 21@ // (float) 0063: 12@ -= 22@ // (float) 0604: get_Z_angle_for_point 11@ 12@ store_to 30@ 000B: 30@ += 180.0 0173: set_actor 10@ Z_angle_to 30@ 0812: actor 10@ perform_animation_sequence "Cop_move_FWD" IFP_file "POLICE" 4.0 loopA 1 lockX 1 lockY 1 lockF 0 time -1 ms if 00FE: actor 10@ sphere 0 in_sphere 1@ 2@ 3@ radius 1.5 1.5 1.5 jf @ActorWalk_13 0812: actor 10@ perform_animation_sequence "Door_Kick" IFP_file "POLICE" 4.0 0 1 1 0 -1 ms 0@ = 1 jump @ActorWalk_13
:ActorWalk_57 04EF: release_animation "POLICE" 01C2: remove_references_to_actor 10@ jump @ActorWalk_2
|
You are really perfect in this zaz.. but I want the actor 10 to go to the last seen area of the player and not after the player... also I want him to stop in the last seen area.. going a little forward wont harm the script.. but if that damn cop follows cj wherever he goes that will be very... umm... strange and it will not look as if cj is hiding.. can u give me the script for cj moving to 1@ 2@ 3@ with the same walk method like u have shown above...? where 1@ 2@ 3@ is the player offset 0.0 0.0 0.0 ..? and the cop stopping and the place like if you have tried my script.. the player stopping at the place and looking here and there..? and can we work together zaz..  ?
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
3 User(s) are reading this topic (3 Guests and 0 Anonymous Users)
0 Members:
Pages:
(31) « First ... 29 30 [31]
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.
| |
 |
|
 |
|
|
|
|