How do I create new characters and give them abilities? #357
Replies: 5 comments 7 replies
|
Player-refactor branch has this i think, but is generally incomplete. If
you want to use what you have now here's how it works:
Each character has 2 main things:
* an entry in Global.gd's CHARACTERS enum - Find this in Scripts/Global, or
look in autoloads. This is how the engine knows what character you are.
Additionally swn will check in several places for this value. Player.gd has
plenty to handle super, i think hitbox sizes, and stats (if you don't
care/know just use sonic's or a default. a lot of this is inconsequential)
There are other stuff though too, Normal.gd needs a list of idles to play
in order. Air.gd branches out for each character's ability, so put your
activation code there. HUD.gd (and maybe another script for level
completion? check scene.) needs your character's name and life icon.
MonitorIcons need your life icon too, though you dont need to change code
for that, just add it next to the other life icons based off of index.
After all of this your character will probably not crash.
* A PlayerAnimations scene - right on the tin, but these are wierd. They're
found in Graphics/Players/PlayerAnimations, despite not necessarily being
graphics in and of themselves and despite tails' containing a script. Dont
change the names/locations of any nodes you see they are expected to be
there with that name and location and will crash if they can't be found.
Duplicate a scene you like (probably choose one that matches the hitbox you
chose, because Crouchbox is there for some reason) and modify the inner
stuff. You can add new animations or change existing ones in
PlayerAnimation. You can swap out the texture with your custom sprites of a
different character. And you can change their super palette data to be a
different color. Adding new nodes is fine as well, if you need something
like a second layer. This scene can be accessed as spriteController from a
player.
This sucks and it's why there is the refactor. Though if you don't like
part of this process you can change it for yourself if you see yourself
adding more characters, or if you want to keep a codebase going so you
could base new games off of your old code and have your tech stack up over
time to something greater.
For cc right now the PlayerAnimations have been renamed as Characters and
placed in Entities like they probably should. spriteController is a new
Character type that has a bunch of callbacks and export vars for character
properties instead of per-script checks, and each guy will inherit the type
for their own character scripts with ability code in it. STATES has been
replaced with a dictionary of node references so that you can just throw
like, parent.set_state($AceBlazeBurst) and it just works if you have the
node there, and can be placed in character scenes.
I could try sharing code but that would involve basically stripping it of
it's cc-ness, so I'll probably just leave those as source code releases of
cc when they come. With the godot 3 repository *hopefully coming soon*, if
not soon then when demo 2 drops or something.
…On Tue, Aug 4, 2026, 3:13 PM Maskmaster64-code ***@***.***> wrote:
I am working on a game that will implement Eggman and Metal Sonic as
playable characters, but I don't know where to start. I looked at the
Player script and learned that the individual characters themselves don't
have scripts.
—
Reply to this email directly, view it on GitHub
<#357?email_source=notifications&email_token=A4JOMPL7SPCSL5N2O4TEKXL5IIYXDA5CNFSNUABBM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63RPGEYDKNJTGE4DJJTSMVQXG33OVJZXKYTTMNZGSYTFMSSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A4JOMPLGSSUTKTP4PLRHZ635IIYXDAVCNFSNUABIKJSXA33TNF2G64TZHMZTKOJWGM2TSMBYHNCGS43DOVZXG2LPNY5TCMBVGUZTCOBUUF3AE>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/A4JOMPKDGNSHFJIKIQI2BZT5IIYXDA5CNFSNUABBM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63RPGEYDKNJTGE4DJJTSMVQXG33OVJZXKYTTMNZGSYTFMSSWK5TFNZ2KUZTPN52GK4S7NFXXG>
and Android
<https://github.com/notifications/mobile/android/A4JOMPORBON2UUB3OE3PWM35IIYXDA5CNFSNUABBM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63RPGEYDKNJTGE4DJJTSMVQXG33OVJZXKYTTMNZGSYTFMSSWK5TFNZ2K4ZTPN52GK4S7MFXGI4TPNFSA>.
Download it today!
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
|
Holy shit i wrote so fucking much aaaauuuggghhh
…On Wed, Aug 5, 2026, 12:04 PM Neon ***@***.***> wrote:
Player-refactor branch has this i think, but is generally incomplete. If
you want to use what you have now here's how it works:
Each character has 2 main things:
* an entry in Global.gd's CHARACTERS enum - Find this in Scripts/Global,
or look in autoloads. This is how the engine knows what character you are.
Additionally swn will check in several places for this value. Player.gd has
plenty to handle super, i think hitbox sizes, and stats (if you don't
care/know just use sonic's or a default. a lot of this is inconsequential)
There are other stuff though too, Normal.gd needs a list of idles to play
in order. Air.gd branches out for each character's ability, so put your
activation code there. HUD.gd (and maybe another script for level
completion? check scene.) needs your character's name and life icon.
MonitorIcons need your life icon too, though you dont need to change code
for that, just add it next to the other life icons based off of index.
After all of this your character will probably not crash.
* A PlayerAnimations scene - right on the tin, but these are wierd.
They're found in Graphics/Players/PlayerAnimations, despite not necessarily
being graphics in and of themselves and despite tails' containing a script.
Dont change the names/locations of any nodes you see they are expected to
be there with that name and location and will crash if they can't be found.
Duplicate a scene you like (probably choose one that matches the hitbox you
chose, because Crouchbox is there for some reason) and modify the inner
stuff. You can add new animations or change existing ones in
PlayerAnimation. You can swap out the texture with your custom sprites of a
different character. And you can change their super palette data to be a
different color. Adding new nodes is fine as well, if you need something
like a second layer. This scene can be accessed as spriteController from a
player.
This sucks and it's why there is the refactor. Though if you don't like
part of this process you can change it for yourself if you see yourself
adding more characters, or if you want to keep a codebase going so you
could base new games off of your old code and have your tech stack up over
time to something greater.
For cc right now the PlayerAnimations have been renamed as Characters and
placed in Entities like they probably should. spriteController is a new
Character type that has a bunch of callbacks and export vars for character
properties instead of per-script checks, and each guy will inherit the type
for their own character scripts with ability code in it. STATES has been
replaced with a dictionary of node references so that you can just throw
like, parent.set_state($AceBlazeBurst) and it just works if you have the
node there, and can be placed in character scenes.
I could try sharing code but that would involve basically stripping it of
it's cc-ness, so I'll probably just leave those as source code releases of
cc when they come. With the godot 3 repository *hopefully coming soon*, if
not soon then when demo 2 drops or something.
On Tue, Aug 4, 2026, 3:13 PM Maskmaster64-code ***@***.***>
wrote:
> I am working on a game that will implement Eggman and Metal Sonic as
> playable characters, but I don't know where to start. I looked at the
> Player script and learned that the individual characters themselves don't
> have scripts.
>
> —
> Reply to this email directly, view it on GitHub
> <#357?email_source=notifications&email_token=A4JOMPL7SPCSL5N2O4TEKXL5IIYXDA5CNFSNUABBM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63RPGEYDKNJTGE4DJJTSMVQXG33OVJZXKYTTMNZGSYTFMSSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/A4JOMPLGSSUTKTP4PLRHZ635IIYXDAVCNFSNUABIKJSXA33TNF2G64TZHMZTKOJWGM2TSMBYHNCGS43DOVZXG2LPNY5TCMBVGUZTCOBUUF3AE>
> .
> Triage notifications, keep track of coding agent tasks and review pull
> requests on the go with GitHub Mobile for iOS
> <https://github.com/notifications/mobile/ios/A4JOMPKDGNSHFJIKIQI2BZT5IIYXDA5CNFSNUABBM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63RPGEYDKNJTGE4DJJTSMVQXG33OVJZXKYTTMNZGSYTFMSSWK5TFNZ2KUZTPN52GK4S7NFXXG>
> and Android
> <https://github.com/notifications/mobile/android/A4JOMPORBON2UUB3OE3PWM35IIYXDA5CNFSNUABBM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63RPGEYDKNJTGE4DJJTSMVQXG33OVJZXKYTTMNZGSYTFMSSWK5TFNZ2K4ZTPN52GK4S7MFXGI4TPNFSA>.
> Download it today!
> You are receiving this because you are subscribed to this thread.Message
> ID: ***@***.***>
>
|
|
Oh yeah you also should add them to the character select. Its just a table
of strings and an extra entry to switch to your character with it with said
string's index. There's extra code for the characters in the center, but
you probably won't be using this screen for anything other than debugging
anyway, so you can just kind of ignore it. If it causes crashes somehow you
can just remove that code lol
…On Wed, Aug 5, 2026, 12:04 PM Neon ***@***.***> wrote:
Player-refactor branch has this i think, but is generally incomplete. If
you want to use what you have now here's how it works:
Each character has 2 main things:
* an entry in Global.gd's CHARACTERS enum - Find this in Scripts/Global,
or look in autoloads. This is how the engine knows what character you are.
Additionally swn will check in several places for this value. Player.gd has
plenty to handle super, i think hitbox sizes, and stats (if you don't
care/know just use sonic's or a default. a lot of this is inconsequential)
There are other stuff though too, Normal.gd needs a list of idles to play
in order. Air.gd branches out for each character's ability, so put your
activation code there. HUD.gd (and maybe another script for level
completion? check scene.) needs your character's name and life icon.
MonitorIcons need your life icon too, though you dont need to change code
for that, just add it next to the other life icons based off of index.
After all of this your character will probably not crash.
* A PlayerAnimations scene - right on the tin, but these are wierd.
They're found in Graphics/Players/PlayerAnimations, despite not necessarily
being graphics in and of themselves and despite tails' containing a script.
Dont change the names/locations of any nodes you see they are expected to
be there with that name and location and will crash if they can't be found.
Duplicate a scene you like (probably choose one that matches the hitbox you
chose, because Crouchbox is there for some reason) and modify the inner
stuff. You can add new animations or change existing ones in
PlayerAnimation. You can swap out the texture with your custom sprites of a
different character. And you can change their super palette data to be a
different color. Adding new nodes is fine as well, if you need something
like a second layer. This scene can be accessed as spriteController from a
player.
This sucks and it's why there is the refactor. Though if you don't like
part of this process you can change it for yourself if you see yourself
adding more characters, or if you want to keep a codebase going so you
could base new games off of your old code and have your tech stack up over
time to something greater.
For cc right now the PlayerAnimations have been renamed as Characters and
placed in Entities like they probably should. spriteController is a new
Character type that has a bunch of callbacks and export vars for character
properties instead of per-script checks, and each guy will inherit the type
for their own character scripts with ability code in it. STATES has been
replaced with a dictionary of node references so that you can just throw
like, parent.set_state($AceBlazeBurst) and it just works if you have the
node there, and can be placed in character scenes.
I could try sharing code but that would involve basically stripping it of
it's cc-ness, so I'll probably just leave those as source code releases of
cc when they come. With the godot 3 repository *hopefully coming soon*, if
not soon then when demo 2 drops or something.
On Tue, Aug 4, 2026, 3:13 PM Maskmaster64-code ***@***.***>
wrote:
> I am working on a game that will implement Eggman and Metal Sonic as
> playable characters, but I don't know where to start. I looked at the
> Player script and learned that the individual characters themselves don't
> have scripts.
>
> —
> Reply to this email directly, view it on GitHub
> <#357?email_source=notifications&email_token=A4JOMPL7SPCSL5N2O4TEKXL5IIYXDA5CNFSNUABBM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63RPGEYDKNJTGE4DJJTSMVQXG33OVJZXKYTTMNZGSYTFMSSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/A4JOMPLGSSUTKTP4PLRHZ635IIYXDAVCNFSNUABIKJSXA33TNF2G64TZHMZTKOJWGM2TSMBYHNCGS43DOVZXG2LPNY5TCMBVGUZTCOBUUF3AE>
> .
> Triage notifications, keep track of coding agent tasks and review pull
> requests on the go with GitHub Mobile for iOS
> <https://github.com/notifications/mobile/ios/A4JOMPKDGNSHFJIKIQI2BZT5IIYXDA5CNFSNUABBM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63RPGEYDKNJTGE4DJJTSMVQXG33OVJZXKYTTMNZGSYTFMSSWK5TFNZ2KUZTPN52GK4S7NFXXG>
> and Android
> <https://github.com/notifications/mobile/android/A4JOMPORBON2UUB3OE3PWM35IIYXDA5CNFSNUABBM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63RPGEYDKNJTGE4DJJTSMVQXG33OVJZXKYTTMNZGSYTFMSSWK5TFNZ2K4ZTPN52GK4S7MFXGI4TPNFSA>.
> Download it today!
> You are receiving this because you are subscribed to this thread.Message
> ID: ***@***.***>
>
|
|
The process of adding a new character is not currently for the faint of heart. I had a document describing how to do it at a very low level, but only for characters that are the same general height as Sonic (different character heights fuck up so much little stuff it drives me crazy) Here was the draft, but it's almost certainly incomplete, so expect some pitfalls. It's also based on the PlayerRefactor branch, so some details may differ if you use vanilla. |
|
Plenty of options. If you want something low difficulty, convert the horizontal bars to connectable gimmicks. If you want something a little more challenging you could do player refactor stuff -- I'm pretty sure there was some minor stuff I got stuck on with converting character actions over to the new system that you could tinker on. Or you could always just do something completely out of left field like an enemy or a gimmick. Your call. Documentation is good too. We could really use some good guides on all sorts of subjects. |
Uh oh!
There was an error while loading. Please reload this page.
I am working on a game that will implement Eggman and Metal Sonic as playable characters, but I don't know where to start. I looked at the Player script and learned that the individual characters themselves don't have scripts.
All reactions