how do I set exit alias?

imamy
10 Aug 2013, 22:17
I'm using the Web Version.

Does anyone know if there is a function or script command that can allow me to change the alias attribute in the Exit element?

Or how to get an Element?

Thanks :)

Amy

HegemonKhan
10 Aug 2013, 23:15
I never used the web version, so I can't help you with about it, so all I can offer is this code stuff:

-------

if you can go into the code with the web version, then you can simply do this in the code:

http://quest5.net/wiki/Exit_element

just add in the "alias" attribute as shown in the above link

if you need help on how~where to do this, just ask! :D

------

"exits" are Elements, and so are not Objects, as "Exits" are "connectors" of Room Objects. As best as I understand this stuff, lol.

http://quest5.net/wiki/Exit_element
http://quest5.net/wiki/AllExits
http://quest5.net/wiki/ScopeExitsForRoom
http://quest5.net/wiki/ScopeExits
http://quest5.net/wiki/GetDisplayAlias
http://quest5.net/wiki/GetDisplayName
http://quest5.net/wiki/GetDisplayNameLink
http://quest5.net/wiki/GetExitByLink
http://quest5.net/wiki/GetExitByName
http://quest5.net/wiki/GetListDisplayAlias
http://quest5.net/wiki/GetUniqueElementName

and then there's the "equipment" coding trick:

player.alias_old_or_original = player.alias // this saves your old~original alias for recalling~using later
player.alias = GetDisplayAlias (player) + "(equipped)" // this creates your new alias for you to use, you can add whatever text you want, as the: + "(equipped)" ~ is just for equipment being understood and shown as worn~equipped.

and you can use other things besides just "alias" too:

"worn" (Chase's word) = "equipped" (my word)
"wear" (Chase's word) = "equip" (my word)
"remove" (Chase's word) = "unequip" (my word)

from Chase's Wearables Library:

DoWear:

object.worn = true
object.drop = false
object.original_alias = object.alias
object.display = GetDisplayName(object)
object.alias = GetDisplayAlias(object) + " (worn)"

DoRemove:

object.worn = false
object.drop = object.original_drop
object.alias = object.original_alias
object.original_drop = null
object.original_alias = null
object.display = null

imamy
11 Aug 2013, 01:09
Thanks HK :)

I don't see a function or scriptcommand that helps in this situation. Would you know what the type for non-directional is called? eg "northdirection". I know it's not called "nodirection" and "nondirectional".

I'm trying to adapt Jay's ASL code to the Web Version but the Web Version is uncooperative. After a few hours of tinkering, this is what I came up with:

1) The Web Version's compass won't allow me to use hyphens in the name (so exit0-10 is out of the question).

2) create exit() works great for 10 directions N, NW, W, SW, S, SE, E, NE, U, D. I can set the ID and Jay's code works. Makes me think that ID is the "name" and the Name is the "alias"...

3) create exit() won't allow me to designate an ID unless I specify a type. So the "up to the north" and "down to the north" are not working. When it tries to clone, eg newexit = clone(GetObject(exitname)), clone is passed a null as a parameter.

LOL oh... so much typing... now I wish I had fewer than 26 directions XD

I still have a few scenarios left to try. Until I get the type for "non-directional" direction, I am probably going to stick in "northdirection" and see what happens, because then I can set an ID.

I added the stuff below in case you'd like to see how I'm going about it.

Jay's code: http://forum.textadventures.co.uk/viewtopic.php?f=10&t=3832&start=15#p25752

