Exit to self?

Firstly, apologies if this has been discussed before but nothing came up in my initial searches.
In a game I am building, I have a maze - not original I know but the colleagues at work will be so confused (ha ha)
In this game I want to "loop to self" on an exit from one of the maze 'rooms' but the drop-down room options won't allow me to.
Any suggestions?
Many thanks - ADB


You mean an exit that leaves you in the same room?

I think you could do this by creating an exit going to that room, and then moving the exit into the same room. However, this is unlikely to be useful.

Going through an exit doesn't actually output anything. All it does is move the player object to the destination room.
When the player moves to a different room, the room description is automatically displayed.

So if the exit points to the same room, going through it will put the player in the room they're in, and display nothing to let the player know their command succeeded.

In this case, I think you don't want to move the player at all. You can give an exit a script to run instead of moving the player when they go through it. So you could set that script to:

ShowRoomDescription

This means that when the player tries to go in that direction, it will display the room description again without moving the player; which is what I think you would want to happen.

If there's any problems with that, let me know and I'll try to find an alternate solution or a way around them.


mrangel - your thinking is correct in that the end result would be that the person is still 'in situ'.
However, as a complete newbie to the system, I am still at a loss as to how to create a 'null' exit - so if in this room, North might lead him back (in this aspect, not moving) and I can create a script to run 'on leaving the room' as you have suggested. However the design system still wants me to create and select a destination from the drop-down list of all available rooms, which excludes the one that is current. Also, you said that it is possible to "give an exit a script to run instead of moving the player when they go through it". Is there a method to not move the player or am I misreading the semantics here in that both options (move/script) are mutually exclusive?
Regards
ADB


OK - got it sorted. (Like every man on the planet, reading a manual is beneath us!). The online help says that you cannot create an 'exit to self' BUT once the exit has been created, you can change the destination to ANYWHERE (ie including itself). Memo to self: Haven't you learned anything during your life about reading instructions?


I can create a script to run 'on leaving the room' as you have suggested

That will only work if he moves to a different room; I don't think that's helpful in this situation.

Also, you said that it is possible to "give an exit a script to run instead of moving the player when they go through it". Is there a method to not move the player

The key word is instead of. If you give an exit a script, it will not move the player.
In this case, the exit's destination is completely ignored, so it doesn't matter what the destination is set to.

both options (move/script) are mutually exclusive?

That should be the case.

If you want to run a script and move the player, then you'd need to make the script move them.


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums