Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. Red Dead Redemption 2

      1. Gameplay
      2. Missions
      3. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. Arena War
      2. After Hours
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Grand Theft Auto Series

    3. GTA Next

    4. GTA V

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

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

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

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

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

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

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. 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. 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. News

    2. Forum Support

    3. Site Suggestions

Sign in to follow this  
12jango

I've questions about CLEO!

Recommended Posts

noalcohol

How to attach a person on a car? colgate.gif It's like in Ryder's mission, he stand on his truck but don't fall. inlove.gifinlove.gif

 

Share this post


Link to post
Share on other sites
ZAZ

 

How to attach a person on a car? colgate.gif It's like in Ryder's mission, he stand on his truck but don't fall. inlove.gif  inlove.gif

 

06A7: put_actor [email protected] into_turret_on_car [email protected] at_car_offset 1.1 0.5 0.2 position 1 shooting_angle 360.0 360.0 with_weapon 38

 

last parameter is the weapon number, you need to load first the weapon model

Share this post


Link to post
Share on other sites
12jango
It's said that any vehicles can have a weapon such as minigun/missile. icon14.gif

How to do that? smile.gif

Thanks! icon14.gif

 

EDIT :

Oh, I forgot! lol.gif

This is about Panel,

 

 

{$CLEO .cs}thread '':Loadwait 0if and   Player.Defined($PLAYER_CHAR)jf @Spawn:Spawnwait 0if   0AB0:  key_pressed 8jf @Load08D4: [email protected] = create_panel_with_title 'Title' position 29.0 145.0 width 160.0 columns 1 interactive 1 background 1 alignment 0 08D6: set_panel [email protected] column 0 alignment 1 08DB: set_panel [email protected] column 0 header 'dummy' data 'T1' 'T2' 'dummy' 'dummy' 'dummy' 'dummy' 'dummy' 'dummy' 'dummy' 'dummy' 'dummy' 'dummy' 090E: set_panel [email protected] active_row 0 0512:  show_permanent_text_box 'tatta'repeatwait  0 msif 00E1:   player 0 pressed_key 15then08DA: remove_panel [email protected]: remove text boxjump @Spawnenduntil 00E1:   player 0 pressed_key 16end_thread

 

 

I tried to make the simplest one, there are a small panel box, with a title and also with 2 options. So far I only can make it always appear after pressing backspace and dissappear after pressing F. The problem is, I've no idea how to make the 2 options working, I wanna make them like this ; if I choose the first option it will start the first custom mission, then if I choose the second option, it will start the second custom mission.(Now if I choose one of them, the game will crash!)

Please help! icon14.gif

Anyone please? icon14.gif

Share this post


Link to post
Share on other sites
TheSiggi

 

 

repeat//---------------------wait  0 msif 00E1:   player 0 pressed_key 15then08DA: remove_panel [email protected]: remove text boxjump @Spawnenduntil 00E1:   player 0 pressed_key 16 //--------------end_thread//---------------

 

that loop is sort of brocken?!?!?

 

 

 

have a look at ZAZs weathermenue,

Its very easy to understand and its really good example and template or menues at all

(source: zazmahall.de)

 

 