This is the section that I'm trying to adapt to the Web Version:
<exit name="exit0-10" alias="north">
<inherit name="northdirection" />
</exit>
<exit name="exit-1-10" alias="northwest">
<inherit name="northwestdirection" />
</exit>
<exit name="exit-100" alias="west">
<inherit name="westdirection" />
</exit>
<exit name="exit-110" alias="southwest">
<inherit name="southwestdirection" />
</exit>
<exit name="exit010" alias="south">
<inherit name="southdirection" />
</exit>
<exit name="exit110" alias="southeast">
<inherit name="southeastdirection" />
</exit>
<exit name="exit100" alias="east">
<inherit name="eastdirection" />
</exit>
<exit name="exit1-10" alias="northeast">
<inherit name="northeastdirection" />
</exit>
<exit name="exit00-1" alias="up">
<inherit name="updirection" />
</exit>
<exit name="exit0-1-1" alias="up to the north" />
<exit name="exit-1-1-1" alias="up to the northwest" />
<exit name="exit-10-1" alias="up to the west" />
<exit name="exit-11-1" alias="up to the southwest" />
<exit name="exit01-1" alias="up to the south" />
<exit name="exit11-1" alias="up to the southeast" />
<exit name="exit10-1" alias="up to the east" />
<exit name="exit1-1-1" alias="up to the northeast" />
<exit name="exit001" alias="down">
<inherit name="downdirection" />
</exit>
<exit name="exit0-11" alias="down to the north" />
<exit name="exit-1-11" alias="down to the northwest" />
<exit name="exit-101" alias="down to the west" />
<exit name="exit-111" alias="down to the southwest" />
<exit name="exit011" alias="down to the south" />
<exit name="exit111" alias="down to the southeast" />
<exit name="exit101" alias="down to the east" />
<exit name="exit1-11" alias="down to the northeast" />


This is my adaptation of that section:
// Create Exits Templates
grTemp = GetObject("gameroom")
// north/northdirection
// create exit ("exit0-10", grTemp, grTemp, "northdirection")
create exit ("exit0-10", "exit0-10", grTemp, grTemp, "northdirection")
// northwest/northwestdirection
// create exit ("exit-1-10", grTemp, grTemp, "northwestdirection")
create exit ("exit-1-10", "exit-1-10", grTemp, grTemp, "northwestdirection")
// west/westdirection
// create exit ("exit-100", grTemp, grTemp, "westdirection")
create exit ("exit-100", "exit-100", grTemp, grTemp, "westdirection")
// southwest/southwestdirection
// create exit ("exit-110", grTemp, grTemp, "southwestdirection")
create exit ("exit-110", "exit-110", grTemp, grTemp, "southwestdirection")
// south/southdirection
// create exit ("exit010", grTemp, grTemp, "southdirection")
create exit ("exit010", "exit010", grTemp, grTemp, "southdirection")
// southeast/southeastdirection
// create exit ("exit110", grTemp, grTemp, "southeastdirection")
create exit ("exit110", "exit110", grTemp, grTemp, "southeastdirection")
// east/eastdirection
// create exit ("exit100", grTemp, grTemp, "eastdirection")
create exit ("exit100", "exit100", grTemp, grTemp, "eastdirection")
// northeast/northeastdirection
// create exit ("exit1-10", grTemp, grTemp, "northeastdirection")
create exit ("exit1-10", "exit1-10", grTemp, grTemp, "northeastdirection")
// up/updirection
// create exit ("exit00-1", grTemp, grTemp, "updirection")
create exit ("exit00-1", "exit00-1", grTemp, grTemp, "updirection")
// up to the north
// create exit ("exit0-1-1", grTemp, grTemp)
create exit ("exit0-1-1", grTemp, grTemp)
// up to the northwest
// create exit ("exit-1-1-1", grTemp, grTemp)
create exit ("exit-1-1-1", grTemp, grTemp)
// up to the west
// create exit ("exit-10-1", grTemp, grTemp)
create exit ("exit-10-1", grTemp, grTemp)
// up to the southwest
// create exit ("exit-11-1", grTemp, grTemp)
create exit ("exit-11-1", grTemp, grTemp)
// up to the south
// create exit ("exit01-1", grTemp, grTemp)
create exit ("exit01-1", grTemp, grTemp)
// up to the southeast
// create exit ("exit11-1", grTemp, grTemp)
create exit ("exit11-1", grTemp, grTemp)
// up to the east
// create exit ("exit10-1", grTemp, grTemp)
create exit ("exit10-1", grTemp, grTemp)
// up to the northeast
// create exit ("exit1-1-1", grTemp, grTemp)
create exit ("exit1-1-1", grTemp, grTemp)
// down/downdirection
// create exit ("exit001", grTemp, grTemp, "downdirection")
create exit ("exit001", "exit001", grTemp, grTemp, "downdirection")
// down to the north
// create exit ("exit0-11", grTemp, grTemp)
create exit ("exit0-11", grTemp, grTemp)
// down to the northwest
// create exit ("exit-1-11", grTemp, grTemp)
create exit ("exit-1-11", grTemp, grTemp)
// down to the west
// create exit ("exit-101", grTemp, grTemp)
create exit ("exit-101", grTemp, grTemp)
// down to the southwest
// create exit ("exit-111", grTemp, grTemp)
create exit ("exit-111", grTemp, grTemp)
// down to the south
// create exit ("exit011", grTemp, grTemp)
create exit ("exit011", grTemp, grTemp)
// down to the southeast
// create exit ("exit111", grTemp, grTemp)
create exit ("exit111", grTemp, grTemp)
// down to the east
// create exit ("exit101", grTemp, grTemp)
create exit ("exit101", grTemp, grTemp)
// down to the northeast
// create exit ("exit1-11", grTemp, grTemp)
create exit ("exit1-11", grTemp, grTemp)


