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.
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)
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)
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)
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)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.