Product Chat / Far Superior To An Invisible Wall!

Author
Message
lordjulian
10
Years of Service
User Offline
Joined: 10th Jan 2014
Location:
Posted: 7th Nov 2015 23:13
I needed to restrict the player to a specific area. It took me a while to work out how but I'm quite proud of the solution I worked out because it is simple, so I thought I'd share. I know many of you will already know this:


1. Set a Trigger Zone and stretch it using the nodes, to create a barrier across which you don't want the player to go.
2. In the 'Ifused' field of the Trigger Zone type, say, 'Boundary'.
3. Change the Trigger Zone's Lua script to transportinzone.lua (which can be found in the scriptbank folder).
3. Place a small dynamic entity somewhere in a place just before the player can reach the Trigger Zone and make it 'always active'.
5. Change the name this entity to match the 'Ifused' of your Trigger Zone (in this case, 'Boundary').

Now, when the player tries to cross your Trigger Zone/boundary, he will be pulled back to the location of your specified entity (in this example named 'Boundary').

Simples.

I know games design books (such as Scott Rogers' excellent manual) tell you it's bad form to make invisible walls or restrictions, but hey, sometimes you have to.
Julian
PM

Login to post a reply

Server time is: 2024-05-05 20:32:52
Your offset time is: 2024-05-05 20:32:52