My program so far:
<!--Saved by Quest 5.4.4896.9778-->
<asl version="540">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="Jaynabonne's Example">
<gameid>f0627466-3ac2-4df3-bff2-58e0dc837b22</gameid>
<version>3.0</version>
<firstpublished>2013</firstpublished>
<menufont>Georgia, serif</menufont>
<description></description>
</game>
<object name="gameroom">
<inherit name="editor_room" />
<beforeenter type="script">
SetObjAtt_gameroom_dims
SetObjAtt_gameroom_rooms
LayoutRooms
</beforeenter>
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
</object>
<object name="room1">
<inherit name="editor_room" />
</object>
<object name="room2">
<inherit name="editor_room" />
</object>
<object name="room3">
<inherit name="editor_room" />
</object>
<object name="room4">
<inherit name="editor_room" />
</object>
<object name="room5">
<inherit name="editor_room" />
</object>
<object name="room6">
<inherit name="editor_room" />
</object>
<object name="room7">
<inherit name="editor_room" />
</object>
<object name="room8">
<inherit name="editor_room" />
</object>
<object name="room9">
<inherit name="editor_room" />
</object>
<object name="room10">
<inherit name="editor_room" />
</object>
<function name="SetObjAtt_gameroom_rooms">
ObjTemp = GetObject("gameroom")
set (ObjTemp, "rooms", NewStringList())
list add (ObjTemp.rooms, "room1")
list add (ObjTemp.rooms, "room2")
list add (ObjTemp.rooms, "room3")
list add (ObjTemp.rooms, "room4")
list add (ObjTemp.rooms, "room5")
list add (ObjTemp.rooms, "room6")
list add (ObjTemp.rooms, "room7")
list add (ObjTemp.rooms, "room8")
list add (ObjTemp.rooms, "room9")
list add (ObjTemp.rooms, "room10")
</function>
<function name="PrintObjAtt_gameroom_rooms">
msg ("Function:PrintObjAtt_room_dims")
ObjTemp = GetObject("gameroom")
msg (StringListItem(ObjTemp.rooms, 0))
msg (StringListItem(ObjTemp.rooms, 1))
msg (StringListItem(ObjTemp.rooms, 2))
msg (StringListItem(ObjTemp.rooms, 3))
msg (StringListItem(ObjTemp.rooms, 4))
msg (StringListItem(ObjTemp.rooms, 5))
msg (StringListItem(ObjTemp.rooms, 6))
msg (StringListItem(ObjTemp.rooms, 7))
msg (StringListItem(ObjTemp.rooms, 8))
msg (StringListItem(ObjTemp.rooms, 9))
</function>
<function name="SetObjAtt_gameroom_dims">
ObjTemp = GetObject("gameroom")
set (ObjTemp, "dimsx", 5)
set (ObjTemp, "dimsy", 1)
set (ObjTemp, "dimsz", 1)
</function>
<function name="PrintObjAtt_gameroom_dims">
msg ("Function:PrintObjAtt_room_dims")
ObjTemp = GetObject("gameroom")
msg (ObjTemp.dimsx)
msg (ObjTemp.dimsy)
msg (ObjTemp.dimsz)
</function>
<function name="LayoutRooms"><![CDATA[
// Create Exits Templates
grTemp = GetObject("gameroom")
// north/northdirection
// create exit ("exit0-10", grTemp, grTemp, "northdirection")
create exit ("exit0-10", "exit0-10", grTemp, grTemp, "northdirection")
// northwest/northwestdirection
// create exit ("exit-1-10", grTemp, grTemp, "northwestdirection")
create exit ("exit-1-10", "exit-1-10", grTemp, grTemp, "northwestdirection")
// west/westdirection
// create exit ("exit-100", grTemp, grTemp, "westdirection")
create exit ("exit-100", "exit-100", grTemp, grTemp, "westdirection")
// southwest/southwestdirection
// create exit ("exit-110", grTemp, grTemp, "southwestdirection")
create exit ("exit-110", "exit-110", grTemp, grTemp, "southwestdirection")
// south/southdirection
// create exit ("exit010", grTemp, grTemp, "southdirection")
create exit ("exit010", "exit010", grTemp, grTemp, "southdirection")
// southeast/southeastdirection
// create exit ("exit110", grTemp, grTemp, "southeastdirection")
create exit ("exit110", "exit110", grTemp, grTemp, "southeastdirection")
// east/eastdirection
// create exit ("exit100", grTemp, grTemp, "eastdirection")
create exit ("exit100", "exit100", grTemp, grTemp, "eastdirection")
// northeast/northeastdirection
// create exit ("exit1-10", grTemp, grTemp, "northeastdirection")
create exit ("exit1-10", "exit1-10", grTemp, grTemp, "northeastdirection")
// up/updirection
// create exit ("exit00-1", grTemp, grTemp, "updirection")
create exit ("exit00-1", "exit00-1", grTemp, grTemp, "updirection")
// up to the north
// create exit ("exit0-1-1", grTemp, grTemp)
create exit ("exit0-1-1", grTemp, grTemp)
// up to the northwest
// create exit ("exit-1-1-1", grTemp, grTemp)
create exit ("exit-1-1-1", grTemp, grTemp)
// up to the west
// create exit ("exit-10-1", grTemp, grTemp)
create exit ("exit-10-1", grTemp, grTemp)
// up to the southwest
// create exit ("exit-11-1", grTemp, grTemp)
create exit ("exit-11-1", grTemp, grTemp)
// up to the south
// create exit ("exit01-1", grTemp, grTemp)
create exit ("exit01-1", grTemp, grTemp)
// up to the southeast
// create exit ("exit11-1", grTemp, grTemp)
create exit ("exit11-1", grTemp, grTemp)
// up to the east
// create exit ("exit10-1", grTemp, grTemp)
create exit ("exit10-1", grTemp, grTemp)
// up to the northeast
// create exit ("exit1-1-1", grTemp, grTemp)
create exit ("exit1-1-1", grTemp, grTemp)
// down/downdirection
// create exit ("exit001", grTemp, grTemp, "downdirection")
create exit ("exit001", "exit001", grTemp, grTemp, "downdirection")
// down to the north
// create exit ("exit0-11", grTemp, grTemp)
create exit ("exit0-11", grTemp, grTemp)
// down to the northwest
// create exit ("exit-1-11", grTemp, grTemp)
create exit ("exit-1-11", grTemp, grTemp)
// down to the west
// create exit ("exit-101", grTemp, grTemp)
create exit ("exit-101", grTemp, grTemp)
// down to the southwest
// create exit ("exit-111", grTemp, grTemp)
create exit ("exit-111", grTemp, grTemp)
// down to the south
// create exit ("exit011", grTemp, grTemp)
create exit ("exit011", grTemp, grTemp)
// down to the southeast
// create exit ("exit111", grTemp, grTemp)
create exit ("exit111", grTemp, grTemp)
// down to the east
// create exit ("exit101", grTemp, grTemp)
create exit ("exit101", grTemp, grTemp)
// down to the northeast
// create exit ("exit1-11", grTemp, grTemp)
create exit ("exit1-11", grTemp, grTemp)
// Create a list to hold the assigned room indices.
assigned = NewList()
// Layout the first room.
room = gameroom.rooms[0]
currentroom = GetObject(room)
set (currentroom, "x", (GetRandomInt(0, gameroom.dimsx-1)))
set (currentroom, "y", (GetRandomInt(0, gameroom.dimsy-1)))
set (currentroom, "z", (GetRandomInt(0, gameroom.dimsz-1)))
// Mark this room's slot.
list add (assigned, CoordsToIndex(currentroom.x, currentroom.y, currentroom.z))
// Layout the remaining rooms from here.
LCTemp = ListCount(gameroom.rooms)-1
for (i, 1, LCTemp) {
room = gameroom.rooms[i]
newroom = GetObject(room)
positioned = false
while (not positioned) {
// Select a random room top start from.
room = gameroom.rooms[GetRandomInt(0, i-1)]
sourceroom = GetObject(room)
// Select a random direction from this room.
dirgood = false
while (not dirgood) {
dirx = GetRandomInt(0,2)-1
diry = GetRandomInt(0,2)-1
dirz = GetRandomInt(0,2)-1
dirgood = dirx <> 0 or diry <> 0 or dirz <> 0
}
// msg ("dir: " + dirx + ", " + diry + ", " + dirz)
// See if we can position the room here.
newroom.x = (sourceroom.x + dirx + gameroom.dimsx) % gameroom.dimsx
newroom.y = (sourceroom.y + diry + gameroom.dimsy) % gameroom.dimsy
newroom.z = (sourceroom.z + dirz + gameroom.dimsz) % gameroom.dimsz
index = CoordsToIndex(newroom.x, newroom.y, newroom.z)
positioned = not index in assigned
}
// Remember this position is used.
list add (assigned, index)
// Create and assign the exits.
exitname = "exit" + dirx + diry + dirz
oppname = "exit" + -dirx + -diry + -dirz
// msg("exitname = " + exitname + ", oppname = " + oppname)
ObjTemp = GetObject(exitname)
newexit = clone(ObjTemp)
ObjTemp = GetObject(oppname)
oppexit = clone(ObjTemp)
newexit.parent = sourceroom
newexit.to = newroom
oppexit.parent = newroom
oppexit.to = sourceroom
// msg ("pos: " + newroom.x + ", " + newroom.y + ", " + newroom.z)
currentroom = newroom
}
]]></function>
<function name="CoordsToIndex" parameters="x, y, z" type="int">
return (x + gameroom.dimsx*(y + gameroom.dimsy*z))
</function>
</asl>

