[Open Assets] Multiability + Spindash Scripts: Holdfly, Spideyknux, and Multithok

This content may be freely modified and/or maintained by anyone.

wolfs

Watch Symphogear
Administrator
Sonic Team Junior
Kart Krew™️
Judge
UPDATE 6/8/15: Completely redid the scripts. They should be more stable now.

Hey all, today I've got some new Lua scripts I've been assembling lately. These ones in particular are scripts to re-enable spindashing/spinjumping when you have multiability to give you capabilities such as multithokking, multigliding, and holding jump down to fly instead of repeatedly tapping it. In case anyone was wondering, the multiglide/spideyknux script in this set of scripts is the same one that red the fox's UglyKnux character uses.


Being rather simple scripts, if you'd like to use and/or edit any of these scripts for a character of your own, you have my permission to do so as long as I'm credited.

Have fun!
 

Attachments

  • srb20008.gif
    srb20008.gif
    6.3 MB · Views: 2,292
  • srb20009.gif
    srb20009.gif
    5.4 MB · Views: 1,732
  • srb20010.gif
    srb20010.gif
    6.6 MB · Views: 1,953
  • Multiability + Spindash.zip
    1.4 KB · Views: 1,640
Last edited:
It'd be cool to play with a super-fast spindash-charged flying Tails again! WITNESS MY SPEEEEEEEEED!

The others, I could honestly care less, though that Spidey Knux thing we all know and love (me, somewhat, since I learned about SRB2 when it was on 2.0.6) would be prettttttty useful.
 
These are very interesting scripts that change the dynamic of the main three characters and allows for various different paths to be seen.
 
After all these years, I STILL find it hard to believe that hold-to-fly isn't just in the vanilla game yet.
 
I remember these capabilities from the old demos..... that multithok..... I may use it in my fan character wad, sure if permisson is given xD. Amazing job bringing old moments again.
 
I checked uglyknux's lua and was surprised on how it works. Now we only need wallbreaking, swimming without waterrun and waterrun without swimming.
 
It'd be cool to play with a super-fast spindash-charged flying Tails again! WITNESS MY SPEEEEEEEEED!

The others, I could honestly care less, though that Spidey Knux thing we all know and love (me, somewhat, since I learned about SRB2 when it was on 2.0.6) would be prettttttty useful.
The same with me. Even the 2.0.6 part.
 
swimming without waterrun and waterrun without swimming.
I suppose that sort of stuff would be possible by checking for if the player is above or under water (is that possible?), and if above water, set ability to CA_NONE (no waterrun) or CA_SWIM (waterrun), and if underwater, the other way around (meaning CA_NONE above water is CA_SWIM underwater, and such).

[ontopic]Personally I just think the best way for all this would be...

CA2_NONE (0) for no-spin, no multiability.
CA2_SPIN (1) for spin, no multiability.
CA2_MULTIABILITY (2) for no-spin, multiability.
CA2_SPIN+CA2_MULTIABILITY (1+2=3) for spin, multiability.

After all, the only values for charability2 are CA2_NONE, CA2_SPIN, and CA2_MULTIABILITY. I really wonder why it's not like this in the vanilla game. Oh, and an actually-functional SF_SUPER skinflag, and an SF_WATERSKIP skinflag. Those could also be fun in the vanilla game.
 
I suppose that sort of stuff would be possible by checking for if the player is above or under water (is that possible?), and if above water, set ability to CA_NONE (no waterrun) or CA_SWIM (waterrun), and if underwater, the other way around (meaning CA_NONE above water is CA_SWIM underwater, and such).

I'm not sure you can detect if the character's underwater or not.

A good workaround can be, for having runonwater but not swim, check if the character's in its run states or if its speed is its runspeed and PF_JUMPED is false; that would make its ability CA_SWIM. For swim and not runonwater, CA_None if PF_JUMPED returns false, CA_SWIM otherwise. After all, you can only activate the swim ability if you've jumped first :P

EDIT: Turns out there is a character flag for being underwater, and you can detect it with "player.mo.eflags & MFE_UNDERWATER"

which simplifies things. Wheeeee
 
Last edited:
A good workaround can be, for having runonwater but not swim, check if the character's in its run states or if its speed is its runspeed and PF_JUMPED is false; that would make its ability CA_SWIM.
You know, with the swim ability, you CAN jump and then land on water if fast enough, and then run on it.


EDIT: Turns out there is a character flag for being underwater, and you can detect it with "player.mo.eflags & MFE_UNDERWATER"
Yeah, that would be better.



Now the problem just is... What if I want a character that can Thok but also run on water? I don't think that would be too easy to make in a good way.
 
I suppose that sort of stuff would be possible by checking for if the player is above or under water (is that possible?), and if above water, set ability to CA_NONE (no waterrun) or CA_SWIM (waterrun), and if underwater, the other way around (meaning CA_NONE above water is CA_SWIM underwater, and such).

[ontopic]Personally I just think the best way for all this would be...

