Walls!

Im not great at lua, but I know enough to where if you point me in the right direction, and give me a bit of a push, I should be able to figure this out.

So…Im working on a gamemode in which 2 teams need to be segregated. The first way to do this that came to mind was to define team zones, and run the positions of the players against these zones. The player would be killed if they were in the opponents zone. I’d like to give the players some sort of physical boundary so that they could understand that the other side is off limits without being slaughtered. I’d like for, at some point, for one of the teams (we’ll call it team 1) to be able to walk in to team 2’s zone, but not for team 2 to walk into team 1’s zone. I’m sure this has been asked before, but as we all know, the fp search doesn’t work…So if you guys could point me in the right direction on how to pull this off, it would be most appreciated.

tl:dr- How can I make those walls like the ones that sassafrass uses

You can make a wall model and spawn entities with that model around your map.

well thats…easy…Is that the best way? The thing im concerned about is the complexity of the map. This is not a flatgrass sort of map. Also, would this wall setup allow me to permit one team to cross but bar one team?

I’ve never played Sassafrass before, how do you want the players to cross the wall? Over? Around? Through?

I’m pretty sure theres a hook somewhere that’ll let you disable collisions for one team… I’ll see if i can find it for you

[editline]08:15PM[/editline]

http://luasearch.overvprojects.nl/index.php?keywords=Gamemode.ShouldCollide

Not sure if that works on players, but it should

[editline]08:22PM[/editline]

[lua]function GM:ShouldCollide( Ent1, Ent2 )
if( Ent1 == WallEntity ) then
if( Ent2:IsPlayer() ) then
if( Ent2:GetTeam() == “Team1” ) then
return true
else
return false
end
end
elseif( Ent2 == WallEntity ) then
if( Ent1:IsPlayer() ) then
if( Ent1:GetTeam() == “Team1” ) then
return true
else
return false
end
end
end
end[/lua]

Should work, but it’s late so don’t quote me on it.

[editline]08:24PM[/editline]

Oh and, having a few of the walls shouldn’t be too bad if they are frozen.

(sorry for so many edits)

Make the wall entities sents, not prop_physics. That way, in ENT:Initialize, you can do:


self:SetMoveType( MOVETYPE_NONE )

And yes, ShouldCollide will work on players and will allow you to make 1 team but not another nocollide with the wall.

This man speaks the truth. And i just assumed that he’d make it a sent

Thanks for the help guys. This seems like a delightful way to get the job done