Custom Ability help for Blue Streak

Powershows

Member
Hey guys! PowerShows here and I'm asking for help with Custom Character abilitys. There's errors in the mod and I kinda don't know what I'm doing to be honest with you. The tutorial on the wiki wasn't the best for me and wasn't very exploratory. Here's the error and the file
Screenshot_20240413-181610.png
 

Attachments

  • airdash.lua
    702 bytes · Views: 22
Hey Powershows, can you explain what you're attempting to do?
I'm struggling with add-on a custom character, and as you can see, the Lua has errors in it. Usually make my skin/patch lumps in my text editor and Lua can be done there too, which I'm trying to do it there but I'm failing miserably. If you have the time, is it okay if you download tne file and see what's wrong because I wouldn't be able to spot the difference even in a working mod.
Post automatically merged:

I'm struggling with making a custom ability, and as you can see, the Lua has errors in it. Usually make my skin/patch lumps in my text editor and Lua can be done there too, which I'm trying to do it there but I'm failing miserably. If you have the time, is it okay if you download tne file and see what's wrong because I wouldn't be able to spot the difference even in a working mod.
 
Okay, so I'm slightly confused about what the ability is supposed to do. Is it just supposed to launch you forward a bit when you use it?
 
I'm struggling with add-on a custom character, and as you can see, the Lua has errors in it.
I think they meant, what are you trying to get your script to do? What does the ability do? You've kinda just dropped a bunch of code on us without any context or explanation for what it should do once it's fixed.
 
I think they meant, what are you trying to get your script to do? What does the ability do? You've kinda just dropped a bunch of code on us without any context or explanation for what it should do once it's fixed.
For now ,I'm trying to do something basic, since I have no idea how to make a custom ability. In the image above, I'm trying to use homing thok and normal thok. because of that I need them to be executed differenly. I was thinking homing thok would be excuted the same way, while normal thok is Jump THEN spin in mid air. I also have a more advanced idea where sonic can use hyper mode, (not to be confused with hyper forms) from Sonic the Fighters. This increases your speed and nurfing damage so you aren't overpowered. The was I want to implement this in game is to make sonic even faster, jump slightly higher, and have some invincibility start around him. I don't want to have full invincibility though.
Post automatically merged:

For now ,I'm trying to do something basic, since I have no idea how to make a custom ability. In the image above, I'm trying to use homing thok and normal thok. because of that I need them to be executed differenly. I was thinking homing thok would be excuted the same way, while normal thok is Jump THEN spin in mid air. Then for super transfermation, you would press custom 1 to automatically jump and transform. I also have a more advanced idea where sonic can use hyper mode, (not to be confused with hyper forms) from Sonic the Fighters. This increases your speed and nurfing damage so you aren't overpowered. The was I want to implement this in game is to make sonic even faster, jump slightly higher, and have some invincibility start around him. I don't want to have full invincibility though.
 
This script should make it so that you can use a normal thok when you press the spin button after a jump and use a homing thok if you press the jump button again after jumping.
Thok and Homing Thok together:
addHook("PlayerThink", function(player)
    if player.mo.skin ~= "sonic" then
        return
    end --this stops the script if the player isn't sonic
    
    local actionspeed = FixedMul(player.mo.scale, player.actionspd)
    
    if (player.mo.eflags & MFE_UNDERWATER) then
        actionspeed = $/2
    end --this part creates a new variable that uses the skin's actionspeed and makes it work in different parts of the game where it should change
    
    if (player.pflags & PF_JUMPED) --if the player jumped
    and not (player.pflags & PF_THOKKED) --if the player didn't use their ability
    and (player.cmd.buttons & BT_SPIN) then -- if the player presses the spin button
    P_InstaThrust(player.mo, player.mo.angle, actionspeed) --thrust the player using the variable we created
    P_SpawnThokMobj(player) --this is just for looks its spawns a thok trail
    S_StartSound(player.mo, sfx_thok) --this plays the thok sound
    player.pflags = $|PF_THOKKED --this makes it so the player can't use this ability or the homing thok again
    end
    
    player.charability = CA_HOMINGTHOK --this changes sonic's main ability to the homing thok
end)
I believe I could create the hyper mode, but I want to know how or when do you want it to activate?
 
