Room/location names

OurJud
As I've mentioned on another thread, I'm having a bit of difficulty getting the game to understand the word 'lift'. I've called the room/exit 'elevator' in the description and while the game accepts 'go lift' when going from apartment to outside, it will not recognise the same word when trying to return, and the player has to use 'go elevator' instead.

Now, I have two elevators (elevator and elevator2). 'Elevator' takes you down, 'elevator2' takes you back up (because I couldn't figure out how to make the same elevator go both ways). In the alias for both, I have added the names 'elevator; lift', but it is only when entering the elevator from my apartment that the game accepts the command 'go lift'.

Anyway, that's not really what this thread is about. What I want is for someone to clear up how we get the game to recognise different names.

In my apartment I use non-directionals (just seems silly to me to have a description which says "You are in the bedroom. The bathroom lies to the east"). So to get from the bedroom to the bathroom, the player types 'go bathroom'. Now I'm not saying I'm having any difficult setting this up, and my game so far works how I want it to. But, I don't really understand how the game understands 'go bathroom'.

Is it simply the name you've given the room, or is it some alias you have to add somewhere? And if it is the alias, why doesn't my game understand 'go lift' for my second elevator?

HegemonKhan
the use of 'lift' as an noun-synomyn of~for 'elevator' may be having a possible conflict (if this exists as a default) with the default 'lift' Verb (such as in lifting a rock up).

(I'm using a very different approach then you, as I'm not sure what your approach is... pasting your entire game code ~ or unless you know what the entire relevent code is: ALL of the relevent code, then just that, but you likely don't know what's the relevent code, so just post your entire game code for now, until you learn code better. There's an infinite number of approaches, and within those approaches, an infinite number of methods~variations, so if you want the best help, based upon how you're trying to do it, then you'll need to provide your full game code, so we can see how you're trying to do it, as what people provide isn't always everything that is needed, for us to know what to do, and~or the way it is described isn't fully clear either, which is why posting your game code, is good, as it's directly what you're trying to do, which, we who can use code, will be able to know it, from the code, and fix it, helping you with the problems you're having, and explaining the things to you)

an example using a Command:

// there's many different variations~methods for using a Command, here's just one of them (kept it more simple for you, though this is probably not the best code as I just did this 'on the fly', lol):

<command name="elevator_command">
<pattern>elevator</pattern>
<script>
elevator_function
</script>
</command>

<object name="elevator_room_A">
<inherit name="editor_room" />
<alias>elevator</alias>
</object>

<object name="elevator_room_B">
<inherit name="editor_room" />
<alias>elevator</alias>
</object>

<object name="elevator_room_A1">
<inherit name="editor_room" />
<alias>first floor</alias>
</object>

<object name="elevator_room_A2">
<inherit name="editor_room" />
<alias>second floor</alias>
</object>

<object name="elevator_room_A3">
<inherit name="editor_room" />
<alias>first basement</alias>
</object>

<object name="elevator_room_A4">
<inherit name="editor_room" />
<alias>second basement</alias>
</object>

<object name="elevator_room_B1">
<inherit name="editor_room" />
<alias>first floor</alias>
</object>

<object name="elevator_room_B2">
<inherit name="editor_room" />
<alias>second floor</alias>
</object>

<object name="elevator_room_B3">
<inherit name="editor_room" />
<alias>first basement</alias>
</object>

<object name="elevator_room_B4">
<inherit name="editor_room" />
<alias>second basement</alias>
</object>

<function name="elevator_function">
if (player.parent.alias = "elevator") {
show menu ("Down or Up?", split ("down;up", ";"), false) {
direction_variable = ToString (result)
show menu ("1 or 2?", split ("1;2", ";"), false) {
quantity_variable = ToString (result)
if (player.parent.name = "elevator_room_A") {
if (direction_variable = "up" and quantity_variable = "1") {
player.parent = elevator_room_A1
} else if (direction_variable = "up" and quantity_variable = "2") {
player.parent = elevator_room_A2
} else if (direction_variable = "down" and quantity_variable = "1") {
player.parent = elevator_room_A3
} else if (direction_variable = "down" and quantity_variable = "2") {
player.parent = elevator_room_A4
}
} else if (player.parent.name = "elevator_room_B") {
if (direction_variable = "up" and quantity_variable = "1") {
player.parent = elevator_room_B1
} else if (direction_variable = "up" and quantity_variable = "2") {
player.parent = elevator_room_B2
} else if (direction_variable = "down" and quantity_variable = "1") {
player.parent = elevator_room_B3
} else if (direction_variable = "down" and quantity_variable = "2") {
player.parent = elevator_room_B4
}
}
}
}
} else {
msg ("Sorry, but you must be in an elevator, if you want to ride an elevator up or down, you know...")
}
</function>


if you want to use a 'elevator' Room Object's Verb, then I can quickly adjust this code for that, so let me know if you want this done, instead of using a Command.

OurJud
Thank you, HK, sorry I didn't explain my problem better.

I looked again, and it seems I needed to include the aliases of 'lift' and 'elevator' in the set-up tab for the exits as well as in the room itself. This is where I was going wrong. Now that I have included these aliases in the exits, both terms are accepted.

So let me just make sure I'm clear on this. If I want to create extra words for a room/exit, to make sure it accepts anything the player may feasibly use, I must put the aliases (separated with a semi-colon) in the set-up tab of BOTH the room AND the exit?

Now all I need to figure out is how to get it to understand the verb 'use' in the context of 'use lift'/'use elevator'. If I try adding 'use' in the verb tab of the room/exit, or in the list of verbs at the top of the left panel, I get told 'use' is already in use, and yet my game won't accept 'use lift'/'use elevator'.

I thought I'd figured this out when I suddenly realised I needed to set my elevator to 'Object and/or room' - so that the 'Use/Give' tab would be activated. I added the same script from the 'Room' tab to the 'Use/Give' tab, so that the same sequence would be played if the player typed 'use' instead of 'go', but when I run it, 'use lift/'use elevator' gets the response, "I can't see that."

I know I'm missing something blindingly obvious, but I don't know what.

Here's the entire code as I don;t know what part you need.

Just to reiterate, I'm now ONLY needing to find out why 'use lift/'use elevator' doesn't work.

<!--Saved by Quest 5.5.5328.26617-->
<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<include ref="dimsome.aslx" />
<include ref="ConvLib.aslx" />
<game name="cloud9">
<gameid>e55fa912-0986-479b-a1c1-bdd07ab89b48</gameid>
<version>1.0</version>
<firstpublished>2014</firstpublished>
<css><![CDATA[

<style type="text/css">
body {
line-height: 1.2em;
}

div#txtCommandDiv {
border:0;
background: no-repeat;
font-size:10px;
font-family:'Trebuchet MS', Helvetica, sans-serif;

}
input#txtCommand {
outline:none;
border:0;
font-size:10px;
margin:0;
padding:0;
max-width: 1000px;
}

</style>

]]></css>
<showtitle type="boolean">false</showtitle>
<enablehyperlinks type="boolean">false</enablehyperlinks>
<defaultfontsize type="int">11</defaultfontsize>
<setbackgroundopacity />
<backgroundopacity type="double">1</backgroundopacity>
<showpanes type="boolean">false</showpanes>
<showcommandbar />
<showlocation type="boolean">false</showlocation>
<showborder type="boolean">false</showborder>
<attr name="autodescription_youcansee" type="int">0</attr>
<attr name="autodescription_youcango" type="int">0</attr>
<attr name="autodescription_youarein_useprefix" type="boolean">false</attr>
<autodescription />
<setcustomwidth />
<customwidth type="int">1270</customwidth>
<setcustompadding />
<custompaddingright type="int">500</custompaddingright>
<custompaddingleft type="int">100</custompaddingleft>
<defaultfont>'Trebuchet MS', Helvetica, sans-serif</defaultfont>
<defaultwebfont>ABeeZee</defaultwebfont>
<defaultbackground>Black</defaultbackground>
<defaultforeground>LightGrey</defaultforeground>
<showdescriptiononenter />
<attr name="changeroom_newline" type="boolean">false</attr>
<attr name="autodescription_youarein" type="int">0</attr>
<cover>futurecity 2.jpg</cover>
<custompaddingbottom type="int">100</custompaddingbottom>
<echocommand />
<attr name="autodescription_youcango_newline" type="boolean">false</attr>
<appendobjectdescription type="boolean">false</appendobjectdescription>
<category>Sci-Fi</category>
<autodisplayverbs type="boolean">false</autodisplayverbs>
<start type="script">
</start>
<turnscript>
<enabled />
<script>
JS.eval ("$('div[id^=\"divOutputAlign\"]').css('opacity', '0.5');")
JS.eval ("getCurrentDiv().css('opacity', '1.0');")
</script>
</turnscript>
</game>
<verb name="wear">
<pattern>wear #object#</pattern>
<property>wear</property>
<defaulttemplate>DefaultWear</defaulttemplate>
</verb>
<command name="go">
<pattern type="string"><![CDATA[^enter (?<exit>.*)$|^go to (?<exit>.*)$|^go (?<exit>.*)$|^(?<exit>north|east|south|west|northeast|northwest|southeast|southwest|in|out|up|down|n|e|s|w|ne|nw|se|sw|o|u|d)$]]></pattern>
<unresolved>You can't go there.</unresolved>
<script>
if (exit.visible) {
if (exit.locked) {
msg (exit.lockmessage)
}
else if (exit.runscript) {
if (HasScript(exit, "script")) {
do (exit, "script")
}
}
else if (exit.lookonly) {
msg ("You can't go there.")
}
else {
game.pov.parent = exit.to
}
}
else {
msg ("You can't go there.")
}
</script>
</command>
<object name="intro">
<inherit name="editor_room" />
<description type="script"><![CDATA[
picture ("futurecity 3.jpg")
msg ("2145 and civilisation is not as it were. Cities are overcrowded and illegal narcotics rife. You can hardly blame these people, though – mind-drugs are just about their only escape from this hell-hole we call earth.<br/><br/>Most of the stuff out there is harmless enough; Virtual Dream Enhancers, Deep Sleepers, Instant Inebriates... but there's a new one on the market, and a particularity dangerous one at that. On the street, it goes by the name of Cloud9 - Trapemiumbenzodipotream if you want to get chemical. It's primary purpose is recreational, offering a euphoric high like nothing before, but the come-downs are devastating, triggering suicidal desires in many users, and unbridled aggression in others.<br/><br/>The enforcement department, such as they are, have turned a blind eye to the problem – no doubt paid off by the drugs developers, but there are many who want to see it gone for good.<br/><br/>One such man has good reason. He lost his daughter to the drug and is willing to pay good money to anyone who can bring the production of Cloud9 to a stop, by whatever means possible. He doesn't advertise the job, for obvious reasons, but he's heard of your record and reputation for getting jobs done.<br/><br/>A fee was agreed and you shook hands before going home to get a good night's sleep – probably your last for the foreseeable.<br/><br/>Stand by...")
SetTimeout (5) {
MoveObject (player, bedroom)
}
]]></description>
</object>
<object name="bedroom">
<inherit name="editor_room" />
<description type="script"><![CDATA[
firsttime {
msg ("<br/><br/>The soft, female tones of your alarm clock drift into your subconcious. \"Good morning, sir, this is your eight am wake-up call.\"")
SetTimeout (3) {
msg ("<br/><br/>You throw back the covers with a groan, and climb out of bed.<br/><br/>An expanse of glass overlooks the darkened city below. You can't remember the last time you saw a clear sky.<br/><br/>A door leads to the bathroom while an archway gives access to the lounge area.")
}
}
otherwise {
if (GetBoolean(bedroom, "clothesgone")) {
msg ("Your bed lies unmade on the far wall.<br/><br/>A door leads to the bathroom while an archway gives access to the lounge area. ")
}
else {
msg ("Your bed lies unmade on the far wall. Last night's clothes are draped over a chair.<br/><br/>A door leads to the bathroom while an archway gives access to the lounge area. ")
SetObjectFlagOn (clothes, "clothesgone")
}
}
]]></description>
<enter type="script">
</enter>
<exit alias="lounge" to="lounge" />
<exit alias="bathroom" to="bathroom" />
<object name="bed">
<inherit name="editor_object" />
<drop type="boolean">false</drop>
<look>The bed is as wide as it is long. The ruffled sheets are a mixture of tasteful chocolate browns and beiges.</look>
<feature_usegive />
<climb type="string"></climb>
<lie>You climb on the bed and close your eyes.</lie>
<takemsg>It's bolted to the floor.</takemsg>
<use type="script">
msg ("You climb on the bed and close your eyes.")
</use>
</object>
<object name="clothes">
<inherit name="editor_object" />
<take />
<drop type="boolean">false</drop>
<scenery />
<look>A crumpled pair of black slacks, red shirt and a pair of suede shoes.</look>
<wear type="script">
if (GetBoolean(player, "clotheson")) {
msg ("You're already wearing the clothes.")
}
else {
msg ("You give the clothes a quick smell before shrugging and putting them on.")
SetObjectFlagOn (player, "clotheson")
}
</wear>
</object>
<object name="window">
<inherit name="editor_object" />
<takemsg>If you do that, your room will collapse. Now stop being silly.</takemsg>
<look>You step up to the window and notice the grime on the outside of the glass. Below, the city streets are glistening, reflecting the many neons lining the sidewalks.</look>
</object>
</object>
<object name="lounge">
<inherit name="editor_room" />
<description type="script"><![CDATA[
if (Got(gun)) {
if (Got(cellphone)) {
msg ("The lounge is large and open-plan. It's why you choose the apartment... that and the security of having your own, retina-scan operated elevator. It came at a price, but you had money... back then.<br/><br/>A kitchen lies at the far end. A door leads to your bedroom and an elevator gives access to the streets outside.<br/><br/>There is a smoked-glass coffee table here.")
}
else {
msg ("The lounge is large and open-plan. It's why you choose the apartment... that and the security of having your own, retina-scan operated elevator. It came at a price, but you had money... back then.<br/><br/>A kitchen lies at the far end. A door leads to your bedroom and an elevator gives access to the streets outside.<br/><br/>There is a smoked-glass coffee table on which sits a cellphone.")
}
}
else {
if (Got(cellphone)) {
msg ("The lounge is large and open-plan. It's why you choose the apartment... that and the security of having your own, retina-scan operated elevator. It came at a price, but you had money... back then.<br/><br/>A kitchen lies at the far end. A door leads to your bedroom and an elevator gives access to the streets outside.<br/><br/>There is a smoked-glass coffee table on which sits a gun.")
}
else {
msg ("The lounge is large and open-plan. It's why you choose the apartment... that and the security of having your own, retina-scan operated elevator. It came at a price, but you had money... back then.<br/><br/>A kitchen lies at the far end. A door leads to your bedroom and an elevator gives access to the streets outside.<br/><br/>There is a smoked-glass coffee table on which sits a gun and a cellphone.")
}
}
]]></description>
<onexit type="script">
</onexit>
<enter type="script">
</enter>
<exit to="bedroom" />
<exit to="kitchen" />
<object name="gun">
<inherit name="editor_object" />
<look>An Oracle Snubnose. Discreet, but packs a mighty whallop.</look>
<take />
<takemsg>You grab the gun and slip into your trouser waist.</takemsg>
<feature_usegive />
<fire type="string"></fire>
<drop type="boolean">false</drop>
<dropmsg>You think better and decide to keep hold of it for now.</dropmsg>
<use type="script">
msg ("You fire the pistol and gunshot noise fills the air.")
</use>
</object>
<object name="cellphone">
<inherit name="editor_object" />
<inherit name="switchable" />
<look>A Pear ePhone 6 in black.</look>
<take />
<takemsg>You grab the phone and drop it into your pocket.</takemsg>
<feature_usegive />
<feature_switchable />
<dropmsg>You think better and decide to keep hold of it for now.</dropmsg>
<onswitchon type="script">
</onswitchon>
<onswitchoff type="script">
</onswitchoff>
</object>
<exit alias="lift; elevator" to="elevator">
<scenery type="boolean">false</scenery>
<prefix type="string"></prefix>
</exit>
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
</object>
<object name="bathroom">
<inherit name="editor_room" />
<description><![CDATA[As you enter the bathroom the ceiling panel lights buzz and flicker into life . You inspect your reflection, rubbing at the stuble on your face and contemplating a shave.<br/><br/>A razor sits on the small glass shelf beneath the mirror.<br/><br/>To your right is the toilet, and to your left a wet-room.]]></description>
<object name="razor">
<inherit name="editor_object" />
<take />
<takemsg>You pick it up and check the blades. Looks clean enough.</takemsg>
<dropmsg>You place the razor back on the shelf.</dropmsg>
<look>It's a simple three-bladed razor and looks relatively new.</look>
<alt type="stringlist" />
<feature_usegive />
<use type="script"><![CDATA[
msg ("You lather your face with shaving cream and begin scraping away at the three-day stubble.<br/><br/>Five minutes later and clean shaven, you feel remarkable refreshed.")
]]></use>
</object>
<object name="toilet">
<inherit name="editor_object" />
<look>Nothing out of the ordinary here - just a bog-standard bog.</look>
<takemsg>It's bolted to the floor</takemsg>
<drop type="boolean">false</drop>
<feature_usegive />
<sit>It's not the most comfortable place to sit.</sit>
<use type="script">
if (GetBoolean(player, "boguse")) {
msg ("You've already been.")
}
else {
msg ("You approach the toilet and pull out your member. The flow comes easily and you sigh as you feel your bladder emptying.")
SetObjectFlagOn (player, "boguse")
}
</use>
</object>
<object name="wetroom">
<inherit name="editor_object" />
<look>The wetroom takes up half the bathroom space, and it's a big bathroom.</look>
<takemsg>Don't be silly.</takemsg>
<feature_usegive />
<alt type="stringlist">
<value>shower</value>
</alt>
<use type="script"><![CDATA[
if (GetBoolean(player, "hadshower")) {
msg ("You've already showered.")
}
else {
msg ("You turn on the shower and step under the steaming jet of water coming from the multiple heads. You wash away last night's filth, standing with your head bowed. The sensation of the water cascading over your face is wonderful.<br/><br/>Ten minutes later you step out and begin patting yourself dry with a towel.")
SetObjectFlagOn (player, "hadshower")
}
]]></use>
</object>
<exit alias="bedroom" to="bedroom" />
</object>
<verb name="dress">
<property>dress</property>
<pattern>dress #object#</pattern>
<defaultexpression>"You can't dress " + object.article + "."</defaultexpression>
<defaulttemplate>DefaultDress</defaulttemplate>
</verb>
<object name="kitchen">
<inherit name="editor_room" />
<description><![CDATA[A seldom used place, at least for cooking, evident by the pristine hob in the work surface. The lounge is situated at the opposite end and an elevator in the wall to you left leads to the streets outside.<br/><br/>A silver fridge sits at one end.]]></description>
<object name="fridge">
<inherit name="editor_object" />
<inherit name="openable" />
<look>Nothing special. Its the same fridge you've had for the last four years.</look>
<attr name="feature_usegive" type="boolean">false</attr>
<feature_container />
<use type="script">
msg ("The smell of something long past its sell-by date rushes your nostrils. You recoil and close the door.")
</use>
<openscript type="script">
msg ("The stench of something long past its sell-by day invades your nostrils. You recoil and close the door.")
</openscript>
</object>
<object name="hob">
<inherit name="editor_object" />
<inherit name="switchable" />
<look>It's a hob, unused.</look>
<feature_switchable />
<switchonmsg>The hob is now on.</switchonmsg>
<switchoffmsg>The hob is off.</switchoffmsg>
</object>
<exit to="lounge" />
<exit alias="lift; elevator" to="elevator" />
</object>
<object name="outside">
<inherit name="editor_room" />
<alias>street</alias>
<description type="script"><![CDATA[
firsttime {
msg ("It's been raining again and dirty puddles have collected where ever you want to step. Rubbish seems to be everywhere you look; empty food cartons, cigarette packets, bottles... the sanitory droids must still be in maintainence.<br/><br/>Food stalls line the whole length of the street and you can't walk five paces without banging shoulders with someone. You remember the first time you moved here, constantly apologising and exscusing yourself for every little bump and collision. Not any more, and especially not today.<br/><br/>Over on the east block is Dawsons - the electronics company owned by your employer, the man who lost his daughtert to Cloud9 and who's paying you a large sum of money to bring the developers of the drug to justice. You've discussed the contract and conditions already, but maybe there's more he can tell you about his daughter.<br/><br/>And then there's the users themselves, of course, over to the west side of town, where few dare to venture.<br/><br/>An elevator leads back to your apartment.<br/>")
}
otherwise {
msg ("Food stalls line the street and people are milling about everywhere. An elevator leads up to your apartment.<br/><br/>Dawsons Electronics lies to the east. West will take you to the slums.")
}
]]></description>
<exit name="retscanopen" alias="lift; elevator" to="elevator2">
<locked />
</exit>
<exit alias="east" to="dawsons">
<inherit name="eastdirection" />
</exit>
<exit alias="west" to="the slums">
<inherit name="westdirection" />
</exit>
<object name="retscan">
<inherit name="editor_object" />
<alias>scanner; scan; retina scan</alias>
<alt type="stringlist">
<value>scanner</value>
<value>scan</value>
<value>retina scan</value>
<value>retina scanner</value>
</alt>
<drop type="boolean">false</drop>
<feature_usegive />
<use type="script"><![CDATA[
firsttime {
msg ("You approach the scanner and rest your head againsts the rubber surround. A soft red light pans across your eyes and emits a high-piched bleep.")
UnlockExit (retscanopen)
}
otherwise {
msg ("You rest your head againsts the rubber surround and wait for the beep.<br/><br/>The lift doors open and you step inside.")
MoveObject (player, elevator2)
}
]]></use>
</object>
</object>
<verb name="fire">
<property>fire</property>
<pattern>fire #object#</pattern>
<defaultexpression type="string"></defaultexpression>
</verb>
<object name="elevator">
<alias>lift; elevator</alias>
<open />
<feature_usegive />
<description type="script"><![CDATA[
msg ("Going down.<br/><br/>Please wait...<br/>")
SetTimeout (4) {
MoveObject (player, outside)
}
]]></description>
<use type="script"><![CDATA[
msg ("Going down.<br/><br/>Please wait...")
SetTimeout (4) {
}
MoveObject (player, outside)
]]></use>
<drop type="boolean">false</drop>
<exit to="outside" />
</object>
<object name="elevator2">
<inherit name="editor_room" />
<alias>lift; elevator</alias>
<open />
<feature_usegive />
<description type="script"><![CDATA[
firsttime {
msg ("The elevator doors open and you step inside.<br/><br/>Going up.<br/><br/>Please wait...")
SetTimeout (3) {
MoveObject (player, lounge)
}
}
otherwise {
msg ("You rest your head against the scanner and wait for the beep. The lift doors open and you step inside.<br/><br/>Going up.<br/><br/>Please wait...")
SetTimeout (4) {
MoveObject (player, lounge)
}
}
]]></description>
<use type="script">
msg ("Going up...")
MoveObject (player, lounge)
</use>
<exit alias="lift" to="lounge" />
</object>
<object name="dawsons">
<inherit name="editor_room" />
<description>Dawson Electronics</description>
<alias>dawsons</alias>
<exit alias="west" to="outside">
<inherit name="westdirection" />
</exit>
</object>
<object name="the slums">
<inherit name="editor_room" />
<description>The Slums</description>
<alias>slums</alias>
<exit alias="east" to="outside">
<inherit name="eastdirection" />
</exit>
</object>
<command />
<function name="InitUserInterface"><![CDATA[
JS.eval ("$('#txtCommandDiv').prepend('&gt;&nbsp;')")
request (SetInterfaceString, "TypeHereLabel=")
OutputTextNoBr (game.css)
]]></function>
</asl>

HegemonKhan
Thanks, I'll try to scour through it as~when I got the time (though it'll take me longer than good coders like Jay and the others), though one more thing too (you've done a lot of work! this'll take some time, hehe. When you get your game done, I'll love to play it, hehe):

can you post your libraries' codes as well (as there could be issues~conflicts between your game code and the libraries' code being used by your game):

<include ref="dimsome.aslx" />
<include ref="ConvLib.aslx" />

HegemonKhan
let's first see how 'use elevator' looks, when it works:

(I used version="540", so hopefully it works for version="550")

try typing in (I didn't waste time turning off the hyperlinks and buttons):

use elevator
use lift

<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="xxx">
<gameid>d67ec73f-f879-4911-9d88-c02ea527c534</gameid>
<version>1.0</version>
<firstpublished>2014</firstpublished>
</game>
<object name="room1">
<inherit name="editor_room" />
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
<object name="elevator1">
<alias>elevator</alias>
<inherit name="editor_object" />
<alt type="stringlist">
<value>lift</value>
</alt>
<listalias>elevator</listalias>
<use type="script">
MoveObject (player, room2)
</use>
<displayverbs type="stringlist">
<value>Look at</value>
<value>Take</value>
<value>Use</value>
</displayverbs>
</object>
</object>
<object name="room2">
<inherit name="editor_room" />
<object name="elevator2">
<alias>elevator</alias>
<inherit name="editor_object" />
<alt type="stringlist">
<value>lift</value>
</alt>
<listalias>elevator</listalias>
<use type="script">
MoveObject (player, room1)
</use>
<displayverbs type="stringlist">
<value>Look at</value>
<value>Take</value>
<value>Use</value>
</displayverbs>
</object>
</object>
</asl>


-----

I think you're over-complicating things (not your fault, as it's how you learn~try to do things in quest, hehe) in your code~game (something I do all-the-time too, as I'm trying to figure out how to do stuff myself, hehe), and you're calling your Exits' NAMES as 'elevator', and your Objects' NAMES as 'elevator', which will cause issues, as when you type 'use elevator', are you refering to the Object (CORRECT) or the Exit (ERROR: INCORRECT), and quest has no way of knowing. Also, you got your ALIAS and~or LISTALIAS using the same label as your NAME, which will cause issues too.

Pertex
Something like <alias>lift; elevator</alias> does not work, there is only one word allowed for alias. For rooms you could set lift as an alias and elevator as an 'other name' in the Object tab. But this does not work for exits, exits only have one alias

The Pixie
It looks like Quest matches the start of the alias, so <alias>lift; elevator</alias> will work for GO LIFT but not GO ELEVATOR, which I think may have caused the confusion here.

The best way is probably to have two exits, one for LIFT and one for ELEVATOR, both doing the same thing.

jaynabonne
When I tried the multiple aliases, it worked for me (though I hadn't expected it to). But Jud, be sure you're putting the aliases on the exits, not the rooms!

OurJud
Thanks, each.

Jay, I think you must have missed it, but I do explain in my second post that I got the game to accept both terms. The problem, as you point out, was that I didn't know I needed to use the alias on exits rather than rooms.

Pertex, thank you. I didn't realise only one alias was permitted.

TP - two exits would be a good workaround. If all else fails, I shall use this.

HK, thanks for addressing the 'use' problem I'm having. I'm sure your code works, but I don't know what to do with it.

And you make a good point about me using the same names for exits as I do the rooms. For now I'll change the names of the exits and see if that helps.

However, I'm still unclear as to what the game calls to match your command to the action. When I type 'go kitchen', it moves you to the kitchen, but where is it calling 'kitchen' from? Is it the exit name, the room name, the alias, all three, or none of them??

jaynabonne
It is using the "effective name" of the exit, which is defined as either the alias if it has one or the name if not. It will never match on the exit/object name if there is an alias (or aliases) provided. The alias takes precedence.

HegemonKhan
OurJud wrote:However, I'm still unclear as to what the game calls to match your command to the action. When I type 'go kitchen', it moves you to the kitchen, but where is it calling 'kitchen' from? Is it the exit name, the room name, the alias, all three, or none of them??


for 'go', we're talking about travel, and the 'areas~locations' of quest are: Room Objects (or Object+Room Objects). The 'rooms' are the 'grid or screen world' of quest.

Exits are really mainly for if you want to use the UI's compass to move from room to room, acting as connectors between those rooms (one-way or two-way).

But, Exits are not required, as you can simply set (via scripting) what room to 'move' (aka have) the player (or whatever Object) be within.

And it uses the Room Object's NAME, unless you got an ALIAS (I forgot that quest prioritizes ALIAS over NAME, as I'm used to using Scripts, where it gets the NAME of the Object, not prioritizing ALIAS over NAME)

--------

actually I'm confused now myself... laughs.

when, for what, does quest require the NAME, vs it being able to use the ALIAS instead ?? (Jay, Pertex, Pixie, or whoever else, hehe)

---------

OurJud wrote:HK, thanks for addressing the 'use' problem I'm having. I'm sure your code works, but I don't know what to do with it.


well, copy and paste my code into a new game file (delete its default code first), and see if you can play my game. If you can, then examine it in the GUI~Editor, and then apply it over to your game, and hopefully you'll be able to get your 'use elevator' to then work.

jaynabonne
HK, that's just confusing things. The "go" command uses exits and their aliases. Exits ARE required. You can't use "go" without them. The target room name is irrelevant.

OurJud
Thanks for clearing that up, people.

HK, I'll load you game up as you suggest, and see if I can get my head around the use of 'use'. I was able to use 'use lift'/'use elevator' just fine in an earlier version of my game, but I lost it somehow.

It's another case of not really understanding where the game looks when you type 'use [whatever]'. In this case I don't know where it's looking for the verb in question.

Even more confusing is that I have the retina scanner and 'use' works just find on that. I don't understand, therefore, in that I've set my elevator to 'Object and/or room' and set the desired action in its Use/Give tab, why 'use lift'/'use elevator' doesn't work. Maybe I need to make it a plain old object.

jaynabonne
You can only use things which are reachable. The elevator/lift is a room elsewhere in the game. You know it's there (in your mind), but it's actually not in the room where you are. There is no context where Quest could know it's anywhere within usable reach.

I would create a custom command in that room with pattern "use elevator;use lift" and have it just do what you want it to do.

OurJud
jaynabonne wrote:I would create a custom command in that room with pattern "use elevator;use lift" and have it just do what you want it to do.


Ah, of course. Do you mean the 'if input =' script? In other words 'if input='use elevator;use lift' then do this

jaynabonne
Actually, no. I mean:

1) Right-click on the room in question.
2) Choose "Add Command"
3) In the new empty command, set the command pattern to:

