• 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 !

I pressed all three custom buttons and it doesn't work.

The first one is with The second one is with And the third one is obviously
Custom 1. Custom 2. with Custom 3.
 

Attachments

  • srb20001.gif
    srb20001.gif
    7.1 MB · Views: 73
  • srb20002.gif
    srb20002.gif
    4.3 MB · Views: 87
  • srb20003.gif
    srb20003.gif
    4.9 MB · Views: 81
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

The P_NukeEnemies takes, in order:
- An inflictor as a mobj, as in "what is the object that caused the nuke?"
- A source as a mobj, as in "what is the object that fired the inflictor?"
- A radius as a fixed-point number, as in "how far can the attack reach?"

Inflictor and source may be the same mobj, if for example a player causes the nuke.

All you did was just change mobj_t to skin.
Lua has no idea what does that mean.
 
The P_NukeEnemies takes, in order:
- An inflictor as a mobj, as in "what is the object that caused the nuke?"
- A source as a mobj, as in "what is the object that fired the inflictor?"
- A radius as a fixed-point number, as in "how far can the attack reach?"

Inflictor and source may be the same mobj, if for example a player causes the nuke.

All you did was just change mobj_t to skin.
Lua has no idea what does that mean.
soooooo i have to do this:
Lua:
          P_NukeEnemies(player, 10*FRACUNIT )

so the player is the mobj right ?
and the radius i just have to put a number, then *FRACUNIT right ?
also, im confused to where to put the missing end at.
I pressed all three custom buttons and it doesn't work.

The first one is with The second one is with And the third one is obviously
Custom 1. Custom 2. with Custom 3.
yehhhh you may have to do the thok.


welp time to do some big rewrites
 
okey heres the thing redid version.
i expect there to be error messages in the console.
Post automatically merged:

okey heres the thing redid version.
i expect there to be error messages in the console.
ok, through looking through the hyper abilities code, ive redid the code.
okey time to pley srbx
 

Attachments

  • ArmaBlast-v1.2.lua
    346 bytes · Views: 54
  • ArmaBlast-v1.3.lua
    394 bytes · Views: 75
Last edited:
soooooo i have to do this:
Lua:
          P_NukeEnemies(player, 10*FRACUNIT )

so the player is the mobj right ?
and the radius i just have to put a number, then *FRACUNIT right ?
also, im confused to where to put the missing end at.

For the first one, kiiiind of. player here is a variable of type player_t, but you need a variable of type mobj_t. And not only just that, but you need two of them at the start.

For the second, yes, it's a number multiplied by FRACUNIT.

Seems like you solved these already, though.

As for the last one, you need an end for every function/if/for/while/repeat/(others?) in your script.

1643654828861.png


As you can see, you have a function, a for and one if.
But you only have two ends: one for the first function and another for the for.
Because of this, Lua has no idea when does the last if end, and it won't do what you want.


By the way:
- G_PlatformGametype is still a function. You should be calling it: G_PlatfomGametype()
- Looks like you changed the hook type to ThinkFrame. That works!
- A player that is somehow not in the game (spectating or otherwise) has no mo field. You should probably check that the player does indeed have a mo before trying to use it.
 
Still don't work.
for the v1.3, press c1 to do the blast. i fixed alot of things now.
Post automatically merged:

okey i finally redid the script, i think i fixed most of it
still gotta be in super and do custom 1
Post automatically merged:

ok since this in the wips section
i decided to do some more on this.
imma call this super abilities.

basically gives everyone more abilities for super. (requires super lua to work)
i cant upload a pic rn but when i get home i will.
Post automatically merged:

since im working on a super forms script, i decided to post a the lua here.
if you can, can u point out what wrong with the lua ?
thanks.

superabilitiesv1:
--Super Abilities by ZxyroGaming(Arch)
--Note, some scripts require VL_super-v4.lua since some skins cant transform.

--Thanks to RapidGame7 for helping me out through some stuff. I would never have gotten this far without him.

--Super Sonic Chaos Burst
addHook("ThinkFrame", function(player)
     if player.mo and player.mo.skin == "sonic"
     and player.powers [pw_super]
     and (player.cmd.buttons & BT_CUSTOM1)
     and G_PlatformGametype() then
          P_NukeEnemies(player.mo, player.mo, 2048*FRACUNIT)
          P_GivePlayerRings (player.mo, player, -10)
          P_Earthquake(player.mo, player.mo, 2048*FRACUNIT)
     end
end)

--Super Sonic Nuke Thok
addHook("AbilitySpecial", function(player)
    if player.mo and player.mo.skin == "sonic"
    and player.powers[pw_super]
    and not player.pflags & PF_THOKKED then
        P_NukeEnemies(player.mo, player.mo, 2048*FRACUNIT)
        S_StartSound(player.mo, sfx_zoom)
    end
end)

--A G G R E S I V E T R A N S F O R M A T I O N
--hes so powerful he causes a earthquack quack.
--hey have you ever thought: how powerful would knuckles be if he was in his super form ?
addHook("ThinkFrame", function(player)
    if player.mo and player.mo.skin == "knuckles"
    and player.powers[pw_super]
    and (player.cmd.buttons & BT_CUSTOM2)
    and not P_IsObjectOnGround(player) then
        P_DoSuperTransformation(player.mo)
        P_Earthquake(player.mo, player.mo, 1000*FRACUNIT)
        P_StartQuake(1000*FRACUNIT, 2*TICRATE)
    end
end)
 

Attachments

  • ArmaBlast-v1.4.lua
    433 bytes · Views: 75
Last edited:

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

Back
Top