G_PlatformGametype and G_RingSlingerGametype don't flag Match properly

Status
Not open for further replies.

wolfs

Watch Symphogear
Administrator
Sonic Team Junior
Kart Krew™️
Judge
I'm attempting to put restrictions on a lua ability that exist in match, but don't exist in platform gametypes like co-op and race. Yet part of my script, namely the part that manipulates S_SKIN values, is still executed in match anyways.


Example script for reproduction purposes:

Code:
addHook("ThinkFrame", do
    for player in players.iterate
        if player.mo and player.mo.skin == "sonic"
        and G_PlatformGametype()
        and not G_RingSlingerGametype()
            player.jumpfactor = 3*FRACUNIT
        end
    end
end)
 
Last edited by a moderator:
Invalid. You problem is that player.jumpfactor's value carries over into Match straight from Coop or whatever you tested the change in.
 
It seems that the problem is that the player information is not reset when you switch game types. This means that if you go from co-op to match it will keep the higher jump. Here's an example of what you can try to fix it.

Code:
addHook("ThinkFrame", do
    for player in players.iterate
        if player.mo and player.mo.skin == "sonic"
        and G_PlatformGametype()
        and not G_RingSlingerGametype()
            player.jumpfactor = 3*FRACUNIT
        else
            player.jumpfactor = skins[player.mo.skin].jumpfactor
        end
    end
end)
 
Last edited:
It seems that the problem is that the player information is not reset when you switch game types. This means that if you go from co-op to match it will keep the higher jump. Here's an example of what you can try to fix it.

Code:
addHook("ThinkFrame", do
    for player in players.iterate
        if player.mo and player.mo.skin == "sonic"
        and G_PlatformGametype()
        and not G_RingSlingerGametype()
            player.jumpfactor = 3*FRACUNIT
        else
            player.jumpfactor = skins[player.mo.skin].jumpfactor
        end
    end
end)
Just attempted this when going from co-op to match. Did not work as intended, however it did work properly when testing in CTF.
 
Status
Not open for further replies.

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

Back
Top