use lift; use elevator

and set the script to do what you want (e.g. move the player into the elevator)

HegemonKhan
I think Jay's talking about making (adding) a Command (which uses input just like the 'get input' Script), and not using the specific 'get input' Script (run as script -> add a~new script -> output -> 'get input' Script).

GUI~Editor: Add Command

Code:
<command name="xxx">
</command>

(which is what I did in my first code, not my more recent code~game, for you in this thread, used a custom, aka self-made, Command)

(see my next~new post)

OurJud
jaynabonne wrote:Actually, no. I mean:

1) Right-click on the room in question.
2) Choose "Add Command"
3) In the new empty command, set the command pattern to:

use lift; use elevator

and set the script to do what you want (e.g. move the player into the elevator)


Thank you thank you thank you!

HegemonKhan
here it is:

(with the added addition of the alternative pattern of 'use lift' for you)

// there's many different variations~methods for using a Command, here's just one of them (kept it more simple for you, though this is probably not the best code as I just did this 'on the fly', lol):

<command name="elevator_command">
<pattern>use elevator;use lift</pattern>
<script>
elevator_function
</script>
</command>

<object name="elevator_room_A">
<inherit name="editor_room" />
<alias>elevator</alias>
</object>

<object name="elevator_room_B">
<inherit name="editor_room" />
<alias>elevator</alias>
</object>