// This file was decompiled using sascm.ini published by Seemann (http://sannybuilder.com/files/SASCM.rar) on 13.10.2007{$VERSION 3.1.0027}{$CLEO .cs}//-------------MAIN---------------03A4: name_thread 'WHELP' :WHELP_110001: wait 20 ms 00D6: if 0256:   player $PLAYER_CHAR defined 004D: jump_if_false @WHELP_11 00D6: if 03EE:   player $PLAYER_CHAR controllable 004D: jump_if_false @WHELP_11 00D6: if and80DF:   not actor $PLAYER_ACTOR driving 0AB0:   key_pressed 49 004D: jump_if_false @WHELP_11 00D6: if 0038:   $ONMISSION == 0 004D: jump_if_false @WHELP_11 00D6: if 0038:   $Active_Interior == 0 004D: jump_if_false @WHELP_11 0001: wait 1000 ms 0050: gosub @WHELP_819 0343: set_text_draw_linewidth 680.0 033E: set_draw_text_position 36.0 20.0 GXT 'TATTA'  // Use ~k~~GO_FORWARD~ and ~k~~GO_BACK~ to select an area.~N~~k~~PED_SPRINT~ Select~N~~k~~VEHICLE_ENTER_EXIT~ Quit01B4: set_player $PLAYER_CHAR can_move 0 03BF: set_player $PLAYER_CHAR ignored_by_everyone 1 0826: enable_hud 0 03BF: set_player $PLAYER_CHAR ignored_by_everyone 1 08D4: $WETTER5 = create_panel_with_title 'CHEAT7' position 340.0 120.0 width 240.0 columns 1 interactive 1 background 1 alignment 0  // Weather cheat08DB: set_panel $WETTER5 column 0 header 'PLA_19' data 'DEBW1' 'DEBW4' 'DEBW5' 'DEBW8' 'DEBW9' 'DEBW10' 'DEBW12' 'DEBW14' 'DEBW16' 'DEBW17' 'DEBW18' 'WEATH0'  // SELECT // SUNNY LA // CLOUDY LA // SUNNY SF // RAINY SF // FOGGY SF // SUNNY VEGAS // CLOUDY VEGAS // SUNNY COUNTRYSIDE // RAINY COUNTRYSIDE // EXTRA SUNNY DESERT // SANDSTORN DESERT // WEATHER NORMAL090E: set_panel $WETTER5 active_row 0 :WHELP_3360001: wait 0 ms 00D6: if 0256:   player $PLAYER_CHAR defined 004D: jump_if_false @WHELP_760 00D6: if 00E1:   player 0 pressed_key 15 004D: jump_if_false @WHELP_380 0002: jump @WHELP_760 :WHELP_38000D6: if 00E1:   player 0 pressed_key 16 004D: jump_if_false @WHELP_336 03E6: remove_text_box 08D7: $WGO5 = panel $WETTER5 active_row 0008: $WGO5 += 1 00D6: if 0038:   $WGO5 == 1 004D: jump_if_false @WHELP_443 01B6: set_weather 1 0002: jump @WHELP_336 :WHELP_44300D6: if 0038:   $WGO5 == 2 004D: jump_if_false @WHELP_472 01B6: set_weather 4 0002: jump @WHELP_336 :WHELP_47200D6: if 0038:   $WGO5 == 3 004D: jump_if_false @WHELP_501 01B6: set_weather 5 0002: jump @WHELP_336 :WHELP_50100D6: if 0038:   $WGO5 == 4 004D: jump_if_false @WHELP_530 01B6: set_weather 8 0002: jump @WHELP_336 :WHELP_53000D6: if 0038:   $WGO5 == 5 004D: jump_if_false @WHELP_559 01B6: set_weather 9 0002: jump @WHELP_336 :WHELP_55900D6: if 0038:   $WGO5 == 6 004D: jump_if_false @WHELP_588 01B6: set_weather 10 0002: jump @WHELP_336 :WHELP_58800D6: if 0038:   $WGO5 == 7 004D: jump_if_false @WHELP_617 01B6: set_weather 12 0002: jump @WHELP_336 :WHELP_61700D6: if 0038:   $WGO5 == 8 004D: jump_if_false @WHELP_646 01B6: set_weather 14 0002: jump @WHELP_336 :WHELP_64600D6: if 0038:   $WGO5 == 9 004D: jump_if_false @WHELP_675 01B6: set_weather 16 0002: jump @WHELP_336 :WHELP_67500D6: if 0038:   $WGO5 == 10 004D: jump_if_false @WHELP_704 01B6: set_weather 17 0002: jump @WHELP_336 :WHELP_70400D6: if 0038:   $WGO5 == 11 004D: jump_if_false @WHELP_733 01B6: set_weather 19 0002: jump @WHELP_336 :WHELP_73300D6: if 0038:   $WGO5 == 12 004D: jump_if_false @WHELP_336 01B7: release_weather 0002: jump @WHELP_760 :WHELP_76008DA: remove_panel $WETTER5 0826: enable_hud 1 03BF: set_player $PLAYER_CHAR ignored_by_everyone 0 01B4: set_player $PLAYER_CHAR can_move 1 03F0: enable_text_draw 0 0002: jump @WHELP_11 08DA: remove_panel $WETTER5 01B4: set_player $PLAYER_CHAR can_move 1 03BF: set_player $PLAYER_CHAR ignored_by_everyone 0 03F0: enable_text_draw 0 0051: return :WHELP_8190340: set_text_draw_RGBA 180 180 180 255 033F: set_text_draw_letter_size 0.5 2.5 03E4: enable_text_draw_align_right 0 0341: unknown_text_draw_flag 0 0342: enable_text_draw_centered 0 0343: set_text_draw_linewidth 200.0 0348: enable_text_draw_proportional 1 0345: enable_text_draw_background 0 0051: return 

 

 

