invisible barrier
by Brad Wilson · in Technical Issues · 01/10/2003 (5:46 am) · 8 replies
Does anyone know the best way to create an invisible barrier in a game? For example, if I don't want a player to be able walk up a mountain, or into a lake, etc... how do I prevent them from doing so? I know that I could create a NULL textured wall in QuArk and insert that into the game in multiple places, but that's an awful lot of objects. Anyone know of a better way to do it?
thanks.
thanks.
About the author
#2
01/10/2003 (7:53 am)
fantastic - this should work just fine. Thanks Chris.
#3
I've created a NULL textured wall in QuArk and inserted it around the lake and that works well except for two problems. One, the "invisible" walls cast shadows. And two, if i were to shoot something in the direction of the invisible wall, then it would hit it and that would look bad.
The last idea that i have is to not allow a player to walk on a surface with a certain slope. I know that in the player.cs file there is a parameter to stop a player from walking up certain slopes and that works fine.. but does someone know of a way to stop a player from walking down a certain slope? It would also have to stop the player from jumping over a certain slope as well.
Or does anyone have any other ideas as to how to do this? thanks!
01/17/2003 (6:25 am)
ok - i've got the code modified to allow the user to walk on any texture EXCEPT one texture that you specify.... but I don't like it. When i've got the texture surrounding a lake or something, it feels like the texture is holding me back as opposed to the lake itself. I've created a NULL textured wall in QuArk and inserted it around the lake and that works well except for two problems. One, the "invisible" walls cast shadows. And two, if i were to shoot something in the direction of the invisible wall, then it would hit it and that would look bad.
The last idea that i have is to not allow a player to walk on a surface with a certain slope. I know that in the player.cs file there is a parameter to stop a player from walking up certain slopes and that works fine.. but does someone know of a way to stop a player from walking down a certain slope? It would also have to stop the player from jumping over a certain slope as well.
Or does anyone have any other ideas as to how to do this? thanks!
#4
01/17/2003 (11:04 am)
You might try casting a ray straight down, and seeing if you hit water... If you do, then bump them back the way they came, sort of thing.
#5
07/07/2004 (7:26 am)
You might also try limiting the player based on elevation. Don't allow the player below the water level, also don't let them above a certain elevation. The only issue with the second part is that if your player can use jump jets, you don't want them to be hitting this invisible uppper limit, which will be more noticeable the further up the mountainside they go. The way around this is to perform your check for where they are permitted to go in X,Y based on their normal ground elevation. Now we have the problem of allowing them to jump jet over water... you can't win when you try to prevent players from doing things. They WILL notice.
#6
I need help getting an invisible wall, I've set up a few things that I need to make so the player can't jump over or go up or through them. I just need an invisible wall. I've gone through several forums and tried the suggestions making both an interior (in Constructor) and also a model (in milkshape) with texture NULL and neither works. It just shows up grey or pink in the level. What am I doing wrong?
Thanks in advance
10/22/2007 (8:27 am)
I know this thread is old but I can't figure it out,I need help getting an invisible wall, I've set up a few things that I need to make so the player can't jump over or go up or through them. I just need an invisible wall. I've gone through several forums and tried the suggestions making both an interior (in Constructor) and also a model (in milkshape) with texture NULL and neither works. It just shows up grey or pink in the level. What am I doing wrong?
Thanks in advance
#7
12/05/2007 (4:55 pm)
Actually, making an invisible wall is simple. Load your mission, press f11, then go to the World Editor Creator (f4). Next, click Mission Objects, Mission, and create a physical zone. Then switch to the World Editor Inspector. Click on the physical zone (if you don't know where the physical zone is, open the folder called SimGroup - MissionGroup at the top right corner and scroll all the way to the bottom), and change the scale to "1 10 10". Finally, find VelocityMod and change it to "-1.5". That should keep you back, but not your weapon bullet. Unfortunately, I don't know how to put a texture on it :-(
#8
It's about a half a year later but hey I am so glad I checked back on this old post
05/26/2008 (11:49 am)
Too awesome! Thanks Jamal it works GREAT!It's about a half a year later but hey I am so glad I checked back on this old post
Torque Owner Chris Walters
It's some sample code which restricts the player to a certain type of terrain texture - I'm sure it would be tweeked to your needs.