How can you make shields drown the player?

Sls64LGamingBro

An ordinary coder...
I'm trying to keep the bubble shield from drowning. And I don't know how it works exactly, I've used SH_PROTECTWATER so that it can work with p.powers[pw_underwater].

I'll show you the code if anything is wrong with this. You can help me adjust the code.

Code:
addHook("PlayerThink", function(p)
    if (p.powers[pw_shield] & SH_PROTECTWATER)
        p.powers[pw_underwater] = 0
    end
end)
 
Just wanting to make this thread alive, considering it hasn't been noticed by anyone yet. But still, I'm trying to make the bubble shield be useless underwater, and can drown you.
 
I'm trying to keep the bubble shield from drowning. And I don't know how it works exactly, I've used SH_PROTECTWATER so that it can work with p.powers[pw_underwater].

I'll show you the code if anything is wrong with this. You can help me adjust the code.

Code:
addHook("PlayerThink", function(p)
    if (p.powers[pw_shield] & SH_PROTECTWATER)
        p.powers[pw_underwater] = 0
    end
end)


Not exactly sure on this either, but if I were to take an educated guess I'm assuming hard-setting pw_underwater to 0 every thinkframe is somehow preventing the player from drowing since it'll never tick down anyway? (I'm not familiar with how that power works so this could be a very long shot)

Either that or the game is hardcoded to ignore pw_underwater while having a Bubble/Elemental shield, which would be the worst scenario.

You could try setting it to -1 and see if that works but if it doesn't I'm out of ideas myself.
 

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

Back
Top