SRB2 Message Board  

Go Back   SRB2 Message Board > Sonic Robo Blast 2 > Releases > Lua

Reply
 
Thread Tools
Axis2D Details »»
Axis2D
Version: 1.2, by RedEnchilada (happy, pretty, lovely!) RedEnchilada is offline
Developer Last Online: Apr 2017

Category: Version: SRB2 Rating: (1 votes - 3.40 average)
Released: 06-30-2014 Last Update: Never Installs: 2
Scripts Re-Useable Content

It's like normal 2D, but it's actually in 3D. Using the power of NiGHTS axis things, it gives 2D levels a slew of extra possibilities by allowing use of the third dimension properly. Think something like Kirby 64, or Klonoa, or even Sonic Unleashed/Colors/Generations!

As Clock Towers (which as of this writing is available in the current OLDC to vote on) (man, that really dates this post) demonstrates, this enables a lot of possibilities with branching paths and looping design that standard 2D mode doesn't easily allow for.

There's not a whole lot more to say about this, so feel free to download and start using it in your own creations! Super big credits to chi.miru for starting the script in the first place; I just helped finish it.

The screenshots are old.

changelog:

Spoiler: 1.2

  • The code has been heavily refactored into an axis2d global, which is now completely accessible from other scripts.
  • Object sliding issues when standing still on circular axes have been fixed.
  • PF_FORCESTRAFE no longer lingers after exiting Axis2D mode.
  • Camera objects should no longer be visible, and cutaway views should now be supported.
  • A new linedef type has been added: 9001 Axis2D Switch Sector. It's set up exactly like an invisible intangible FOF, and when inside you'll switch to the axis defined by the line's X offset. This line has no effect if you aren't already in Axis2D mode, which should make it easier to intersect A2D over 3D sections if you're into that sort of thing.
  • If you use camera tricks to flip the player's direction of motion (see Clock Towers), the player will continue moving forward (now opposite of input) until they release the movement key.


