SRB2 Message Board  

Go Back   SRB2 Message Board > Archived > Outdated Releases (2.1.X) > Lua (2.1.X)

 
 
Thread Tools
Directionchar - 2.2's player angling system in 2.1! Details »»
Directionchar - 2.2's player angling system in 2.1!
Version: 1.0, by Lach (nanananananananananananan a) Lach is offline
Developer Last Online: Aug 2020

Category: Version: SRB2 Rating:
Released: 03-19-2019 Last Update: Never Favourites: 0
Scripts Re-Useable Content

In SRB2 version 2.2, players face the direction of their button inputs by default, rather than the camera angle. This has been brought to 2.1 before, but during development on Pointy Sonic, Chrispy and I decided to do our own take with the character in mind!




You can use the console command directionchar to turn it on and off as you please.

If you choose to play with it on, there are two other commands you can use as well:
Spoiler: Extra Commands
By default, abilities like thok and glide still travel in the direction of the camera. Turning the command anglethok on will make certain character abilities face the direction the player is facing instead. This may be useful for players who want an option in between default tank controls and analog mode!



By default, players return to the camera's angle while standing still. Turning the command anglestand on will let standing players keep their angle while standing, also in a similar fashion to analog mode! (Chrispy and I like this feature in particular.)



Here are some other cool things that make this version stand out from other scripted versions of the feature:
Spoiler:




Supporting this script with custom characters:
Spoiler:
Where possible, use player.cmd.turnangle << FRACBITS instead of player.mo.angle. The script rotates the player mobj, so any ThinkFrame hooks that run after this script is added will use the new angle instead of the natural camera angle.

Should you need full control of mo.angle or need to disable directionchar for any other reason, setting the variable player.directionchar_override to true will prevent the rotation from taking effect. The script resets this variable every tic, so all you have to do is force player.directionchar_override to be true for every tic you need it disabled. It is recommended that you do this in a MobjThinker hook to guarantee that the variable is set before this script's ThinkFrame hook.


In MOST cases, all character mods should be loaded before directionchar, so it does not run before any logic the character needs regarding the player's angle. In certain situations however, it may be beneficial to add the character after directionchar—notably in the case of TailsCD, who will only display his tails correctly if directionchar is added before him.

Download Now

File Type: lua directionchar.lua (5.8 KB, 697 views)

Screenshots

Click image for larger version

Name:	srb20274.gif
Views:	2512
Size:	5.14 MB
ID:	17801   Click image for larger version

Name:	srb20278.gif
Views:	2330
Size:	6.61 MB
ID:	17802   Click image for larger version

Name:	srb20275.gif
Views:	2272
Size:	3.84 MB
ID:	17803   Click image for larger version

Name:	srb20277.gif
Views:	2463
Size:	4.48 MB
ID:	17804   Click image for larger version

Name:	srb20279.gif
Views:	2305
Size:	6.77 MB
ID:	17805  

Click image for larger version

Name:	srb20280 copy.gif
Views:	2247
Size:	3.74 MB
ID:	17806   Click image for larger version

Name:	srb20280.gif
Views:	2267
Size:	6.31 MB
ID:	17807  

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 03-19-2019   #2
D00D64
Probably Responsible
Moderator
 
D00D64's Avatar
Default

Welcome to releases!
D00D64 is offline  
Old 03-19-2019   #3
Inazuma
Let's see you handle this!
Judge
 
Inazuma's Avatar
Default

Thank you....

T h a n k y o u
Inazuma is offline  
Old 03-19-2019   #4
Elyos03
 
Elyos03's Avatar
Default

This script rocks!


Unfortunately, it breaks Ray's Air Glide a little bit.
__________________
"We're friends now."
"But I want to kill Goku."
"Most of my friends did."
Spoiler:
DO NOT look into my oldest posts. They now make me cringe like and YouTuber watching its very first video.
Elyos03 is offline  
Old 03-20-2019   #5
Lach
nanananananananananananan a
Moderator
 
Lach's Avatar
Default

Quote:
Originally Posted by Elyos03 View Post
This script rocks!


Unfortunately, it breaks Ray's Air Glide a little bit.
I don't want to add support for specific characters, since that would likely mean I would have to update this every time a new character releases. There is instead a means for character creators to disable directionchar temporarily, if they so wish to. Pointy uses this feature to disable the script while he uses his fan rotation frame.
Lach is offline  
 

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 03:18 PM.


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