Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. The Criminal Enterprises
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Support

    3. Suggestions

*DO NOT* SHARE MEDIA OR LINKS TO LEAKED COPYRIGHTED MATERIAL. Discussion is allowed.

Moving an object...


arielnmz
 Share

Recommended Posts

Ok, im getting tired of this...

 

I want this object ([email protected]) to apply a velocity towards ([email protected] [email protected] [email protected]) continuously until it reaches that point...

 

but it only flies in a circle going nowhere...

 

the "throw object" opcode works, but it doesnt goes fast enough...

 

hope you can help me out with this...

Link to comment
Share on other sites

Thanks... and yes, ive tried 034e and it just adds [speed] to the coords until it reaches its destination, i cant figure a way to make speed relative to the angle of the object/destination and move to there... and throw works fine but i want to avoid to attach the object to a ball and it's slow... my script used it before but applying a velocity is faster... i hope you understood i somethimes dont know how to explain myself.. hehe

Link to comment
Share on other sites

 

Thanks... and yes, ive tried 034e and it just adds [speed] to the coords until it reaches its destination, i cant figure a way to make speed relative to the angle of the object/destination and move to there...

 

the multiplicator gives the distance as well the speed

bigger distance gives higher speed

 

sin and cosine gives offsets of radius of 1.0 of the object

the multiplicator (60.0) increase the radius

[email protected] *= 60.0 // (float)

[email protected] *= 60.0 // (float)

 

 

0172: [email protected] = actor $PLAYER_ACTOR Z_angle0453: set_object [email protected] XY_rotation 0.0 0.0 angle [email protected]: [email protected] = sine [email protected] // (float)02F7: [email protected] = cosine [email protected] // (float)[email protected] *= 60.0 // (float)[email protected] *= 60.0 // (float)[email protected] *= -1.0 0392: make_object [email protected] moveable 10381: throw_object [email protected] velocity_in_direction [email protected] [email protected] [email protected]

 

 

 

 

and throw works fine but i want to avoid to attach the object to a ball and it's slow... my script used it before but applying a velocity is faster... i hope you understood i somethimes dont know how to explain myself.. hehe

the objects have different behaviours

you have to think about what you wanna do, do you need a collisions check or should it just possible to throw it

not all objects are throwable and not much objects can pump a ped or a car

 

 

Link to comment
Share on other sites

Thanks zaz I was doing more and more "field work" and I figured out the same thing... not all objects have the same dynamics (some " are thrown" faster/easier than others) and some dont have certain collision checks... and one more question, why to invert (@15 *= -1.0) the X speed before 0381??

Link to comment
Share on other sites

 

Thanks zaz I was doing more and more "field work" and I figured out the same thing... not all objects have the same dynamics (some " are thrown" faster/easier than others) and some dont have certain collision checks... and one more question, why to invert (@15 *= -1.0) the X speed before 0381??

i don't know exactly, it was just neccesary to give one parameter the opposite

consider that the results of the sin/cosin should work in the unit circle, where you have ++ coords in northeast quater, +- coords in southeast, -+ coords in southwest and -- coords in northwest

the throw direction depends to the current location of the object and would be different, each if it is in northeast, southeast, southwest or northwest unless one param will be multiplicated with -1

Link to comment
Share on other sites

I see... well thanks!! I've found that absolute sine/cosine floats work wonders with move, too (I think this is more accurate because it only "steps" the object ignoring dynamic/physics that each object has, not like a throw or applying a velocity).. thanks!!!

Link to comment
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
 Share

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

×
×
  • Create New...

Important Information

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