[Reusable] DirectionChar for SRB2 2.1

This thread contains content that may be reused, modified, or ported by anyone.

Sapheros

Member
nov17c1.gif

It's exactly what you're thinking of, except it's in 2.1 and probably not as perfect as you would think it will be in 2.2. But it is a damn fine attempt.
attachment.php



Veterans of SRB2 will want to turn it off, as this is on by default. You can toggle this by typing the command "directionchar". There is also an option for Player 2 in splitscreen via "directionchar2".

In the cases of the actual coding ported from 2.2's source which was distributed by toaster, directionchar will have no effect in the following scenarios:

  • Exiting the level
  • 2D mode (though probably not Axis2D)
  • NiGHTS Mode
  • A case where the player cannot be controlled
  • Gliding and climbing
  • Analog Mode (which you probably won't use when you add this lua anyways)
  • The player is in their Pain state
  • The player is using the homing attack via CA_HOMINGTHOK
  • Any and all Ring Slinger gametypes (Match, Team Match, CTF, Tag, H&S)
  • Being Carried by an object (You won't have any directional influence on your end most of the time.
  • When you play as HMS.
This SHOULD work for most character situations, including overlays or following objects, IF this lua is added last.



Credits to toaster for the original 2.2 Source.
Credits to LJ Sonik and MPC for assistance in porting.
Credits to MPC for the Splitscreen command and minor bugfixes.
Credits to Lach for making me look lazy and actually try to make this script work as best as possible.


Honorable Mention to Jay with the older versions of this script using an overlay, thanks to some discoveries made from his older coding, we did manage to learn about interpolating issues with MD2s.
 

Attachments

  • srb20173.gif
    srb20173.gif
    6.9 MB · Views: 6,025
  • 2.1directionchar.lua
    4.9 KB · Views: 1,168
Last edited:

toaster

トースタちゃん
Kart Krew™️
Thank you!! I'm glad this is out there, and that everyone has an opportunity to play with this to see how it may be whilst waiting for the real thing.

For best 2.2-esque results, combine with FuriousFox's Auto-Brake script.
 
Last edited:
Here's me trying the mod, took me some time to get used to it as someone who tried analog mode before, Not sure how new players are going to find this, But I Probably shouldn't be comparing it Analog mode, that thing is a mess anyways and I'm not sure why it's still kept in SRB2 other than for Joysticks, Just leads to Confusion.

Otherwise a neat visual improvement.
 

Goldenhog

Wandering Protagonist
"Veterans of SRB2 will want to turn it off"
Man, you weren't joking. No disrespect intended to Sappheros for the porting job or the devs who implemented DirectionChar but there's something about the constant direction switching that makes it awkward for me to play, it's like it's flickering between Analog and regular mode and I can't get used to it. And the way the character auto-aims forward when not moving and how the thok still goes in the direction of the camera just feels wrong.

But yeah this is explicitly aimed at new players which I'm not so my opinion on it is probably not worth a whole lot. At least it lets me confirm I won't want this on when 2.2 happens.
 

Sapheros

Member
Honestly I wouldn't blame you, but at the same time... it's so perfect for me.

The ability to have a camera that doesn't work like shit for analog mode is probably the best thing visually for me, but at the same token, a lot of mods that were working with this script kinda throw me off when they're based on the camera's angle, by 2.2, i'm sure most modders will be able to work with what it can do there in the case of the player's angled direction, but eh.
 

Lach

he/him
Moderator
Sonic Team Junior
Kart Krew™️
Judge
a lot of mods that were working with this script kinda throw me off when they're based on the camera's angle, by 2.2, i'm sure most modders will be able to work with what it can do there in the case of the player's angled direction, but eh.

The exploit we're using in this script modifies player.mo.angle, which is why depending on the order of the files you add, mods that rely on player.mo.angle may function differently. I think it's safe to bet that in 2.2, the player's angle will be drawn based on player.drawangle regardless of what player.mo.angle is, so this will not be a problem. Modders will most likely be able to use either player.drawangle for the angle the player is facing or player.mo.angle for the angle the camera is facing.

EDIT:


I'm fairly certain I included a check for this when I contributed. I guess Saph didn't port all my fixes over.
 
Last edited:
I noticed the list says it has no effect on HMS. Just curious, why is that?
I'm not quite sure, but I imagine it would be because this might affect the player's object's rotation while HMS123311 might use the player's object's rotation for its special abilities in some way, thus causing a lot of strange/unexpected behaviour if the player's object turns around from this script when tapping different directions.
 

Sapheros

Member
For some unknown reason HMS just cries out a validity error that NO other characters have when using directionchar, thus breaking it while he's active. So to prevent anyone from making that silly bug report, I included it as something that you can't have control over.

As for that nights mode gif... uh... just fixed that! Turns out I may have had to make the hack directionchar uses to not be used once nights mode is happening upon mapload... so... yeah... I'm surprised not even the judges noticed this before release... and even then... I'm surprised I didn't notice this before even submitting...
 

QuickWolfPT

Member
Am i the only one having the character return to the original orientation once hurt? like i get hurt and it's like i don't have the lua loaded. i have to toggle it off and on again to return to the way it should be
 
Last edited:

Sapheros

Member
I... uh... actually fixed this not too long ago after i noticed the bug, after fixing that NiGHTS issue, /this/ issue came up. The fix has just been uploaded, and I promise there shouldn't be anymore vanilla-related bugs.
 

Snowy

PersistantRubine/Void
I... uh... actually fixed this not too long ago after i noticed the bug, after fixing that NiGHTS issue, /this/ issue came up. The fix has just been uploaded, and I promise there shouldn't be anymore vanilla-related bugs.

Apologies for this, but it doesn't seem to be fixed- I came back and saw this post, and tried the wad, only for the character's orientation to reset after I got hit once.
 

Sapheros

Member
So with the release of TSonic, it has come to my attention directionchar isn't working properly with it's new homing attack. This is due to my bad coding trying to implement something Lach made and wanted me to use, the implementation is so bad that Lach really should have been the uploader of this and not me. Self Deprecation aside, I've decided to change the name of 2.2 directionchar. Because this isn't 2.2, this is 2.1, and some of the changes when ported over needed to have another look with how 2.1 works. So now the lua file will be named 2.1directionchar, and any 2.2 directionchar file will now be considered outdated. Aside from some obvious coding improvements from the older version. This version has a few new changes from the 2.2 backport.


  • Skidding now has a proper effect to directionchar.
  • Water Sliding underwater will have a noticeable extra effect that was originally unimplemented in the original coding.
Apologies for my bad coding, also thanks to Lach for the assistance.
 
This would have been better if the character faced the direction the camera is facing during jumps, less disorienting and gives you a better idea of where the character is going to move, dash, glide....etc
 

toaster

トースタちゃん
Kart Krew™️
As the original implementor of this feature, the intent was to make clear to a new player that yes, you can influence the direction of movement through the air even if it doesn't quite look like you can. That's actually part of the reason why there's not more rotation effects in it, like horizontal spinning when caught in an air/water current like S3K (which did get enabled in this version of the mod), or being sprung by a directly vertical spring like SCD.
 

carlrev

The living revolution
OK. Where does everybody keep getting this preview of 2.2? I'm seeing new GFZ1, a new skybox, and everything!
 

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Top