HegemonKhan
11 Aug 2013, 03:37
0. "Would you know what the type for non-directional is called? eg "northdirection". I know it's not called "nodirection" and "nondirectional" (imamy)."

the compass~exit directions are Object Types ~ Inherited Attributes, so simply not assigning one or any of the 8, I would presume equate to a "non-directional". My guess anyways, as I think you can make exits without a specified direction, at least in the desktop version (again I think... I haven't worked too much with exits yet). Moving from room to room doesn't require having any directions applied to do so, as it can simply be done by this means (in code):

(in the GUI~Editor, this is the "MoveObject" script ---- add a~new script -> Objects -> "MoveObject" script)

object_name.parent = old_parent_name // the room that the object you want to move is in
~then where ever, just have this changing script below~
object_name.parent = new_parent_name // the room you want to go~more your object to

as can be seen, no direction is required for room movement.

so, simply don't have this (for one example) inherited attribute:

<exit name="blah">
<inherit name="northwestdirection" />
// etc code stuff
</exit>


have it look like this instead:

<exit name="blah">
// etc code stuff
</exit>


Or, you could make a new Object Type, called "no_or_non_direction", though you'd have to be a good programmer~coder, as you'd have to code this to do core code work (Alex has coded a lot of stuff, "core code", which works "behind the scenes", allowing the GUI~Editor and the code scripts that we use, to work so easily~simply. It's easy to do a Take command in the GUI~Editor or in code, because the code that it requires or uses to work, has been done by Alex as his core code ~ quest game engine, that works "internally or behind the scenes" from us, well we can see it by doing the Filter -> Show Library Elements).

if you were using the desktop version, you could do this to look at quest's core code stuff:

http://quest5.net/wiki/Using_inherited_types

here's what the Filter -> Show Library Elements provides for the Core Code stuff:

(the normally hidden core code stuff is shown as a light-grey colored text~font, this only refers to the left pane-side, the "tree of stuff". you've probably noticed light grey colored text~font with Attributes and Inherited Attributes on the right side~pane, but this refers to something else, which I can explain if you're interested, though I'm not going to do it here, as it'll take a bit of explaining~typing, as I don't want to get off-subject in the middle of this stuff here, lol)

(unfortunately, people haven't put this info on the online wiki yet... it'd be a lot of work so thus why people haven't, lol)

(though I think you can see this by looking at the developer board, as I think Alex has his core code open to look at, but I haven't looked at this board myself yet to see if or where it is within the developers board)

(I'm just showing the Object Types stuff)

Object Types:

defaultverb
defaultgame
defaultobject
defaultexit
direction
compassdirection
updowndirection
inoutdirection
northwestdirection
northdirection
northeastdirection
westdirection
eastdirection
southwestdirection
southdirection
southeastdirection
updirection
downdirection
indirection
outdirection
defaultcommand
male
namedmale
female
namedfemale
plural
maleplural
femaleplural
openable
container_base
container_closed
container_open
surface
container
container_limited
container_lockable
defaultplayer
switchable
edible
gridborder_path_ew
gridborder_path_e
gridborder_path_w
gridborder_path_ns
gridborder_path_n
gridborder_path_s
editor_room
editor_object
editor_player


and here's what attributes the "northdirection" Object Type provides the Object that is given it via its Inherited Attribute:

Filter -> Show Library Elements

Advanced -> "northdirection" (hidden, but now it's displayed due to "show library elements" being checked by you) Object Type (left side-pane, the "tree of stuff") -> Type (Tab, its only tab, lol, right side-pane)

Name: northdirection

Inherited Types:

Name: compassdirection
Value: compassdirection
Source: northdirection

Name: direction
Value: direction
Source: compassdirection

Attributes:

Name: name
Value: northdirection
Source: northdirection

Name: elementtype
Value: type
Source: northdirection

Name: alias
Value: north
Source: northdirection

Name: alt
Value: n
Source: northdirection

Name: prefix
Value: (blank)
Source: compassdirection

Name: suffix
Value: (blank)
Source: compassdirection

Name: displayverbs
Value: Go
Source: compassdirection


so, to make a "no or non directional" Object Type, maybe it's not that hard:

Advanced -> Object Types -> Add ->

Name: nondirectional_1

Inherited Types -> Add ->

compassdirection (scroll down to find it)

Attributes -> Add ->

Name: name
Type: stringlist
Value: nondirectional_1

Name: elementtype
Type: stringlist
Value: type

Name: alias
Type: stringlist
Value: north

Name: alt
Type: stringlist
Value: na

// "na" = n/a = not applicable = no or any direction

repeatedly make more Object Types (nondirectional_2, nondirectional_3, etc etc etc) as you need them

then for your exit:

<exit name="blah">
<inherit name="nondirectional_1" />
// etc code stuff
</exit>

<exit name="blah">
<inherit name="nondirectional_2" />
// etc code stuff
</exit>

etc etc etc exits

// HOWEVER, this might cause an error as the compass itself hasn't been coded for a "nondirection" extra path slots...


2. yep, sorry for never clarifying this confusing point for most new people, as indeed you're right:

our outside-of-game (real world~life) concept -> game term~attribute used

ID -> name (quest game engine requires this, just as the government requires your ID card, SS#, fingerprints, home address, and etc. the game requires an unique identifier for everything. Also, the game maker can use this for organization, info, and etc to keep track of stuff easier; for management ~ this stuff is not suppose to be seen by the game player, as it would be too revealing~helpful~cheating for them)

"Name" (what we think of when thinking of a "name", is actually the) -> alias (this is what the game player sees while playing the game)

3x. "LOL oh... so much typing... now I wish I had fewer than 26 directions XD (imamy)"

ya, this seems to be the one paradox~problem with coding... even for the simpliest of things it takes a much larger amount of code to do it, so the more stuff and more complicated stuff you want, the exponential increase in the amount of code you got to type~have, sighs.

computers ~ coding ~ applications ~ games ~ etc, requires a lot of work to do very little work... lol

computers ARE STUPID, hehe ;)
it takes so much effort to explain (via coding) to a computer just do something extremely simple... and for something not so simple, you can easily probably have 10,000+ pages of coding...

HegemonKhan
11 Aug 2013, 06:01
What Jayna's doing in his code is far beyond my code abilities, so he'll have to help you with his code stuff, as I am trying still to understand it myself, lol.

Us males are just horrible with directions, and nor do we ask for directions! :P

(I am horrible with directions, but I WILL, as I MUST, ask for directions! LOL)
(When I'm hopelessly lost, I don't care about our males' concept of PRIDE or of SHAME~EMBARRASSMENT, lol)

imamy
11 Aug 2013, 11:52
lol it's alright. I posted the code so others can look at it. When it comes to using the web version, I still have to add the code bit by bit to the fields so I can't even use that code in the form that I posted.

To get past this step, I need to add the ID to my exits to make it work. Then it's still not ready! But I'm getting there.

jaynabonne
11 Aug 2013, 13:06
1) If hyphens won't work, then we'd have to shift everything up. Right now, we have -1, 0, and 1 for the directions along an axis. We could add 1 to that to make it 0, 1, and 2.

2) and 3) You can use "compassdirection" for the base type if you like. That is what the other compass directions inherit from.

Question: Have you ever considered using the desktop version? I'm not pushing that, and you might have reasons not to, but I was just curious. :) I was going to convert the code to a library for you, but the web version doesn't even support that.

jaynabonne
11 Aug 2013, 13:15
If you did want to do 1 above, then the code to change would be this:

exitname = "exit" + dirx + diry + dirz
oppname = "exit" + -dirx + -diry + -dirz

changed to this:


exitname = "exit" + (1+dirx) + (1+diry) + (1+dirz)
oppname = "exit" + (1-dirx) + (1-diry) + (1-dirz)


Then all the numbers in the exits would be +1 (e.g. exit0-1-1 would become exit100)
Sorry about the hyphen problem. I can update the code if you like.

jaynabonne
11 Aug 2013, 13:19
Here are the updated exit definitions:

  <exit name="exit101" alias="north">
<inherit name="northdirection" />
</exit>
<exit name="exit001" alias="northwest">
<inherit name="northwestdirection" />
</exit>
<exit name="exit011" alias="west">
<inherit name="westdirection" />
</exit>
<exit name="exit021" alias="southwest">
<inherit name="southwestdirection" />
</exit>
<exit name="exit121" alias="south">
<inherit name="southdirection" />
</exit>
<exit name="exit221" alias="southeast">
<inherit name="southeastdirection" />
</exit>
<exit name="exit211" alias="east">
<inherit name="eastdirection" />
</exit>
<exit name="exit201" alias="northeast">
<inherit name="northeastdirection" />
</exit>
<exit name="exit110" alias="up">
<inherit name="updirection" />
</exit>
<exit name="exit100" alias="up to the north" />
<exit name="exit000" alias="up to the northwest" />
<exit name="exit010" alias="up to the west" />
<exit name="exit020" alias="up to the southwest" />
<exit name="exit120" alias="up to the south" />
<exit name="exit220" alias="up to the southeast" />
<exit name="exit210" alias="up to the east" />
<exit name="exit200" alias="up to the northeast" />
<exit name="exit112" alias="down">
<inherit name="downdirection" />
</exit>
<exit name="exit102" alias="down to the north" />
<exit name="exit002" alias="down to the northwest" />
<exit name="exit012" alias="down to the west" />
<exit name="exit022" alias="down to the southwest" />
<exit name="exit122" alias="down to the south" />
<exit name="exit222" alias="down to the southeast" />
<exit name="exit212" alias="down to the east" />
<exit name="exit202" alias="down to the northeast" />