Wall Check

[Open Assets] Wall Check v1.1

This content may be freely modified and/or maintained by anyone.

Buggie

Play OneShot
2023 Collaborator
BuggieTheBug submitted a new resource:

Wall Check - Source Code-based wall checking

A wall check that is from Source Code (maybe most of it) with some slight changes

There are example hooks included to show if you are touching the wall.
View attachment 89803View attachment 89804View attachment 89805


Also another thing to note is that P_IsClimbingValid is weird.
So on Impassable lines it would do something but wouldn't work for certain walls (gif above)
But without it you can check impassable walls but it WOULD work for the certain...

Read more about this resource...
 
Any way to check if you aren't touching a wall anymore?
Trying to do a wall running similar to Pizza Tower, i just need to find a way to see if the player reached the top of a wall to then continue running
 
Hello! Just wanted to mention, "and or" statements in SRB2 Lua are kinda borked.
Fix:
-- ((li.backsector and li.backsector.valid) and P_IsClimbingValid(slidemo.player, climbangle) or true)
-- Workaround is changing this to an if
canclimb = true
if((li.backsector and li.backsector.valid))then
    canclimb = P_IsClimbingValid(slidemo.player, climbangle)
end

Without this fix, everything done by "P_IsClimbingValid" is ignored, as if it returns false, it immediately chooses the true right after or. Allowing you to temporarily climb onto sky walls, or any other invalid surface.

I found out the hard way... ;w;

As a bonus, recreations of internal functions that are missing from this recreation.
Internal Functions Recreated in Lua from C.:
local function P_GetFFloorTopZAt(ffloor,x,y)
    return P_GetZAt(ffloor.t_slope,x,y,ffloor.topheight)
end

local function P_GetFFloorBottomZAt(ffloor,x,y)
    return P_GetZAt(ffloor.b_slope,x,y,ffloor.bottomheight)
end

local function P_GetSectorFloorZAt(sector,x,y)
    return P_GetZAt(sector.f_slope,x,y,sector.floorheight)
end

local function P_GetSectorCeilingZAt(sector,x,y)
    return P_GetZAt(sector.c_slope,x,y,sector.ceilingheight)
end

Though in reality you can just place P_GetZAt directly on the equal statements since they are only used once or twice.
I hope this helps! Sorry for getting a bit rambley ive been going insane over this for a bit lol.
 

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

Back
Top