How do i make my SKIN make a dance?

Halenut15

Member
I dont know how everyone make a functional script on lua or something like that to make a working dance to their own skin.

I tried making one, but i failed, of course.

Thanks for the atention
 
Last edited:
This is a script that i use for my character for him to make an emote, the "skinname", S_PLAY_EXTRA, MT_EXTRA and play_extra are just examples. You can change the skinname but the rest needs to stay like this if you want it to be named ADNCE for example : S_PLAY_ADNCE.

Code:
local cv_extra = CV_RegisterVar({"play_extra", "On", CV_NETVAR, CV_OnOff})

freeslot("S_PLAY_EXTRA", "MT_EXTRA")

states[S_PLAY_EXTRA] = {SPR_PLAY, SPR2_CLMB, 5, nil, 0, 0, S_PLAY_EXTRA}

addHook("MobjThinker", function(mobj)
	if (mobj.valid) and (mobj.health)
		P_SpawnGhostMobj(mobj)
		P_KillMobj(mobj)
	end
end, MT_EXTRA)

addHook("PlayerThink", function(player)
	if player.mo and player.mo.valid and player.mo.skin == "skinname"
		//Detect when we press Toss Flag
		if not (player.cmd.buttons & BT_TOSSFLAG)
			player.skinnametosstapready = true
			player.skinnametosstapping = false
		elseif player.skinnametosstapready 
			player.skinnametosstapping = true
			player.skinnametosstapready = false
		else
			player.skinnametosstapping = false
		end
		
        if player.powers[pw_carry] == CA_NONE
            if player.extra
                player.panim = PA_DASH
                if player.skinnametosstapping
                    if player.mo.state == S_PLAY_EXTRA
                        player.mo.state = S_PLAY_STND
                    end
                    player.extra = false
                    P_RestoreMusic(player)
                else
                    if player.mo.state != S_PLAY_EXTRA
                        player.mo.state = S_PLAY_EXTRA
                    end
                    player.pflags = $|PF_FULLSTASIS
                end
            elseif player.skinnametosstapping
                player.extra = true
                P_PlayJingleMusic(player, "EXTRA", nil, true, JT_OTHER)
            end
        end
	end
end)

addHook("ShouldJingleContinue", function(player, musname)
	if true return end
	if musname != "EXTRA" return end
	if player and player.mo and player.mo.skin == "skinname" and player.pedxtra
		return true
	else
		return false
	end
end)

addHook("PlayerSpawn", function(player)
    if player.mo and player.mo.valid and player.mo.skin == "skinname"
        if player.powers[pw_carry] != CR_NIGHTSMODE then player.mo.state = S_PLAY_STND end
        player.extra = false
    end
end)

Then tell me if the script works or not soo i can fix it for you :>
 
Last edited:
Cool script! but there's one problem that I encountered, I tried to put a song for the emote and then change the name of the song inside of the script, but when I activated the emote it would just not find the .ogg file, resulting in a "lump not found" error when trying to load the music, is there any way to fix it?

Can I also ask what are the sprite names I need for a custom animation instead of the spinning animation?
 
Last edited:
Cool script! but there's one problem that I encountered, I tried to put a song for the emote and then change the name of the song inside of the script, but when I activated the emote it would just not find the .ogg file, resulting in a "lump not found" error when trying to load the music, is there any way to fix it?

Can I also ask what are the sprite names I need for a custom animation instead of the spinning animation?
Oof, this script is pretty old but I'll try to help you.

Well for the first problem you need to make sure the name of the ogg file is equal to the one listed on the scripts. For example if I had the name of the file "O__LEGS" this line of the script would need to be like this in order to work: P_PlayJingleMusic(player, "_LEGS", nil, true, JT_OTHER)

As for the second problem, you can have any that your character can or cannot use. You can even make a custom sprite name although you would need to freeslot it in order for it to work, like this for example:
freeslot("S_PLAY_EXTRA", "MT_EXTRA", "SPR2_CSTM")

I wasn't able to test this so if any problem occurs, you can report it to me.
 
ight cool, I managed to fix the audio issue, but I still had problems regarding the sprites, I did freeslot the emote sprites for it to work, I even tried to change this piece of code: states[S_PLAY_EXTRA] = {SPR2_EMOT, 0, 9, nil, 0, 0, S_PLAY_EXTRA}, I don't know if I had to change that or change something else, but either way I fixed most of the problems with the emote.
 
Last edited:

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

Back
Top