Register FAQ Search Today's Posts Mark Forums Read
Go Back   JazzJackrabbit Community Forums » Open Forums » JCS & Scripting

ow do i make sucker tubes

JnAkers

JCF Member

Joined: Nov 2010

Posts: 6

JnAkers is doing well so far

Nov 6, 2010, 11:03 AM
JnAkers is offline
Reply With Quote
ow do i make sucker tubes

I edit the x speed values and y values to negative yet they still shoot them right or up.
DodgeS DodgeS's Avatar

JCF Member

Joined: Apr 2009

Posts: 79

DodgeS is a sad, sad person

Nov 6, 2010, 11:17 AM
DodgeS is offline
Reply With Quote
No way!
__________________
My Tilesets:

Traditional Japan
Blizzard
Weird Pipes
LegendaryDreamer

JCF Member

Joined: Nov 2010

Posts: 26

LegendaryDreamer is notorious for his worthless posts

Nov 6, 2010, 11:52 AM
LegendaryDreamer is offline
Reply With Quote
I think the problem is that you think positive values make the player go right and up.

X
Positive = right
Negative = left

Y
Positive = down
Negative = up

Edit: updated
__________________
If you're wondering about my custom title, I have posted my story in the Introductions thread. Go check it out!

Last edited by LegendaryDreamer; Nov 6, 2010 at 12:53 PM. Reason: epic fail with positive and negative values
Violet CLM Violet CLM's Avatar

JCF Éminence Grise

Joined: Mar 2001

Posts: 10,991

Violet CLM has disabled reputation

Nov 6, 2010, 12:29 PM
Violet CLM is offline
Reply With Quote
Quote:
Originally Posted by LegendaryDreamer View Post
X
Positive = left
Negative = right
Incorrect.
Quote:
Y
Positive = down
Negative = up
Correct.
__________________
LegendaryDreamer

JCF Member

Joined: Nov 2010

Posts: 26

LegendaryDreamer is notorious for his worthless posts

Nov 6, 2010, 12:48 PM
LegendaryDreamer is offline
Reply With Quote
I updated it (epic fail on my part, sorry ;p)
__________________
If you're wondering about my custom title, I have posted my story in the Introductions thread. Go check it out!
Grytolle Grytolle's Avatar

JCF Member

Joined: Sep 2004

Posts: 4,126

Grytolle is a forum legendGrytolle is a forum legendGrytolle is a forum legend

Nov 6, 2010, 01:44 PM
Grytolle is offline
Reply With Quote
what happens if you set a y-value and an x-value?
__________________
<center></center>
EvilMike EvilMike's Avatar

JCF Member

Joined: Jun 2001

Posts: 3,478

EvilMike is OFF DA CHARTEvilMike is OFF DA CHARTEvilMike is OFF DA CHARTEvilMike is OFF DA CHART

Nov 6, 2010, 01:52 PM
EvilMike is offline
Reply With Quote
At low speeds you get stuck. At higher speeds, you'll move diagonally.
Violet CLM Violet CLM's Avatar

JCF Éminence Grise

Joined: Mar 2001

Posts: 10,991

Violet CLM has disabled reputation

Nov 6, 2010, 03:45 PM
Violet CLM is offline
Reply With Quote
empirical results and new hypothesis

Actually, you only get stuck if there's a small (meaning between -15 and 16 inclusive) x-speed and a non-zero y-speed. As long as the x-speed is large (-16 or lower, or 17 or higher), it doesn't matter what y-speed you have. To take a guess at why this works, in pseudo-code:
Code:
z = player.current_zone
if z.class = sucker_tube {
    if z.yspeed {
        player.xpos = z.xpos
        player.yspeed = z.yspeed
    } if z.xspeed {
        player.ypos = z.ypos
        player.xspeed = z.xspeed
    }
}
This isn't quite right, because it's not just a matter of setting the player y-position, there's also some sort of temporary nullification of y-speed (an upward diagonal tube sends you not quite as high as an upward non-diagonal tube, meaning that the first movement caused by the y-speed fails to take place, but the y-speed created by the tube is maintained even through the x-speed check), but I think it's along the right lines.
__________________
Toni Toni's Avatar

JCF Member

Joined: Dec 2009

Posts: 396

Toni should make better posts

Nov 7, 2010, 05:55 AM
Toni is offline
Reply With Quote
so,

X:
Positive = Right
Negative = Left

Y:
Positive = Down
Negative = Up

XY:
Both positive(slow) = (probably) stuck
Both positive(fast) = move diagonal down and right. How much diagonal, depends on X and Y parameters
Both negative(slow) = (probably) stuck
Both negative(fast) = move diagonal up and left. How much diagonal, depends on X and Y parameters
Y positive, X negative = move diagonal down and left. How much diagonal, depends on X and Y parameters
Y negative, X positive = move diagonal up and right. How much diagonal, depends on X and Y parameters
__________________
Violet CLM Violet CLM's Avatar

JCF Éminence Grise

Joined: Mar 2001

Posts: 10,991

Violet CLM has disabled reputation

Nov 7, 2010, 09:30 AM
Violet CLM is offline
Reply With Quote
Quote:
Originally Posted by Toni View Post
Y positive, X negative = move diagonal down and left. How much diagonal, depends on X and Y parameters
iff X < -15.
Quote:
Y negative, X positive = move diagonal up and right. How much diagonal, depends on X and Y parameters
iff X > 16.
__________________
JnAkers

JCF Member

Joined: Nov 2010

Posts: 6

JnAkers is doing well so far

Nov 7, 2010, 10:17 PM
JnAkers is offline
Reply With Quote
Wow guys thanks alot. learned quite a bit!
Toni Toni's Avatar

JCF Member

Joined: Dec 2009

Posts: 396

Toni should make better posts

Nov 8, 2010, 04:49 AM
Toni is offline
Reply With Quote
No problem. Try to learn a lot of more in JCSing
__________________
Reply

Thread Tools

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 On

Forum Jump

All times are GMT -8. The time now is 01:55 AM.