This script should make it so that you can use a normal thok when you press the spin button after a jump and use a homing thok if you press the jump button again after jumping.
Thok and Homing Thok together:
addHook("PlayerThink", function(player)
    if player.mo.skin ~= "sonic" then
        return
    end --this stops the script if the player isn't sonic
 
    local actionspeed = FixedMul(player.mo.scale, player.actionspd)
 
    if (player.mo.eflags & MFE_UNDERWATER) then
        actionspeed = $/2
    end --this part creates a new variable that uses the skin's actionspeed and makes it work in different parts of the game where it should change
 
    if (player.pflags & PF_JUMPED) --if the player jumped
    and not (player.pflags & PF_THOKKED) --if the player didn't use their ability
    and (player.cmd.buttons & BT_SPIN) then -- if the player presses the spin button
    P_InstaThrust(player.mo, player.mo.angle, actionspeed) --thrust the player using the variable we created
    P_SpawnThokMobj(player) --this is just for looks its spawns a thok trail
    S_StartSound(player.mo, sfx_thok) --this plays the thok sound
    player.pflags = $|PF_THOKKED --this makes it so the player can't use this ability or the homing thok again
    end
 
    player.charability = CA_HOMINGTHOK --this changes sonic's main ability to the homing thok
end)
I believe I could create the hyper mode, but I want to know how or when do you want it to activate?
This script should make it so that you can use a normal thok when you press the spin button after a jump and use a homing thok if you press the jump button again after jumping.
Thok and Homing Thok together:
addHook("PlayerThink", function(player)
    if player.mo.skin ~= "sonic" then
        return
    end --this stops the script if the player isn't sonic
 
    local actionspeed = FixedMul(player.mo.scale, player.actionspd)
 
    if (player.mo.eflags & MFE_UNDERWATER) then
        actionspeed = $/2
    end --this part creates a new variable that uses the skin's actionspeed and makes it work in different parts of the game where it should change
 
    if (player.pflags & PF_JUMPED) --if the player jumped
    and not (player.pflags & PF_THOKKED) --if the player didn't use their ability
    and (player.cmd.buttons & BT_SPIN) then -- if the player presses the spin button
    P_InstaThrust(player.mo, player.mo.angle, actionspeed) --thrust the player using the variable we created
    P_SpawnThokMobj(player) --this is just for looks its spawns a thok trail
    S_StartSound(player.mo, sfx_thok) --this plays the thok sound
    player.pflags = $|PF_THOKKED --this makes it so the player can't use this ability or the homing thok again
    end
 
    player.charability = CA_HOMINGTHOK --this changes sonic's main ability to the homing thok
end)
I believe I could create the hyper mode, but I want to know how or when do you want it to activate?
First off thank you for this. I'll be testing this out and seeing if I can make something else out if this. Now for hyper mode, I would like to make it Sonc the Fighters, being that's you don't need any Emeralds to do so accurate so custom 1 would do. If you have all seven Emeralds, this auto super jump replaces this. But if people really like hyper mode, I would like for a command to be in place to toggle automatical super jump and hyper mode
Post automatically merged:

This script should make it so that you can use a normal thok when you press the spin button after a jump and use a homing thok if you press the jump button again after jumping.
Thok and Homing Thok together:
addHook("PlayerThink", function(player)
    if player.mo.skin ~= "sonic" then
        return
    end --this stops the script if the player isn't sonic
 
    local actionspeed = FixedMul(player.mo.scale, player.actionspd)
 
    if (player.mo.eflags & MFE_UNDERWATER) then
        actionspeed = $/2
    end --this part creates a new variable that uses the skin's actionspeed and makes it work in different parts of the game where it should change
 
    if (player.pflags & PF_JUMPED) --if the player jumped
    and not (player.pflags & PF_THOKKED) --if the player didn't use their ability
    and (player.cmd.buttons & BT_SPIN) then -- if the player presses the spin button
    P_InstaThrust(player.mo, player.mo.angle, actionspeed) --thrust the player using the variable we created
    P_SpawnThokMobj(player) --this is just for looks its spawns a thok trail
    S_StartSound(player.mo, sfx_thok) --this plays the thok sound
    player.pflags = $|PF_THOKKED --this makes it so the player can't use this ability or the homing thok again
    end
 
    player.charability = CA_HOMINGTHOK --this changes sonic's main ability to the homing thok
end)
I believe I could create the hyper mode, but I want to know how or when do you want it to activate?
I have a slight issue, your Lua script is fire, but when added with climb spin it makes errors. Thom overrights the climb dash button, so It removes the vertically part of the Sonic, which I don't want. so I changed the climb spin button to custom 2 and and then errors the partials (the sprites) come. The errors came as soon as changed the button.
I've read the script, thanks for putting labeling some parts, and I would like to know if I can adjust PF_JUMPED to make it if you help the jump button to to thok, do it doesn't interfere with climb dash, or remove the extra sprites entirely.
 
Last edited:
Would it be fine if I make it so that the normal thok and the homing thok are just with the jump button? I found an open assets mod that should do what you're asking for.
 
Last edited:
Would it be fine if I make it so that the normal thok and the homing thok are just with the jump button? I found an open assets mod that should do what you're asking for.
It's okay if you want, but I ended up fixing the error myself.
Post automatically merged:

It's okay if you want, but I ended up fixing the error myself.
Currently I want to make custom 2 auto jump the player to turn them super
Post automatically merged:

Hello Dodobee, I'm having an issue when making the Lua for super sonic being custom 2 after a jump, without using character abilities. Here's the code

addHook("PlayerThink", function(player) if player.mo.skin ~= "sonic" then return end if (player.pflags & PF_JUMPED) and not (player.pflags & PF_THOKKED) and (player.cmd.buttons & BT_CUSTOM1)
P_DoSuperTransformation (player_t player) S_StartSound(player.mo, sfx_supert) player.pflags = $|PF_THOKKED end player.charability = CA_HOMINGTHOK --this changes sonic's main ability to the homing thok end)
 

Attachments

  • Screenshot_20240415-003432.png
    Screenshot_20240415-003432.png
    132.2 KB · Views: 22
  • supertest.txt
    577 bytes · Views: 24
Last edited:
Okay guys, I've fixed tried fixing the error, I added 2 'end' for the 'if' and in still getting the same error, saying i need to fix something in line 9.
If you can spot it tell me how to fix it
 

Attachments

  • supertest.txt
    469 bytes · Views: 18
Found th3 problem
Post automatically merged:

Here is it
Don't mind the name
Post automatically merged:

Press c1
 

Attachments

  • 1(1)(1)(1)(1)(1)(1)(1)(1)(1)(1)(1)(1).lua
    467 bytes · Views: 20
  • srb20017.gif
    srb20017.gif
    5.4 MB · Views: 28
Last edited:

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

Back
Top