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

12jango

Also how to make an object to move/throw to a desired coordinates (not using the move_object opcodes)? It's like throwing an object to a person. smile.gif (I would like to use it for knife throwing)

 

Thanks! icon14.gif

Edited by 12jango

Share this post


Link to post
Share on other sites
12jango

I tried to make a simple script that will make player to go (fly) to the desired coordinates, at the first try is like this :

 

 

{$CLEO .cs}thread 'blank':Storewait 0if andPlayer.Defined(PLAYER_CHAR)00E1 : player 0 pressed_key 6jf @Store store coordinates from player actor to [email protected] [email protected] [email protected] with offset 0.0 0.0 0.0store coordinates from player actor to [email protected] [email protected] [email protected] with offset 0.0 10.0 [email protected] -= [email protected]@ -= [email protected]@ -= [email protected]:Loop_Tillwait 0set_actor $PLAYER_ACTOR velocity_in_direction_XYZ [email protected] [email protected] [email protected]: actor $PLAYER_ACTOR sphere 0 in_sphere 658.0068 -1866.313 4.4537 radius 15.0 15.0 15.0jf @Loop_Till04D7 : set_actor $PLAYER_ACTOR locked 1 end_thread 

 

 

It makes the screen goes yellow then end up with crash! icon14.gif

I hope you got some ideas about how to make the player/actor enable to go to desired location perfectly (if you're gonna tell me to use Actor.Putat opcodes I will humbly disagree)

 

Thanks! icon14.gificon14.gif

 

Share this post


Link to post
Share on other sites
fireguy109

Well, in one of ZAZ's scripts it's run kind of like this. Not sure if this helps. confused.gif

 

 

:gif  not [email protected]([email protected],16i) == -1 jf @h083C: set_actor [email protected]([email protected],16i) velocity_in_direction_XYZ 0.0 0.0 25.0wait 0083C: set_actor [email protected]([email protected],16i) velocity_in_direction_XYZ 0.0 0.0 25.0:[email protected] += 1jump @g

 

http://www.gtaforums.com/index.php?showtop...st&p=1060506803

Edited by fireguy109

Share this post


Link to post
Share on other sites
BnB

You have to use sine and cosine.

Share this post


Link to post
Share on other sites
12jango

That script is used to levitate people, it only levitate to the sky. dontgetit.gif

Well, I need help with moving (fly) a person to a coordinates. Please. smile.gif

 

Thanks! icon14.gif

Share this post


Link to post
Share on other sites
Wesser

Simply get the in-between vector of the 2 coordinates.

Share this post


Link to post
Share on other sites
12jango

Can you make an example for me?

Share this post


Link to post
Share on other sites
Wesser

This is it (untested):

 

// Start XYZ coordinates00A0: store_actor $PLAYER_ACTOR position_to [email protected] [email protected] [email protected] // End XYZ [email protected] = 0.0 [email protected] = 0.0 [email protected] = 0.0 // Movement [email protected] = 1.0 // Get the in-between vector0063: [email protected] -= [email protected] 0063: [email protected] -= [email protected] 0063: [email protected] -= [email protected] // Calculate vector length050A: [email protected] = distance_between_XYZ 0.0 0.0 0.0 and_XYZ [email protected] [email protected] [email protected] // Get the unit vector0073: [email protected] /= [email protected] 0073: [email protected] /= [email protected] 0073: [email protected] /= [email protected] // Multiply the vector by velocity006B: [email protected] *= [email protected] 006B: [email protected] *= [email protected] 006B: [email protected] *= [email protected] // Calculate the angle between the 2 points0604: get_Z_angle_for_point [email protected] [email protected] store_to [email protected] // Apply these calculations083C: set_actor $PLAYER_ACTOR velocity_in_direction_XYZ [email protected] [email protected] [email protected] 0173: set_actor $PLAYER_ACTOR Z_angle_to [email protected] 

 

Share this post


Link to post
Share on other sites
12jango

I've tested your script and worked well as my expectation! Thanks, dude! icon14.gif

By the way, I'd like to know how to get an actor's current task (what an actor doings) and apply it to another actor?

Thanks. icon14.gif

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

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