Spoiler:The friction coefficient is specified in TERRAIN
Spoiler:But he does not fulfil the condition, what should I do?
Moderator: GZDoom Developers
Spoiler:The friction coefficient is specified in TERRAIN
Spoiler:But he does not fulfil the condition, what should I do?
Code: Select all
if(owner && owner.GetFriction() == 0.8)
{
owner.A_Print("Sand Soul slows you down!");
}
If you use ...GetFriction() == 0.8, the code does not work properlyJarewill wrote: ↑Fri May 26, 2023 7:27 am Without specifying a pointer, you are checking the friction of the sector the item is in, but the item doesn't follow the player once picked up.
If you want to specifically check the player's current friction, use the owner pointer for both GetFriction and A_Print:Also for debugging purposes you can use console.printf() to print the current variable to the console: console.printf(""..owner.GetFriction());Code: Select all
if(owner && owner.GetFriction() == 0.8) { owner.A_Print("Sand Soul slows you down!"); }
Spoiler: