How can I make this exit work?

drew081886
I'm creating my first game and I have a pretty good grasp on a lot of the basic concepts but I just can't, for the life of me, figure out how exits work. Here is my scenario: There is a wall. On that wall there is a loose brick. The brick can be pried away using a tool. Once pried away it exposes a hole. This hole is the exit. How would I make that function as an exit? I've been fooling around with it forever and I just can't seem to figure it out. Any help would be appreciated.

The Pixie
Create an exit as normal. Then click on it in the left pane. On the right, untick "visible" and give the exit a name, say "exit_hole_in_wall".

Then in the brick prying command, add a script to set the "visible" flag for "exit_hole_in_wall":
Set flag [object] [exit_hole_in_wall] [flag name] [visible]

In code:
exit_hole_in_wall.visible = true

HegemonKhan
I'm not that familiar with the GUI~Editor, so you'll have to figure out how to do~find this within the GUI~Editor, its Tabs, and its drop down box menu options and etc. So, forgive the code references by me.

----------------------

there's two ways to move:

1. the 'Exit' ELEMENT: an individual one-way connector of Room Objects (though when you make~add them in the GUI~Editor, it toggle (there's a check box toggle option) defaults to make another~2nd Exit, so you can go back and forth between Room Objects)

2. using scripting (via within: Verbs ~ Object's 'Script' Attribute, Commands, Functions, Turnscripts, Timers, et), which have two different Scripts that you can use (in code):

moving_Object_name.parent=destination_Object_name
example: player.parent=room2
~OR~
MoveObject(moving_Object_name,destination_Object_name)
example: MoveObject(player,room2)

----------

so...

1. you can have an Exit 'name' (ID) String Attribute as 'whatever', and have the Exit 'alias' String Attribute as 'hole' for the person to see during their playing of the game, which has the Attribute set as (to make it initially hidden), in code it looks like this:

Exit_name.scenery=true
~OR~
Exit_name.visible=false

and then, such as Pixie already guides you in his~her post above, you have scripting that unhides~reveals your Exit:

Exit_name.scenery=false
~OR~
Exit_name.visible=true

2. and~or, if you wish to use the 'lock~unlock' feature, there's that too.

3. you can create the Exit in scripting, though this is a bit more advanced.

4. you can have your 'hole' be an Object, and use scripting (such as within using a Verb), to move your 'player' Player Object to another Room Object. (not using an Exit at all).

-------

useful links for you:

http://docs.textadventures.co.uk/quest/
http://docs.textadventures.co.uk/quest/ ... notes.html
http://docs.textadventures.co.uk/quest/ ... quest.html
http://docs.textadventures.co.uk/quest/ ... ments.html
http://docs.textadventures.co.uk/quest/tutorial/
http://docs.textadventures.co.uk/quest/guides/
viewforum.php?f=18 (more guides: Libraries and Code Samples)
http://docs.textadventures.co.uk/quest/elements/ (the main 'physical things' of quest)
http://docs.textadventures.co.uk/quest/types/ (Attribute's Types: Attributes)
http://docs.textadventures.co.uk/quest/functions/ (category order. Scriptings)
http://docs.textadventures.co.uk/quest/ ... tions.html (alphabetical order. Scriptings)
http://docs.textadventures.co.uk/quest/scripts/ (Scriptings)
http://docs.textadventures.co.uk/quest/scopes.html

http://docs.textadventures.co.uk/quest/ ... bject.html
http://docs.textadventures.co.uk/quest/ ... arent.html
http://docs.textadventures.co.uk/quest/ ... /exit.html
http://docs.textadventures.co.uk/quest/ ... enery.html
http://docs.textadventures.co.uk/quest/ ... sible.html
http://docs.textadventures.co.uk/quest/ ... ocked.html
http://docs.textadventures.co.uk/quest/ ... kable.html
http://docs.textadventures.co.uk/quest/ ... sited.html

http://docs.textadventures.co.uk/quest/ ... nexit.html
http://docs.textadventures.co.uk/quest/ ... gexit.html
http://docs.textadventures.co.uk/quest/ ... exits.html
http://docs.textadventures.co.uk/quest/ ... _game.html (scroll down to 'adding an exit' section)
http://docs.textadventures.co.uk/quest/ ... jects.html (scroll down to read about the 'scenery' section)
http://docs.textadventures.co.uk/quest/ ... _game.html (it talks about Exits)
http://docs.textadventures.co.uk/quest/ ... _game.html (talks a bit about moving Objects around)
http://docs.textadventures.co.uk/quest/ ... exits.html (lockable Exits)
http://docs.textadventures.co.uk/quest/ ... iners.html (lockable containers~Objects)

ask if you got any questions or need any help!

-------------

Quest (and really any programming language too) has a 'tri-structure', just like the real world and human languages:

1. your 'physical things', your 'matter', your 'nouns' ==== Quest's Object-Oriented Code Structure's OBJECTS: ELEMENTS (Objects, Exits, Verbs, Commands, Functions, Turnscripts, Timers, Object Types, and etc): http://docs.textadventures.co.uk/quest/elements/

the ELEMENTS are your 'containers'...

Objects can hold other Objects and~or Attributes
Verbs and Functions can hold Scriptings
Exits, Commands, Turnscripts, and Timers can hold Attributes and Scriptings
Object Types can hold Attributes and~or other Object Types

2. your 'data', your 'traits~characteristics~properties', your 'adjectives~adverbs' ==== Quest's ATTRIBUTES (Strings, Integers, Doubles~Floats~Floating Points, Booleans, Scripts, Lists, Dictionaries, etc): http://docs.textadventures.co.uk/quest/types/

the ATTRIBUTES are a median~cross, between~shares with from both, ELEMENTS and Scriptings, they're also containers, but they hold~are the 'properties'~'traits'~'characteristics' of your ELEMENTS and~or make up your SCRIPTINGS. It's hard to describe exactly what Attributes are, lol...

3. your 'actions~events', your 'energy~forces~waves', your 'verbs' ==== Quest's Scriptings (too diffifult to list+explain... 'if', 'set', etc etc etc):

http://docs.textadventures.co.uk/quest/functions/ (category order. Scriptings)
http://docs.textadventures.co.uk/quest/ ... tions.html (alphabetical order. Scriptings)
http://docs.textadventures.co.uk/quest/scripts/ (Scriptings)
http://docs.textadventures.co.uk/quest/ ... cript.html (Scripts: Scriptings)

the SCRIPTINGS are literally your code line(s)~block(s) of doing actions~events, they DO~CHANGE~ALTER~SET~RE-SET~ADD~REMOVE~ETC stuff. pretty self explanatory.

in the GUI~Editor, SCRIPTINGS are your:

run as script -> add a~new script -> (select your scripts ~ set them up)
--- AND~OR ---
'whatever' Object -> Attributes Tab -> Attributes -> Add -> (see~set it up below)

(Object Name: whatever)
Attribute Name: whatever
Attribute Type: Script (this must be Type:Script, or it's not a SCRIPTING, but instead just an Attribute)
Attribute Value: (write~craft~select your scripts or scripting code lines)

drew081886
Thanks guys. I decided to go the route of not using an actual exit and just using scripting to move the player to the next room when they interact with the hole. It worked for me. I have zero experience with coding so I'm trying to stick to the GUI for now and pick up a bit of coding as a I go along, so this seemed the easiest way for my purposes. Frankly, learning the language is a very daunting task that I'm not prepared to tackle just yet. Thanks for the extensive advice. I'm sure it will come in handy later when I start to really learn the language.

The Pixie
Glad you worked something out, but what happens if the player goes back to that room. Will she be able to go through the hole a second time?

drew081886
In my game there is no reason to go back to the first room once you're out so I didn't worry about that. I'll try to explain how I did it as best I can. In the first room there is a wall. I set the wall to be a container (surface) containing a loose brick that, when pried away, exposes the hole. I set it so that the loose brick and the hole are only visible if the player is looking at the wall. Since the wall does not exist in the next room, you can't look at it, and therefore can't see the hole and can't climb back through it. Does that make sense? I wish I could explain it more clearly.

The Pixie
Makes sense. If the player cannot get back, then your way is absolutely fine.

XanMag
It's really interesting to see how different people solve similar problems. I would have used the use tool on brick to unlock the exit you wanted with a message posted pre-post- trying the exit. I guess it's not too dissimilar to what pixie suggested. Always two ways (or more) to skin a cat!

Sounds like you create games like me. Feel free to PM me anytime and I'll be glad to give you whatever meager advice I can offer!

Happy gaming!

HegemonKhan
if~when elsewhere in your game if you do want~need to be able to go back to a previous Room, create~do the same setup that you did with your starting room, to go back, hehe.

room1 -> room1's Object's Verb's 'move~parent' scripting -> room2

room2 -> room2's Object's Verb's 'move~parent' scripting -> room1

drew081886
I will probably eventually go back and do my exits in the more "traditional" way at some point. They do function the way I need them to using the solution I did but I still will need to learn to create "proper" exits at some point. I like to think of the current game I'm creating as a sort of "rough draft." The final version will be different as I learn new ways to do things and solve problems.

XanMag wrote:It's really interesting to see how different people solve similar problems. I would have used the use tool on brick to unlock the exit you wanted with a message posted pre-post- trying the exit. I guess it's not too dissimilar to what pixie suggested. Always two ways (or more) to skin a cat!

Sounds like you create games like me. Feel free to PM me anytime and I'll be glad to give you whatever meager advice I can offer!

Happy gaming!


I do hope you're serious about that offer because I may take you up on it at some point. :)

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

Support

Forums