Lua bug with internal flags

Status
Not open for further replies.

Lat'

Absolute territory where
Kart Krew™️
I know this is not a bug that can interfer with the gaming experience but, whatever.
I recently made a lua script to make the thok leave afterimages, it works well and everything. I used the PF_THOKKED internal flag to make it work, but somehow, this flag also applies for Tails and Knux when they use Fly or Gliding respectively, they make afterimages for uknow reasons.
I did same for the spin, it works well, as thok but afterimages also appear while using the Wind Shield's double jump. Here is the code in case it's needed

Code:
//This Lua lump gives player afterimages for using some abilities.

//Give afterimages if spinning and thokking
addHook("ThinkFrame", do
	for player in players.iterate
		if not player.mo continue end
			if (player.pflags & [B]PF_THOKKED[/B])
			or (player.pflags & [B]PF_SPINNING[/B])
			P_SpawnGhostMobj(player.mo)
		end
	end
end)
 
Last edited by a moderator:
if you want it to only work for sonic, it should look more like this

Code:
//This Lua lump gives player afterimages for using some abilities.

//Give afterimages if spinning and thokking
addHook("ThinkFrame", do
    for player in players.iterate
        if (player.mo and player.mo.skin == "sonic")
            if (player.pflags & [B]PF_THOKKED[/B])
            or (player.pflags & [B]PF_SPINNING[/B])
                    P_SpawnGhostMobj(player.mo)
            end
        end
    end
end)
 
Last edited:
No, this is not the point, the flag checked is PF_THOKKED, but for some reasons, this flags seems used for Tails & Knux while they're performing fly or glide, I perfectly know how I can make it apply only for Sonic.
 
in that case its not a bug. PF_THOKKED checks for when a character uses their ability, no matter the ability. maybe check for the characters ability?
 
But then this flag should be renamed or something? Because when I saw PF_THOKKED, I thought this was a "Thok exclusive" flag. They should rename it to PF_ABILITY or something. Anyways, if that's not a bug then I guess we can close this?
 
Status
Not open for further replies.

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

Back
Top