I'll search for my source codes of the weapon menu mod which have clearly label names

Edited by The_Siggi

Share this post


Link to post
Share on other sites
12jango

 

0819: [email protected] = actor $PLAYER_ACTOR distance_from_ground

 

How to use this? For what?

Share this post


Link to post
Share on other sites
ZAZ

 

0819: [email protected] = actor $PLAYER_ACTOR distance_from_ground

 

How to use this? For what?

in the math coding part of my tut you'll find this example script:

 

{$CLEO .cs}:ValueCheck_103A4: name_thread "VCHECK"[email protected] = 0:ValueCheck_20001: wait 0 msif0256: player $PLAYER_CHAR defined004D: jump_if_false @ValueCheck_2077E: get_active_interior_to [email protected]: enable_text_draw 1045A: text_draw_1number  250.0  40.0 'NUMBER' [email protected]: text_draw_1number  250.0  50.0 'NUMBER' [email protected]:   [email protected] ==  0004D: jump_if_false @ValueCheck_30819: [email protected] = actor $PLAYER_ACTOR distance_from_ground0092: [email protected] = float [email protected] to_integer03F0: enable_text_draw 1045A: text_draw_1number  250.0  60.0 'NUMBER' [email protected]:   25.0 > [email protected]: jump_if_false @ValueCheck_300A1: put_actor $PLAYER_ACTOR at 0.0 0.0 500.0:[email protected] > 50000jf @ValueCheck_200BA: text_styled 'FEM_OK'  1000 ms  [email protected] = 0jump @ValueCheck_2

 

Share this post


Link to post
Share on other sites
12jango

Hey, is that possible to store coords when you aiming on something? I mean you aim on a wall then you'll get the coordinate of the wall. Please show me the example script for that. dozingoff.gif

Thanks! icon14.gif

 

EDIT:

Ow, I forgot about this. How to maintain the number of peds that walking in the city?

Thank you! icon14.gif

 

Edited by 12jango

Share this post


Link to post
Share on other sites
12jango

Never mind, then... dontgetit.gif

Is there any opcodes that checks whether an actor seeing another actor? icon14.gif

Thank you! icon14.gificon14.gif

Share this post


Link to post
Share on other sites
BnB
Hey, is that possible to store coords when you aiming on something? I mean you aim on a wall then you'll get the coordinate of the wall. Please show me the example script for that. dozingoff.gif

Thanks! icon14.gif

 

EDIT:

Ow, I forgot about this. How to maintain the number of peds that walking in the city?

Thank you! icon14.gif

There is a way but you have to search...

OR create the code on your own.

Share this post


Link to post
Share on other sites
12jango

How to change actor's angle to a coordinate, like store the coordinates then the actor's angle turn into that coordinates... blush.gif

 

Share this post


Link to post
Share on other sites
Silent

Untested, but it should work more accurate. Based on ZAZs algorithm, and done as SCM func due to high var usage.

 

GPS Mod source ftw.

 

 

0AB1: call_scm_func @CalculateAngle 4 get_angle_from [email protected] [email protected] facing_to [email protected] [email protected] store_to [email protected]

 

 

 

:CalculateAngle0087: [email protected] = [email protected] // (float)0087: [email protected] = [email protected] // (float)   0063: [email protected] -= [email protected] // (float) 0063: [email protected] -= [email protected] // (float) 005B: [email protected] += [email protected] // (float) 005B: [email protected] += [email protected] // (float) 0063: [email protected] -= [email protected] // (float) 0063: [email protected] -= [email protected] // (float) 0604: get_Z_angle_for_point [email protected] [email protected] store_to [email protected] 000F: [email protected] -= 180.00656: get_angle [email protected] absolute_degrees_to [email protected] 0AB2: ret 1 [email protected]

 

 