<object name="elevator_room_A1">
<inherit name="editor_room" />
<alias>first floor</alias>
</object>

<object name="elevator_room_A2">
<inherit name="editor_room" />
<alias>second floor</alias>
</object>

<object name="elevator_room_A3">
<inherit name="editor_room" />
<alias>first basement</alias>
</object>

<object name="elevator_room_A4">
<inherit name="editor_room" />
<alias>second basement</alias>
</object>

<object name="elevator_room_B1">
<inherit name="editor_room" />
<alias>first floor</alias>
</object>

<object name="elevator_room_B2">
<inherit name="editor_room" />
<alias>second floor</alias>
</object>

<object name="elevator_room_B3">
<inherit name="editor_room" />
<alias>first basement</alias>
</object>

<object name="elevator_room_B4">
<inherit name="editor_room" />
<alias>second basement</alias>
</object>

<function name="elevator_function">
if (player.parent.alias = "elevator") {
show menu ("Down or Up?", split ("down;up", ";"), false) {
direction_variable = ToString (result)
show menu ("1 or 2?", split ("1;2", ";"), false) {
quantity_variable = ToString (result)
if (player.parent.name = "elevator_room_A") {
if (direction_variable = "up" and quantity_variable = "1") {
player.parent = elevator_room_A1
} else if (direction_variable = "up" and quantity_variable = "2") {
player.parent = elevator_room_A2
} else if (direction_variable = "down" and quantity_variable = "1") {
player.parent = elevator_room_A3
} else if (direction_variable = "down" and quantity_variable = "2") {
player.parent = elevator_room_A4
}
} else if (player.parent.name = "elevator_room_B") {
if (direction_variable = "up" and quantity_variable = "1") {
player.parent = elevator_room_B1
} else if (direction_variable = "up" and quantity_variable = "2") {
player.parent = elevator_room_B2
} else if (direction_variable = "down" and quantity_variable = "1") {
player.parent = elevator_room_B3
} else if (direction_variable = "down" and quantity_variable = "2") {
player.parent = elevator_room_B4
}
}
}
}
} else {
msg ("Sorry, but you must be in an elevator, if you want to ride an elevator up or down, you know...")
}
</function>

OurJud
Thanks very much, HK, but I got it working by simply adding the command as per Jay's instructions.

HegemonKhan
Jay's a great help, really knows everything well and can give great guidance in getting it done for people.

I just posted that code of mine so you can see ideas for the scripting part of it (after you created the Command from Jay's help), though my Command used is global, a bit more complicated than a local Command for a specific room, (didn't know this can be done, as I always just make global Commands, never tried to see if the Command can be added locally to specific rooms), so Jay's help is way less confusing than my Command code, though for a global Command, I tried to make it as simple as possible.

That's really awesome that you got it to work on your own (able to add the Command and to add scripts that made it work right), despite your frustration, you really are doing a good job in learning quest and code-logic concepts quickly! :D

OurJud
HegemonKhan wrote:That's really awesome that you got it to work on your own (able to add the Command and to add scripts that made it work right), despite your frustration, you really are doing a good job in learning quest and code-logic concepts quickly! :D

Thank you, HK, that's very nice of you to say so :)

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

Support

Forums