Spoiler: 1.1

  • Fixed crash in 2.1.9 (apparently using an MT_THOK as a camera doesn't work any more)
  • Now using the PF_FORCESTRAFE flag to enable movement with the turn keys! Now people who play with those won't kill you

Download Now

File Type: zip Axis2D_1-2.zip (34.0 KB, 211 views)

Screenshots

Click image for larger version

Name:	srb20056.gif
Views:	1407
Size:	7.25 MB
ID:	5252   Click image for larger version

Name:	srb20058.gif
Views:	1397
Size:	3.72 MB
ID:	5254  

Supporters / CoAuthors

Show Your Support

  • The author of this addon has given explicit permission for its content to be re-used and/or reproduced.

Comments
Old 10-28-2014   #22
RedEnchilada
happy, pretty, lovely!
Developer
 
RedEnchilada's Avatar
Default

Ah, I see the problem. I forgot that doing a proper exit resets all of the movement vars to normal itself, so the code intended to remove that flag never runs. This can be fixed by adding the following between lines 66 and 67:

Code:
player.pflags = $1&~PF_FORCESTRAFE
It was a simple lack of testing on my part, mostly because I don't use turn keys lololo

I'll add it to the base download once I figure out a good way to fix that other issue where Knuckles glides weirdly in analog mode, and maybe add a few other tweaks too, but for now, making that manual edit will fix that issue.
__________________
Quote:
<@toaster> '"sonic robot explosion 2", the hot new sensation for teens looking for a good time, tempts many children away from god each year'
RedEnchilada is offline   Reply With Quote
Old 10-29-2014   #23
Tyrannic
 
Tyrannic's Avatar
Default

This worked, but I have another very strange problem: When going into Axis2D, a thing (type 800, GFZ flower) spawns in one random point of the map, always the same one to be exact. It doesn't show up in the editor and it is only visible while in the game. It also doesn't show up when I bypass the Axis2D trigger by noclipping, so Axis2D probably has got to do something with it.
Tyrannic is offline   Reply With Quote
Old 10-29-2014   #24
RedEnchilada
happy, pretty, lovely!
Developer
 
RedEnchilada's Avatar
Default

That's probably because I used that object type as the camera. The code for handling cameras probably needs some major tweaking, not only to make sure they stay hidden but also so that the script works with cut-away views. It'll come once I update the script again.
__________________
Quote:
<@toaster> '"sonic robot explosion 2", the hot new sensation for teens looking for a good time, tempts many children away from god each year'
RedEnchilada is offline   Reply With Quote
Old 10-29-2014   #25
Tyrannic
 
Tyrannic's Avatar
Default

I figured it would be something like this. Thanks for clarifying.
Tyrannic is offline   Reply With Quote
Old 11-10-2014   #26
481
Learning Lua right now.
 
481's Avatar
Default

Red, I'm really impressed how you made this lua! I wish I could make maps, maybe even with this lua, but I have a Windows 7, and I can't use the level editor. Still, great lua! Same for Clock Towers Zone by the way (Well, I used Version 2 as normal made the game crash).
481 is offline   Reply With Quote
Old 02-01-2016   #27
Zwip-Zwap Zapony
Please just call me Zappy.
 
Zwip-Zwap Zapony's Avatar
Default

I think it's broken. The same issue happens in the example wad included with Axis2D. Well, it's broken in a compiled version of the "gl-slopes" branch of the game, at least. I'm pretty sure it still works correctly in the released 2.1.14, though.

Last edited by Zwip-Zwap Zapony; 02-01-2016 at 06:45 PM.
Zwip-Zwap Zapony is offline   Reply With Quote
Old 02-01-2016   #28
Monster Iestyn
Friendly Neighbour-Hood
Moderator
 
Monster Iestyn's Avatar
Default

Quote:
Originally Posted by Zwip-Zwap Zapony View Post
Well, it's broken in a compiled version of the "gl-slopes" branch
Stop right there, this is a release for 2.1.14 (or whatever the latest public release was by the last changes) in the first place you must remember. So this should honestly not be the biggest surprise. =V
Monster Iestyn is offline   Reply With Quote
Old 02-01-2016   #29
Zwip-Zwap Zapony
Please just call me Zappy.
 
Zwip-Zwap Zapony's Avatar
Default

Quote:
Originally Posted by Monster Iestyn View Post
Stop right there, this is a release for 2.1.14 (or whatever the latest public release was by the last changes) in the first place you must remember.
I know that, but it's broken in the development versions, which is a huge shame when considering how amazing Axis2D is.
And besides that, the broken-ness seems really strange (see the video I linked to in the first sentence), and may be something worthwhile looking into (whether it be in the game's code or the Lua's code), as something seems seriously wrong.
...Although I may have worded it wrongly during the start of the post. My bad.
Zwip-Zwap Zapony is offline   Reply With Quote
Old 02-02-2016   #30
RedEnchilada
happy, pretty, lovely!
Developer
 
RedEnchilada's Avatar
Default

It's broken because development versions changed how Lua gets angles by bitshifting them down by 16. Most of the things I write abuse the fact that angles used to take the entire int range, which meant that 5 - 350 == 15. Since they don't in development builds, now 5 - 350 == -345, which throws off most of the angle comparisons I use in things like Axis2D.

It's not a bug with the script, and it's not a bug with the game. It's a change in the game that the script wasn't designed to handle. I'm not going to try to fix it at least until 2.2 comes out because I don't feel like chasing an unstable API.
__________________
Quote:
<@toaster> '"sonic robot explosion 2", the hot new sensation for teens looking for a good time, tempts many children away from god each year'
RedEnchilada is offline   Reply With Quote
Old 02-02-2016   #31
Zwip-Zwap Zapony
Please just call me Zappy.
 
Zwip-Zwap Zapony's Avatar
Default

Quote:
Originally Posted by RedEnchilada View Post
It's broken because -Snip-
Ah, okay. I think that makes sense. I just thought something was either very wrong with the script or the game itself. My bad. Nevermind that, then.
Zwip-Zwap Zapony is offline   Reply With Quote
Old 06-15-2016   #32
Zwip-Zwap Zapony
Please just call me Zappy.
 
Zwip-Zwap Zapony's Avatar
Default

So, am I right in that this (successfully) attempts to re-create SRB2's vanilla 2D mode in all dimensions? If so, there's something I feel is missing, and would appreciate seeing added.
In vanilla 2D, pressing down (player.cmd.forwardmove < -20)* makes you spin if you move fast enough (player.speed > FixedMul(5*FRACUNIT, player.mo.scale) ), however this doesn't seem to be the case for Axis2D.

Relevant SRB2 source code, at line 3771 of p_user.c (in the current "master" branch of the game):
Spoiler: Code snippet
Code:
    // If not moving up or down, and travelling faster than a speed of four while not holding
    // down the spin button and not spinning.
    // AKA Just go into a spin on the ground, you idiot. ;)
    else if ((cmd->buttons & BT_USE || ((twodlevel || (player->mo->flags2 & MF2_TWOD)) && cmd->forwardmove < -20))
        && !player->climbing && !player->mo->momz && onground && (player->speed > FixedMul(5<<FRACBITS, player->mo->scale)
#ifdef ESLOPE
        || (player->mo->standingslope && abs(player->mo->standingslope->zdelta) >= FRACUNIT/2)
#endif
        ) && !(player->pflags & PF_USEDOWN) && !(player->pflags & PF_SPINNING))
    {
        player->pflags |= PF_SPINNING;
        P_SetPlayerMobjState(player->mo, S_PLAY_ATK1);
        if (!player->spectator)
            S_StartSound(player->mo, sfx_spin);
        player->pflags |= PF_USEDOWN;
    }
* It's somewhat important to have it at "< -20" rather than "< 0", for the few people who use gamepads with analog sticks to play.
Zwip-Zwap Zapony is offline   Reply With Quote
Old 06-15-2016   #33
Rafeku
Casual Player
 
Rafeku's Avatar
Default

Quote:
Originally Posted by Zwip-Zwap Zapony View Post
* It's somewhat important to have it at "< -20" rather than "< 0", for the few people who use gamepads with analog sticks to play.
Which is my case. I don't think I've ever found someone playing this on a joystick. It feels more legit.
__________________
Time to show da moves!
Rafeku is offline   Reply With Quote
Old 06-16-2016   #34
RedEnchilada
happy, pretty, lovely!
Developer
 
RedEnchilada's Avatar
Default

That function's worth consideration, but I think I'm going to leave it out mainly for this reason:

https://gfycat.com/CrispUncommonEmperorpenguin

These kinds of flips are fairly common in Clock Towers, and I'd hope they'll be fairly common in other Axis2D levels (they look really cool! especially once I release the update I've been working on that makes them nicer to control). It's not a stretch to picture someone following the turning radius with their inputs, particularly on an analog stick, and a down input getting registered as a spin in that case would be inconvenient. I don't want to try to special-case that because then you'd be dealing with down only working some of the time and being really inconsistent. (And besides, pressing the spin button yourself is ez)
__________________
Quote:
<@toaster> '"sonic robot explosion 2", the hot new sensation for teens looking for a good time, tempts many children away from god each year'
RedEnchilada is offline   Reply With Quote
Old 06-16-2016   #35
Rumia1
worries too much
 
Rumia1's Avatar
Default

Can you please elaborate on how they will be nicer to control? Because sadly I found them to be one of the most infuriating parts of that zone...
__________________
Quote:
Originally Posted by Cirno
Egguman-senpai...
Rumia1 is offline   Reply With Quote
Old 06-16-2016   #36
Mystic
チェン!
Administrator
 
Mystic's Avatar
Default

Quote:
Originally Posted by Rumia1 View Post
I found them to be one of the most infuriating parts of that zone...
Agreed. I quite hated these as well. They control terribly. I would be fully in support of removing all of them and allowing down for roll.

Last edited by Mystic; 06-16-2016 at 06:19 AM.
Mystic is offline   Reply With Quote
Old 06-16-2016   #37
Kaysakado
Default

I'd bet your update is already on this track, but here's something you may have never noticed in S3&K: when you're running on the ceiling, your controls are flipped! The right button sends you left and the left button sends you right. In fact you might want to generalize it as right sends you counterclockwise and left sends you clockwise. This makes loops and things like this play seamlessly because you can just hold one direction to go "forward". (aside: this is also the reason these things suck) The game even hides the transition back to regular control orientation by temporarily ignoring all horizontal input when you fall off a wall or ceiling.

Obviously this isn't the same thing, because it's not like you're in a temporarily different orientation, but it's food for thought. Maybe left can continue sending you forward until the player lets go? Though the problem with that is a player might try to halt by pressing the opposite direction... and suddenly they keep moving forward instead of stopping.
__________________
Join the Crashed Cafe!
Kaysakado is offline   Reply With Quote
Old 06-16-2016   #38
Zwip-Zwap Zapony
Please just call me Zappy.
 
Zwip-Zwap Zapony's Avatar
Default

Quote:
Originally Posted by Mystic View Post
Agreed. I quite hated these as well. They control terribly. I would be fully in support of removing all of them and allowing down for roll.
Well, what if what Red has planned is making so instead of pressing left or right depending on whether you're facing just 1 degree left or right or so, pressing backwards will pull you "towards" the screen and forwards the opposite? That would be a nice way to make them much better to control, and a very valid reasoning for not having down-spin.
Zwip-Zwap Zapony is offline   Reply With Quote
Old 06-16-2016   #39
RedEnchilada
happy, pretty, lovely!
Developer
 
RedEnchilada's Avatar
Default

Quote:
Originally Posted by Kaysakado View Post
Obviously this isn't the same thing, because it's not like you're in a temporarily different orientation, but it's food for thought. Maybe left can continue sending you forward until the player lets go? Though the problem with that is a player might try to halt by pressing the opposite direction... and suddenly they keep moving forward instead of stopping.
Actually, that was exactly what I did!
__________________
Quote:
<@toaster> '"sonic robot explosion 2", the hot new sensation for teens looking for a good time, tempts many children away from god each year'
RedEnchilada is offline   Reply With Quote
Old 07-22-2016   #40
verifiaman
The master of verification.
 
verifiaman's Avatar
Default

Can anyone help? I can't get this to work. I've even tried emulating the tags and range the axis is away from the player, but it didnt do a thing.
__________________
I am the master of verification
verifiaman is offline   Reply With Quote
Old 07-22-2016   #41
Hazard88263
heyy, that's pretty meme
 
Hazard88263's Avatar
Default

Quote:
Originally Posted by verifiaman View Post
Can anyone help? I can't get this to work. I've even tried emulating the tags and range the axis is away from the player, but it didnt do a thing.
I'm having the same problem. I've set the axis and things up just as the example has them, but still nothing is working. Will someone please give advice?
Hazard88263 is offline   Reply With Quote
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 Off

Forum Jump


All times are GMT. The time now is 08:21 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.