If you want to make CJ face 0.0 0.0 0.0, then in code...

 

 

00A0: store_actor $PLAYER_ACTOR position_to [email protected] [email protected] [email protected]: call_scm_func @CalculateAngle 4 get_angle_from [email protected] [email protected] facing_to 0.0 0.0 store_to [email protected]: set_actor $PLAYER_ACTOR Z_angle_to [email protected]

 

Share this post


Link to post
Share on other sites
12jango

Thanks for the tricks! cookie.gifcookie.gif

 

Edited by 12jango

Share this post


Link to post
Share on other sites
fireguy109

 

Sorry for bump and topic steal blush.gif , but I diddn't want to make a new topic for this. What opcode/entry do you need to make a car spawn in a certain color? Not a one-time deal, I'm talking about the car always being there. I'd probably need to do this in the main.scm file, but does anyone know? Drakic figured it out for one of his mods once, but I don't know how. Never mind, I read a tutorial and figured it out. blush.gif

Edited by fireguy109

Share this post


Link to post
Share on other sites
Wesser

SilentPL, should it be just these couple of code lines?

 

00A0: store_actor $PLAYER_ACTOR position_to [email protected] [email protected] [email protected] 0AB1: call_scm_func @getAngleBetweenPoints 4 from_XY [email protected] [email protected] and_XY 0.0 0.0 store_to [email protected] 0173: set_actor $PLAYER_ACTOR Z_angle_to [email protected] [...]:getAngleBetweenPoints{ Parameters:   Passed:     [email protected] - 1st point X     [email protected] - 1st point Y     [email protected] - 2nd point X     [email protected] - 2nd point Y   Result:     [email protected] - absolute angle Example:   0AB1: call_scm_func @getAngleBetweenPoints 4 from_XY 0.0 0.0 and_XY 1.0 0.0 store_to [email protected] }0063: [email protected] -= [email protected] 0063: [email protected] -= [email protected] 0604: get_Z_angle_for_point [email protected] [email protected] store_to [email protected] 0AB2: ret 1 [email protected] 

 

Share this post


Link to post
Share on other sites
Silent

ZAZ wrote this, so I don't know, sorry. I didn't try to these math by myself.

However, ZAZ said that 0604 gets angle for 0.0 0.0. So we have to 'move' desired facing point and current actor's pos to 0.0 0.0 0.0, with keeping proportions.

Share this post


Link to post
Share on other sites
Wesser

Yeah, so if we pass the offsets between 2 points, we'll let that opcode calculating the angle with coords just like they are from 0.0 0.0 0.0. colgate.gif

 

It works more accurate then ZAZ's algoritm, though. wink.gif

Share this post


Link to post
Share on other sites
ZAZ

 

Yeah, so if we pass the offsets between 2 points, we'll let that opcode calculating the angle with coords just like they are from 0.0 0.0 0.0. colgate.gif

 

It works more accurate then ZAZ's algoritm, though. wink.gif

Right, well done in the Laser sight script

 

Share this post


Link to post
Share on other sites
12jango

Hey, I got some questions :

 

* When catch an actor, how to check whether he is an enemy or not?

 

* How to make an actor to keep attacking the player even if I removerefferences him?

 

Thanks! icon14.gif

Share this post


Link to post
Share on other sites
BnB
* When catch an actor, how to check whether he is an enemy or not?

 

* How to make an actor to keep attacking the player even if I removerefferences him?

 

 

PedType.

Share this post


Link to post
Share on other sites
12jango

I got some questions ;

 

1. I knew how to create a car that would be appeared on the road, but still I couldn't face the car to the right angle as the other car have. How to do that? So I won't have my car crashing other car....

 

 

