[deleted user2]
Member
I was trying to make an always underwater script for personal use but I've noticed that no matter what I seem to do, the game always ignores the changes when I'm on land.
I'm using CONS_Printf to tell me if the script is working or not, and it seems to work only when in a body of water (go figure). On level start, it gets set to 0 and never changes until I enter water.
Removing everything other than "player.powers[pw_underwater] = 1050" will lock the player's drowning timer at 1049 when entering a body of water.
Here's the Script:
addHook("ThinkFrame", do
for player in players.iterate
if (player.mo and player.mo.valid)
CONS_Printf(player, player.powers[pw_underwater])
if (player.powers[pw_underwater] == 0)
and not (player.powers[pw_underwater] >= 1 and (player.powers[pw_underwater] <= 1050))
player.powers[pw_underwater] = 1050
end
end
end
end)
I'm using CONS_Printf to tell me if the script is working or not, and it seems to work only when in a body of water (go figure). On level start, it gets set to 0 and never changes until I enter water.
Removing everything other than "player.powers[pw_underwater] = 1050" will lock the player's drowning timer at 1049 when entering a body of water.