CA2_NONE (0) for no-spin, no multiability.
CA2_SPIN (1) for spin, no multiability.
CA2_MULTIABILITY (2) for no-spin, multiability.
CA2_SPIN+CA2_MULTIABILITY (1+2=3) for spin, multiability.

After all, the only values for charability2 are CA2_NONE, CA2_SPIN, and CA2_MULTIABILITY. I really wonder why it's not like this in the vanilla game. Oh, and an actually-functional SF_SUPER skinflag, and an SF_WATERSKIP skinflag. Those could also be fun in the vanilla game.
I was thinking about checking if the player is in the water or not but I didn't know the flag to check that. SF_SUPER works if you set it via lua on your character. The character can also use the spin fly action if the flag is enabled.
Waterrun and Superform were 2 flags in the old version before the character creation got nerfed. They might get added again, but the devs need to work on the netcode now. This, Superstartcolor(to set a special color for super) endcolor(if the palette is longer than 16 colors) and superendcolor should be added to the game, maybe a second startcolor for some characters.
I'm not sure you can detect if the character's underwater or not.

A good workaround can be, for having runonwater but not swim, check if the character's in its run states or if its speed is its runspeed and PF_JUMPED is false; that would make its ability CA_SWIM. For swim and not runonwater, CA_None if PF_JUMPED returns false, CA_SWIM otherwise. After all, you can only activate the swim ability if you've jumped first :P

EDIT: Turns out there is a character flag for being underwater, and you can detect it with "player.mo.eflags & MFE_UNDERWATER"

which simplifies things. Wheeeee
The workaround would work, or even better with the underwater flag. I'm going to use that, thanks for helping.

You know, with the swim ability, you CAN jump and then land on water if fast enough, and then run on it.


Yeah, that would be better.



Now the problem just is... What if I want a character that can Thok but also run on water? I don't think that would be too easy to make in a good way.
Easy way to add that:
Set the default ability to swim
If you jump, set ability to thok(can you even waterrun if you jump and then land ?), and if you enter water, set the ability to thok.
 
Easy way to add that:
Set the default ability to swim
If you jump, set ability to thok(can you even waterrun if you jump and then land ?), and if you enter water, set the ability to thok.
Problem: With CA_SWIM, one CAN actually run on water, jump, and then land ON the water again.

Derpfully shown in this video here (that I accidentally recorded without audio).

Now that will be hard to make possible via Lua while still keeping a Thok or something. I can't even find the water-running code in the source of SRB2 2.1. Nor any other ability code. Except for defining what ability CA_whatever actually is. But I can't find the code that takes it and makes stuff happen depending on what ability one has.
 
Last edited:
Problem: With CA_SWIM, one CAN actually run on water, jump, and then land ON the water again.

Derpfully shown in this video here (that I accidentally recorded without audio).

Now that will be hard to make possible via Lua while still keeping a Thok or something. I can't even find the water-running code in the source of SRB2 2.1. Nor any other ability code. Except for defining what ability CA_whatever actually is. But I can't find the code that takes it and makes stuff happen depending on what ability one has.

I already tried. Conditional CA_SWIM can't get specific enough to the point where you could keep a thok and water run but still be able to hop off ledges and run on top of the water. As for converting code directly from the source, lua is not capable of manipulating FOFs so this is not possible.
 
I already tried. Conditional CA_SWIM can't get specific enough to the point where you could keep a thok and water run but still be able to hop off ledges and run on top of the water.
I actually thought of an "is jump tapped or held" check, similar to an "is spin tapped or held" check I made for a different character wad that works (for a midair action, like the shields).

But then I remembered that game actions get done, then Lua, and then the actions Lua cause, meaning one would never thok, since one would only have the thok ability the tic after pressing jump again.


Then I thought of doing something so if one is underwater, ones ability is always Thok, no exceptions. But if above water, that "jump tapped or held" check would be handy, making it so if one jumps, one can land on water, since it's usually always the swim ability one has above water.

But if one jumps and taps the jump button again in midair (while actually jumping) (before thokking for the first time in that jump), it forces the game to think "The player isn't pressing jump" the next tic, while changing ability to Thok. And then the next tic, it forces the game to think "The player IS pressing jump, let's make him thok".

Now how would it then not make the player thok 2 tics after making a normal jump? Simple, an "is object on ground" check, which forces one to have to wait at least 1 tic before letting above "idea" get executed. Which could change to 2 or 3 tics, depending on how testing goes.

Here the problem would just be other abilities. How would I make it so one can fly, but even after beginning to fly still land on water?
Another problem would be reaction time above water. Just 2 tics can make a quite huge impact on gameplay.
Plus it's just getting over the top here. Who would possibly ever really need that?

...Why do I keep saying I know so little about Lua?


As for converting code directly from the source, lua is not capable of manipulating FOFs so this is not possible.
*Shrug* I'd still like to find the coding for the abilities, though.
 
Minor update: I call this minor, but I actually rewrote all three of the scripts. Hopefully they should be more stable now.
 

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

Back
Top