How can I make some sort of dance or taunt for my custom SKIN?

luigi budd

luigi butt
Hey there, I wanted to add some sort of dance to my character that you could pull off anywhere, sorta like Dirk in Team Kinetic or Milne in Horizon Chars. If anyone could help me with coding some Lua script with my limited knowledge of it, or just any help in general would be greatly appreciated!
 
Super simple, make a PlayerThink hook and make the function player. Check for player.mo and player.mo.skin = your character. Have a player.cmd.buttons check with, for example, BT_CUSTOM1. If this check returns true, then your character should enter a custom state that uses PF_FULLSTASIS and your dance sprites.

There's probably a better way to explain this, so take it with a grain of salt.
 
Super simple, make a PlayerThink hook and make the function player. Check for player.mo and player.mo.skin = your character. Have a player.cmd.buttons check with, for example, BT_CUSTOM1. If this check returns true, then your character should enter a custom state that uses PF_FULLSTASIS and your dance sprites.

There's probably a better way to explain this, so take it with a grain of salt.
Thanks for the advice, but how can I make a state that uses PF_FULLSTASIS?
 
Thanks for the advice, but how can I make a state that uses PF_FULLSTASIS?
Assuming you know how to define a state, it should just be "player.mo.state = (your state)" and underneath that, "player.pflags = $1|PF_FULLSTASIS" (that's probably wrong, I'm away from my computer rn so can't check the actual syntax)
 
Assuming you know how to define a state, it should just be "player.mo.state = (your state)" and underneath that, "player.pflags = $1|PF_FULLSTASIS" (that's probably wrong, I'm away from my computer rn so can't check the actual syntax)
I can't seem to get my character to go in complete stasis. I have put my state before the stasis flag, but even then my character can still move around willy-nilly.

Here's the code and an example of what I mean.
Lua:
freeslot("S_PLAY_SOAP_TAUNT")

states[S_PLAY_SOAP_TAUNT] = {
    sprite = SPR_PLAY,
    frame = SPR2_CLMB|FF_ANIMATE,
    var2 = 2,
    tics = 2*TICRATE,
    nextstate = S_PLAY_SOAP_TAUNT
}

addHook("ThinkFrame", function()
    for player in players.iterate do
        if player.mo.skin ~= "soapthehedge" then
            continue
        end

        if not (player.cmd.buttons & BT_CUSTOM1) then
            player.spintapready = true
            player.spintapping = false
        elseif player.spintapready
            player.spintapping = true
            player.spintapready = false
        else
            player.spintapping = false
        end

        if player.spintapping and P_IsObjectOnGround(player.mo) then
            player.mo.state = S_PLAY_SOAP_TAUNT
            player.pflags = $|PF_FULLSTASIS --i couldve sworn this would work
        end
    end
end)

srb20004.gif

(him going tiny is the taunt)

Any help would be very much appreciated.
Post automatically merged:

I can't seem to get my character to go in complete stasis. I have put my state before the stasis flag, but even then my character can still move around willy-nilly.

Here's the code and an example of what I mean.
Lua:
freeslot("S_PLAY_SOAP_TAUNT")

states[S_PLAY_SOAP_TAUNT] = {
    sprite = SPR_PLAY,
    frame = SPR2_CLMB|FF_ANIMATE,
    var2 = 2,
    tics = 2*TICRATE,
    nextstate = S_PLAY_SOAP_TAUNT
}

addHook("ThinkFrame", function()
    for player in players.iterate do
        if player.mo.skin ~= "soapthehedge" then
            continue
        end

        if not (player.cmd.buttons & BT_CUSTOM1) then
            player.spintapready = true
            player.spintapping = false
        elseif player.spintapready
            player.spintapping = true
            player.spintapready = false
        else
            player.spintapping = false
        end

        if player.spintapping and P_IsObjectOnGround(player.mo) then
            player.mo.state = S_PLAY_SOAP_TAUNT
            player.pflags = $|PF_FULLSTASIS --i couldve sworn this would work
        end
    end
end)

srb20004.gif

(him going tiny is the taunt)

Any help would be very much appreciated.
Wait, I just figured out that full stasis only activates when custom 1 is held, so I'll try and make a toggle for this.

oops
 
Last edited:
I can't seem to get my character to go in complete stasis. I have put my state before the stasis flag, but even then my character can still move around willy-nilly.

Here's the code and an example of what I mean.
Lua:
freeslot("S_PLAY_SOAP_TAUNT")

states[S_PLAY_SOAP_TAUNT] = {
    sprite = SPR_PLAY,
    frame = SPR2_CLMB|FF_ANIMATE,
    var2 = 2,
    tics = 2*TICRATE,
    nextstate = S_PLAY_SOAP_TAUNT
}

addHook("ThinkFrame", function()
    for player in players.iterate do
        if player.mo.skin ~= "soapthehedge" then
            continue
        end

        if not (player.cmd.buttons & BT_CUSTOM1) then
            player.spintapready = true
            player.spintapping = false
        elseif player.spintapready
            player.spintapping = true
            player.spintapready = false
        else
            player.spintapping = false
        end

        if player.spintapping and P_IsObjectOnGround(player.mo) then
            player.mo.state = S_PLAY_SOAP_TAUNT
            player.pflags = $|PF_FULLSTASIS --i couldve sworn this would work
        end
    end
end)

View attachment 76490
(him going tiny is the taunt)

Any help would be very much appreciated.
Post automatically merged:


Wait, I just figured out that full stasis only activates when custom 1 is held, so I'll try and make a toggle for this.

oops
can i use this code for the mod i make? i give you credit!
 
I can't seem to get my character to go in complete stasis. I have put my state before the stasis flag, but even then my character can still move around willy-nilly.

Here's the code and an example of what I mean.
Lua:
freeslot("S_PLAY_SOAP_TAUNT")

states[S_PLAY_SOAP_TAUNT] = {
    sprite = SPR_PLAY,
    frame = SPR2_CLMB|FF_ANIMATE,
    var2 = 2,
    tics = 2*TICRATE,
    nextstate = S_PLAY_SOAP_TAUNT
}

addHook("ThinkFrame", function()
    for player in players.iterate do
        if player.mo.skin ~= "soapthehedge" then
            continue
        end

        if not (player.cmd.buttons & BT_CUSTOM1) then
            player.spintapready = true
            player.spintapping = false
        elseif player.spintapready
            player.spintapping = true
            player.spintapready = false
        else
            player.spintapping = false
        end

        if player.spintapping and P_IsObjectOnGround(player.mo) then
            player.mo.state = S_PLAY_SOAP_TAUNT
            player.pflags = $|PF_FULLSTASIS --i couldve sworn this would work
        end
    end
end)

View attachment 76490
(him going tiny is the taunt)

Any help would be very much appreciated.
Post automatically merged:


Wait, I just figured out that full stasis only activates when custom 1 is held, so I'll try and make a toggle for this.

oops
Can I use this?
 

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

Back
Top