SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 12/02/2019, 01:53 PM   #1
Killa[DGZ]
Huge Clucker
 
Killa[DGZ]'s Avatar
 
Join Date: Feb 2010
Location: Australia
Posts: 394
Reputation: 85
Default Symmetrical Arched Object Movement

Is anyone able to help me out with the workings for a symmetrical arched type object movement from say point (A) to (B), with the vertex (Z) being half the length between those two points?

I can't seem to grasp the whole concept to be honest and the more trigonometry and algebra based shit I read on the internet the more I become confused and can't think for the life of me, you know.. being an old fart an all lol.


Any help will be very much appreciated, thanks
__________________
Killa[DGZ] is offline   Reply With Quote
Old 12/02/2019, 02:23 PM   #2
Y_Less
Beta Tester
 
Y_Less's Avatar
 
Join Date: Jun 2008
Location: 629 - git.io/Y
Posts: 15,697
Reputation: 3226
Default Re: Symmetrical Arched Object Movement

If the z is half the distance then that's a circle, which is very easy: r^2 = z^2 + d^2, where r is your radius (the half length you mentioned), z is the height, and d is the distance traveled horizontally. However, that won't give a very smooth vertical stepping, also, you probably want a parabola, not a circle.

As for speed - do you want gravity to take effect? That would increase the speed going down, and decrease it going up (which implies some initial acceleration to go up). Or is constant speed OK? I said above that a constant horizontal speed would give inconsistent vertical speed, but that might actually be a good thing.
Y_Less is online now   Reply With Quote
Old 12/02/2019, 04:42 PM   #3
Pottus
Godfather
 
Pottus's Avatar
 
Join Date: Jun 2012
Posts: 5,345
Reputation: 1271
Default Re: Symmetrical Arched Object Movement

You could just attach an object to a golf ball then rotate the golf ball.
Pottus is online now   Reply With Quote
Old 13/02/2019, 06:15 AM   #4
Killa[DGZ]
Huge Clucker
 
Killa[DGZ]'s Avatar
 
Join Date: Feb 2010
Location: Australia
Posts: 394
Reputation: 85
Default Re: Symmetrical Arched Object Movement

Quote:
Originally Posted by Y_Less View Post
If the z is half the distance then that's a circle, which is very easy: r^2 = z^2 + d^2, where r is your radius (the half length you mentioned), z is the height, and d is the distance traveled horizontally. However, that won't give a very smooth vertical stepping, also, you probably want a parabola, not a circle.

As for speed - do you want gravity to take effect? That would increase the speed going down, and decrease it going up (which implies some initial acceleration to go up). Or is constant speed OK? I said above that a constant horizontal speed would give inconsistent vertical speed, but that might actually be a good thing.

My oath, you do actually explain it so much better than I've been reading it on the internet.. and yes, you're absolutely right, I'm indeed after a parabola.. not a circle at all, so please ignore the part where I said it was half the distance.
As for speed, speed is fine being constant.. the server itself is very low gravity so I feel as though it would really fit the part just fine.

In short I would like to create mortars for a war server I've been working on for many years now, I already have machine turrets and tesla towers in place for player base defense, it just seems a bit naked to me without any mortars as you can imagine and the half circle type movement using floatsin/cos doesn't really do it justice in my opinion.



@Pottus, thats actually brilliant idea mate, not quite what I'm after though.. but thanks for the suggestion all the same
__________________
Killa[DGZ] is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Player Skin Breathing cause Object Movement Rudy_ Scripting Help 6 29/08/2014 01:41 PM
Object Movement usersamp Scripting Help 2 21/05/2012 01:26 PM
[BUG?] Object movement? Meta Scripting Help 2 15/04/2012 03:48 PM
Object movement Liustas Help Archive 7 23/06/2010 10:41 PM
automatic movement of an object worms0 Help Archive 5 27/12/2009 10:58 PM


All times are GMT. The time now is 01:17 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.