-----------------------------------------------------------------------------------------------------------                                                                                      O ===>  <=== A [sometimes, it facing this way]                                                                                           ====================================================================================================                                                                                 [sometimes, it facing this way]  A ===>   <===  O                           -----------------------------------------------------------------------------------------------------------The Opcodes I use______________________________________________________________________________________________04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset -100.0 300.0 0.0 02C1: store_to [email protected] [email protected] [email protected] car_path_coords_closest_to [email protected] [email protected] [email protected]: [email protected] = create_car #INFERNUS at [email protected] [email protected] [email protected]______________________________________________________________________________________________A        = INFERNUS (The car I create)O        = Car===> = The car head this way<=== = The car head this way

 

 

 

2.

0792: disembark_instantly_actor $PLAYER_ACTOR

 

What's this opcode use for?

 

 

3. When I tried a script, like this :

 

 

04C4: store_coords_to [email protected] [email protected] [email protected] from_actor [email protected] with_offset 0.0 5.0 -1.0:Player_Movewait 005D3: AS_actor $PLAYER_ACTOR goto_point [email protected] [email protected] [email protected] mode 6 3000 ms // versionA if       00FF:   actor $PLAYER_ACTOR sphere 0 in_sphere [email protected] [email protected] [email protected] radius 1.0 1.0 1.0 on_foot jf @Player_Move0187: [email protected] = create_marker_above_actor $PLAYER_ACTORend_thread 

 

 

