• Do not use Works in Progress as a way of avoiding the releases system! Works in Progress can be used for sharing early betas and for getting suggestions for improvement. Releases of finished content are not allowed in this forum! If you would like to submit a finished addon, click here for instructions on how to do so.

Super Abilities - My first LUA project !

Zxyrollix_Gaming

see my pfp ? i grabbed it off of a video.
So during my free time I made this script that allows you to do a armaggeddon blast by pressing custom 1.

Lua:
addHook("AbilitySpecial", function()
     for player in players.iterate do
          if player.mo.skin ~= "sonic"
          and player.powers [pw_super]
          and (player.cmd.buttons & BT_CUSTOM1)
          and G_PlatformGametype then
          P_NukeEnemies
          P_GivePlayerRings (player, -10)
          P_FlashPal (player, PAL_WHITE)
     end
end)

right now I cant test this out bc im not at home rn. not asking you to test it, I just need to know: is there anything I need to redo in this script ?
Feel free to reuse this in your mod, just credit me.
 
Last edited:
Ok. But quick thing, I personally think it would fit Chaos Knux, but I don't know if that's already there because I haven't played that mod in a while.
 
Oh because Chaos Blast. Cool. If Inazuma did this, along with lightdash and a different Chaos Control (but still keeping the old one in) with about a ten second cooldown, that would be cool.
He might do it. The chaos blast, not the lightdash.

Well since we are talkin about my lua thing, is there anything wrong with it ?
 
No, I think this is good! But there's no release, but I understand that since you're not working on it.
Ok ok ok. But one request. Can you test this out in srb2 and post a gif of it ?
BTW You'd have to be in your super form, and be sonic. And press Custom 1 to do the Blast.
 
So during my free time I made this script that allows you to do a armaggeddon blast by pressing custom 1.

Lua:
addHook("AbilitySpecial", function()
     for player in players.iterate do
          if player.mo.skin ~= "sonic"
          and player.powers [pw_super]
          and (player.cmd.buttons & BT_CUSTOM1)
          and G_PlatformGametype then
          P_NukeEnemies
          P_GivePlayerRings (player, -10)
          P_FlashPal (player, PAL_WHITE)
     end
end)

right now I cant test this out bc im not at home rn. not asking you to test it, I just need to know: is there anything I need to redo in this script ?
A couple things, yeah:

1) You're saying that this script would cause an armageddon blast on Custom 1 press, but you gated it in an AbilitySpecial hook (that is, it runs when a player performs their double jump ability). Perhaps you meant to use PlayerThink instead?

2) The AbilitySpecial hook (and by extension, PlayerThink too) already gives you a player to work with (i.e. the player that is performing the ability/thinking). You shouldn't be iterating through players, you'll cause the snippet to run multiple times for every player, and that is usually something you do NOT want.

3) P_NukeEnemies is a function. You need to call it by suffixing two parentheses with all the information the function requests in between:
P_NukeEnemies(mobj_t inflictor, mobj_t source, fixed_t radius)
G_PlatformGametype is also a function.

4) P_FlashPal is missing some required arguments in the call.

5) You're missing one end.

More about functions: https://wiki.srb2.org/wiki/Lua/Functions
More about hooks: https://wiki.srb2.org/wiki/Lua/Hooks

Good luck!
 
A couple things, yeah:

1) You're saying that this script would cause an armageddon blast on Custom 1 press, but you gated it in an AbilitySpecial hook (that is, it runs when a player performs their double jump ability). Perhaps you meant to use PlayerThink instead?

2) The AbilitySpecial hook (and by extension, PlayerThink too) already gives you a player to work with (i.e. the player that is performing the ability/thinking). You shouldn't be iterating through players, you'll cause the snippet to run multiple times for every player, and that is usually something you do NOT want.

3) P_NukeEnemies is a function. You need to call it by suffixing two parentheses with all the information the function requests in between:
P_NukeEnemies(mobj_t inflictor, mobj_t source, fixed_t radius)
G_PlatformGametype is also a function.

4) P_FlashPal is missing some required arguments in the function

5) You're missing one end.

More about functions: https://wiki.srb2.org/wiki/Lua/Functions
More about hooks: https://wiki.srb2.org/wiki/Lua/Hooks

Good luck!
Okay, thanks !
 
Sorry, I have no idea how to delete a post, so I'm just doing this, and I'll post some random ass video here.
 
Last edited:
Could you send me the file? That'd be the only possible way for me to do it.
My email is WOW NO
Do not give out your e-mail like that!
A spoiler tag doesn't deter anyone at all!

For starters, you don't need to give your e-mail to anyone for any reason.
You have private messages in this message board, even!

Second, it's a Lua script. A Lua script is literally a text file with a different extension.
You can just copy the script, paste it in a text file, save it with the .lua extension, and load it up in SRB2.
It's that easy.
 
Do not give out your e-mail like that!
A spoiler tag doesn't deter anyone at all!

For starters, you don't need to give your e-mail to anyone for any reason.
You have private messages in this message board, even!

Second, it's a Lua script. A Lua script is literally a text file with a different extension.
You can just copy the script, paste it in a text file, save it with the .lua extension, and load it up in SRB2.
It's that easy.
Ok. I'll just delete the post.
 
Did a little rewrite to this script
one line for the moment.
da little rewrite:
          P_NukeEnemies(skin inflictor, skin source, fixed_t radius)
keep in mind im still not good in lua
I'm a begginner
 

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

Back
Top