Zet0rz / nzombies

A GM13 Nazi Zombies style (WIP) gamemode
GNU General Public License v3.0
73 stars 79 forks source link

Perk machines/Weapon buys/Barricades unable to be used if inside clip textures/invisible walls. #611

Open Ethorbit opened 6 years ago

Ethorbit commented 6 years ago

When I edit maps I use player clips instead of invisible walls (Because invisible walls sometimes block bullets and also blocks zombies, but that's for a different issue post). When the player clip or invisible wall is inside of a purchasable object, players cannot buy it. I'm going to assume this happens with traps too, but I wouldn't know since traps are completely broken and no one should ever use them.

minin43 commented 6 years ago

I don't know what you mean by "player clip."

But yes, you can't activate anything inside an invisible wall. That can't be changed, so work around it.

since traps are completely broken and no one should ever use them.

HAH.

Ethorbit commented 6 years ago

Takes a little Google search is all: https://developer.valvesoftware.com/wiki/Clip_texture Player clip is a texture that only collides with players. So you won't have a problem shooting through it like the invisible walls AND zombies can pass through it fine.

And yes, it can be changed. It requires extra code but it can be accomplished. I'm very positive there's a way to detect if the wall has a certain texture (tools/toolsplayerclip) and most likely a way to detect if the wall was made in the creative mode using the invisible wall tool.

Saying "that can't be changed" without backing up why makes no sense. Why can't that be changed?

minin43 commented 6 years ago

This is of my own understanding, so I'm open to being proven wrong, but from my own understanding, it has to do with the way the source engine handles entities and the use command of players. When you press E, you're pressing E on the thing that's closest to you. In the case of an object inside another, it's going to use the "use" command on the wall, since that's the first item in the list of "things closest to the player that are with the player's direct line of sight that are also within a certain range of the player."

You could work around it, I guess, by modifying the "use" command to (if it ever encounters an invisible wall) run GetEyeTrace() on the player, and get the first item in the returned table that isn't an invisible wall and run Use() on THAT (while also sending the item the player's information) but that's a lot of work for something that can instead just be avoided.

In my opinion.

Zet0rz commented 6 years ago

As far as the gamemode code goes, it should work like gmod itself does. It does fire an eye trace which may hit the invisible clip, but it shouldn't overwrite the engine result if this doesn't hit a door. I'm sure I can code the eye trace to ignore player clips though, just surprises me that they aren't already ignored by the engine?