This script supposed to make the player, to go the the coordinates, but sometimes (maybe often) the player only running around the coordinates again and again. This is just an example, I really need help about how to make sure an actor to go and stand on the desired coordinates no matter what happens. blush.gif (Of course without using Actor.Putat($PLAYER_ACTOR, [email protected], [email protected], [email protected])

Edited by 12jango

Share this post


Link to post
Share on other sites
ZAZ

 

I got some questions ;

 

1. but still I couldn't face the car to the right angle as the other car have. How to do that? So I won't have my car crashing other car....

and what are you doing with z_angle opcode?

 

0175: set_car [email protected] Z_angle_to 0.0

 

let me define your cars as [email protected] and [email protected]

 

[email protected] = A = INFERNUS (The car I create)

[email protected] = O = Car

 

// cars have same angle0175: set_car [email protected] Z_angle_to 0.00175: set_car [email protected] Z_angle_to 0.0

 

 

// [email protected] becomes same angle like [email protected]: [email protected] = car [email protected] Z_angle0175: set_car [email protected] Z_angle_to [email protected]

 

 

// cars are standing against each other0174: [email protected] = car [email protected] [email protected] += 180.00175: set_car [email protected] Z_angle_to [email protected]

 

 

 

 

 

2.
0792: disembark_instantly_actor $PLAYER_ACTOR

 

    What's this opcode use for?

it frees the actor from everything, removes from car imediately, make him normal if he is caught in an animation or if have the [email protected] command

i believe it removes also from turret mode but can't remember exatly and in addition is there an opcode to remove actor from turret mode

 

 

 

3. When I tried a script, like this :

 

 

04C4: store_coords_to [email protected] [email protected] [email protected] from_actor [email protected] with_offset 0.0 5.0 -1.0:Player_Movewait 005D3: AS_actor $PLAYER_ACTOR goto_point [email protected] [email protected] [email protected] mode 6 3000 ms // versionA if       00FF:   actor $PLAYER_ACTOR sphere 0 in_sphere [email protected] [email protected] [email protected] radius 1.0 1.0 1.0 on_foot jf @Player_Move0187: [email protected] = create_marker_above_actor $PLAYER_ACTORend_thread 

 

 

This script supposed to make the player, to go the the coordinates, but sometimes (maybe often) the player only running around the coordinates again and again. This is just an example, I really need help about how to make sure an actor to go and stand on the desired coordinates no matter what happens. blush.gif  (Of course without using Actor.Putat($PLAYER_ACTOR, [email protected], [email protected], [email protected])

don't let the opcode 05D3: run in a loop and the z-offset of 04C4: is not good, better is with_offset 0.0 5.0 0.0

 

Share this post


Link to post
Share on other sites
12jango

@ZAZ : I thank you for your help with the get actor using call_scm_function, it really cool! icon14.gif

But anyway, that one only could catch 1 actor. Do you have any idea how to catch multiple actors? (Note: Of course I knew there's one opcode that can do that, but only affects pedestrians, not custom actors)

 

Is there also the way to catch car and object (also custom cars & objects)? Please tell me.

 

By the way, I've succed to show an txd texture on the screen, it appears pemanently and I can't remove it! turn.gif

How to remove it?

 

Thanks! icon14.gif

Edited by 12jango

Share this post


Link to post
Share on other sites
ZAZ

 

@ZAZ : I thank you for your help with the get actor using call_scm_function, it really cool! icon14.gif

But anyway, that one only could catch 1 actor. Do you have any idea how to catch multiple actors? (Note: Of course I knew there's one opcode that can do that, but only affects pedestrians, not custom actors)

It needs to shift the actor handles into arrays

This means that every actor reserves a local var

you can then handle max 28 actors because the the loacals in a cs file are limited to 32

now you wanna see that an actor is catched

try the script below it shows colored smoke above the actor

the script refreshes allways the actor catching because new peds appear and other peds disappear

 

{$CLEO .cs}:RandomActor_RAFSTEP103A4: name_thread 'RAFSTEP' :RAFSTEP_110001: wait 0 ms 00D6: if 0256:   player $PLAYER_CHAR defined 004D: jump_if_false @[email protected] = -1 [email protected] = -1 [email protected] = -1 [email protected] = -1 [email protected] = -1 [email protected] = -1 [email protected] = -1 [email protected] = -1 [email protected] = -1 [email protected] = -1 [email protected] = -1 [email protected] = -1 [email protected] = [email protected] = -1 [email protected] = -1 [email protected] = -1 [email protected] = -1 [email protected] = -1 [email protected] = -1 [email protected] = -1 [email protected] = -1 [email protected] = -1 [email protected] = -1 [email protected] = -1 [email protected] = -10050: gosub @RAFSTEP_175 0001: wait 0 ms 0050: gosub @RAFSTEP_336 :RAFSTEP_12//0A93: end_custom_thread 0002: jump @RAFSTEP_11 :RAFSTEP_1750006: [email protected] = 0 0006: [email protected] = 0 :RAFSTEP_1890085: [email protected] = [email protected] // (int) 0006: [email protected] = 0 :RAFSTEP_20400D6: if and056D:   actor [email protected] defined 803C:   not  $PLAYER_ACTOR == [email protected] // (int) 004D: jump_if_false @RAFSTEP_270 0085: [email protected]([email protected],32i) = [email protected] // (int)04C4: create_coordinate [email protected] [email protected] [email protected] from_actor [email protected] offset 0.0 0.0  1.2095C: create_smoke_at [email protected] [email protected] [email protected] velocity 0.0 0.0 1.0 RGBA 1.0 0.0  0.0  1.0 size 0.5 last_factor 0.1//red 095C: create_smoke_at [email protected] [email protected] [email protected] velocity 0.0 0.0 3.0 RGBA 1.0 0.0  0.0  1.0 size 0.5 last_factor 0.1//red 095C: create_smoke_at [email protected] [email protected] [email protected] velocity 0.0 0.0 5.0 RGBA 1.0 0.0  0.0  1.0 size 0.5 last_factor 0.1//red 000A: [email protected] += 1 0002: jump @RAFSTEP_298 :RAFSTEP_270000A: [email protected] += 1 000A: [email protected] += 1 0019:   [email protected] > 127 004D: jump_if_false @RAFSTEP_204 :RAFSTEP_298000A: [email protected] += 256 00D6: if or0019:   [email protected] > 24 0019:   [email protected] > 35584 004D: jump_if_false @RAFSTEP_189 0051: return :RAFSTEP_3360006: [email protected] = 0 :RAFSTEP_3430001: wait 0 ms 00D6: if 001B:   25 > [email protected] 004D: jump_if_false @RAFSTEP_397if   not [email protected]([email protected],32i) == -1 jf @RAFSTEP_345  01C2: remove_references_to_actor [email protected]([email protected],32i) // Like turning an actor into a random pedestrian :RAFSTEP_345000A: [email protected] += 1 0002: jump @RAFSTEP_343 :RAFSTEP_3970051: return

 

 

 

Is there also the way to  catch car and object (also custom cars & objects)? Please tell me.

objects? no, cleo4 supports such an opcode but it works not good

 

there are several get_random_car opcodes or use the methode from above and check if a actor is driving and get the car handle of the actor

the game becomes unstablety the more random cars the script catches as well as using some codes to the random car cause crashes

 

 

By the way, I've succed to show an txd texture on the screen, it  appears pemanently and I can't remove it! turn.gif

How to remove it?

post your script

Share this post


Link to post
Share on other sites
12jango

 

{$CLEO .cs}thread 'txd':Loadwait 00390: load_txd_dictionary 'LD_BEAT' 038F: load_texture "DOWN" as 1 // Load dictionary with 0390 first 03F0: enable_text_draw 1 :Spawnwait 0if   Player.Defined($PLAYER_CHAR)jf @Load038D: draw_texture 1 position 500.0 203.0 size 50.0 50.0 RGBA 128 128 128 255 end_thread

 

 

Here, I forgot about how was I made it. But it looks like this, I'm pretty sure... blush.gif

 

For last, I wondering whether we have to removerefferences everything that we get (actor, car, etc) after using them? dozingoff.gif

(Well, I tried to not to release an actor after I get him, so after I use him I just let him be. blush.gif And if I want to get another actor again, I still can do it. icon14.gif

Edited by 12jango

Share this post


Link to post
Share on other sites
12jango
@ZAZ : I thank you for your help with the get actor using call_scm_function, it really cool! icon14.gif

But anyway, that one only could catch 1 actor. Do you have any idea how to catch multiple actors? (Note: Of course I knew there's one opcode that can do that, but only affects pedestrians, not custom actors)

It needs to shift the actor handles into arrays

This means that every actor reserves a local var

you can then handle max 28 actors because the the loacals in a cs file are limited to 32

now you wanna see that an actor is catched

try the script below it shows colored smoke above the actor

the script refreshes allways the actor catching because new peds appear and other peds disappear

 

{$CLEO .cs}:RandomActor_RAFSTEP103A4: name_thread 'RAFSTEP' :RAFSTEP_110001: wait 0 ms 00D6: if 0256:   player $PLAYER_CHAR defined 004D: jump_if_false @[email protected] = -1 [email protected] = -1 [email protected] = -1 [email protected] = -1 [email protected] = -1 [email protected] = -1 [email protected] = -1 [email protected] = -1 [email protected] = -1 [email protected] = -1 [email protected] = -1 [email protected] = -1 [email protected] = [email protected] = -1 [email protected] = -1 [email protected] = -1 [email protected] = -1 [email protected] = -1 [email protected] = -1 [email protected] = -1 [email protected] = -1 [email protected] = -1 [email protected] = -1 [email protected] = -1 [email protected] = -10050: gosub @RAFSTEP_175 0001: wait 0 ms 0050: gosub @RAFSTEP_336 :RAFSTEP_12//0A93: end_custom_thread 0002: jump @RAFSTEP_11 :RAFSTEP_1750006: [email protected] = 0 0006: [email protected] = 0 :RAFSTEP_1890085: [email protected] = [email protected] // (int) 0006: [email protected] = 0 :RAFSTEP_20400D6: if and056D:   actor [email protected] defined 803C:   not  $PLAYER_ACTOR == [email protected] // (int) 004D: jump_if_false @RAFSTEP_270 0085: [email protected]([email protected],32i) = [email protected] // (int)04C4: create_coordinate [email protected] [email protected] [email protected] from_actor [email protected] offset 0.0 0.0  1.2095C: create_smoke_at [email protected] [email protected] [email protected] velocity 0.0 0.0 1.0 RGBA 1.0 0.0  0.0  1.0 size 0.5 last_factor 0.1//red 095C: create_smoke_at [email protected] [email protected] [email protected] velocity 0.0 0.0 3.0 RGBA 1.0 0.0  0.0  1.0 size 0.5 last_factor 0.1//red 095C: create_smoke_at [email protected] [email protected] [email protected] velocity 0.0 0.0 5.0 RGBA 1.0 0.0  0.0  1.0 size 0.5 last_factor 0.1//red 000A: [email protected] += 1 0002: jump @RAFSTEP_298 :RAFSTEP_270000A: [email protected] += 1 000A: [email protected] += 1 0019:   [email protected] > 127 004D: jump_if_false @RAFSTEP_204 :RAFSTEP_298000A: [email protected] += 256 00D6: if or0019:   [email protected] > 24 0019:   [email protected] > 35584 004D: jump_if_false @RAFSTEP_189 0051: return :RAFSTEP_3360006: [email protected] = 0 :RAFSTEP_3430001: wait 0 ms 00D6: if 001B:   25 > [email protected] 004D: jump_if_false @RAFSTEP_397if   not [email protected]([email protected],32i) == -1 jf @RAFSTEP_345  01C2: remove_references_to_actor [email protected]([email protected],32i) // Like turning an actor into a random pedestrian :RAFSTEP_345000A: [email protected] += 1 0002: jump @RAFSTEP_343 :RAFSTEP_3970051: return

 

 

 

Is there also the way to  catch car and object (also custom cars & objects)? Please tell me.

objects? no, cleo4 supports such an opcode but it works not good

 

there are several get_random_car opcodes or use the methode from above and check if a actor is driving and get the car handle of the actor

the game becomes unstablety the more random cars the script catches as well as using some codes to the random car cause crashes

 

 

By the way, I've succed to show an txd texture on the screen, it  appears pemanently and I can't remove it! turn.gif

How to remove it?

post your script

It works! icon14.gificon14.gif

But, how do I manage the radius? This one is too large. whatsthat.gif

 

Share this post


Link to post
Share on other sites
ZAZ

There isn't any radius defined

there's just a limit for the amount of peds to keep in the script while they are not dead

the script catches 25 different peds for a moment to read their coords and then it removes the reference of all

then it do the same again

Share this post


Link to post
Share on other sites
12jango

very well then, thanks. icon14.gif

@Deji : Remember GangRecruitmentSystem mod? It's so simple, but very well made! icon14.gif

I'm questioning about how do you made an texture to keeps following one's head? cool.gif

Thanks! icon14.gificon14.gif

 

Still about creating coordinates using camera view (man, I'm stuck with this one turn.gif ) :

 

 

[email protected] = 4.000A0: store_actor $PLAYER_ACTOR position_to [email protected] [email protected] [email protected] true  wait 0  0AC7: [email protected] = var [email protected] offset  0AC7: [email protected] = var [email protected] offset  0AA6: call_method 0x514970 0xB6F028 num_params 6 pop 0 [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]    if 0  06BD:   no_obstacles_between [email protected] [email protected] [email protected] and [email protected] [email protected] [email protected] solid 1 car 1 actor 1 object 1 particle 0  then      inc([email protected],3.0)  gosub @GET  else      break  endend

 

 

As far as I know this one is the most understandable (for me) but, still this one's not enough! devil.gif

This one makes very short distance, 'cause when I tried to GET an actor (see that gosub part)

using this script, I had to move very closely to an actor, then move the camera to his place. dontgetit.gif

If you have a better script or if you can edit this one, please do.

Thank you! icon14.gif

Share this post


Link to post
Share on other sites
Wesser

I've already gave you the answer here. Coordinates have to be taken from the camera, so you'll loop through obstacles from where the camera is pointing to.

 

Your script has some mistakes which should be solved in this way:

 

[email protected] = 5.0 00A0: store_actor $PLAYER_ACTOR position_to [email protected] [email protected] [email protected] while true wait 0  0AC7: [email protected] = var [email protected] offset 0AC7: [email protected] = var [email protected] offset 0AA6: call_method 0x514970 struct 0xB6F028 num_params 6 pop 0 pPoint [email protected] pCamera [email protected] fOriginZ [email protected] fOriginY [email protected] fOriginX [email protected] fRange [email protected]  if  06BD:  no_obstacles_between [email protected] [email protected] [email protected] and [email protected] [email protected] [email protected] solid 1 car 1 actor 1 object 1 particle 0  then   inc([email protected], 2.5)   gosub @GET  else   break endend

 

You can also use a more powerful but complex way as shown here.

Share this post


Link to post
Share on other sites
12jango

Hey, how do I place 2 watches in both hands (I tried to change) the bodyparts number but it crashes....

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
Sign in to follow this  

  • 1 User Currently Viewing
    0 Members, 0 Anonymous, 1 Guest

×

Important Information

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