Object attribute list

jgm1077
Can you point me to a list of the attributes for game objects? For example, I know parent is one of them (player.parent). Btw, I am using the web editor.

Thanks

HegemonKhan
I don't use the online web editor, so I don't know if this (offline~desktop GUI~Editor) stuff applies:

1. 'whatever' Object ( left pane's 'tree of stuff' ) -> (right pane's): -> Attributes (Tab) -> Attributes (click on them to look at them)

2. (left pane's 'tree of stuff ~ lower left corner of screen ) Filter -> Show Library Elements -> check (toggle) it on -> light grey text on~in the left pane's 'tree of stuff'

3. (see links below)

http://docs.textadventures.co.uk/quest/

http://docs.textadventures.co.uk/quest/ ... notes.html

http://docs.textadventures.co.uk/quest/webeditor.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/
http://docs.textadventures.co.uk/quest/types/
http://docs.textadventures.co.uk/quest/scripts/
http://docs.textadventures.co.uk/quest/functions/ (categorized order: especially look at the 'core' and 'internal core' functions)
http://docs.textadventures.co.uk/quest/ ... tions.html (alphabetcal order)
http://docs.textadventures.co.uk/quest/types.html
http://docs.textadventures.co.uk/quest/scopes.html
http://docs.textadventures.co.uk/quest/ ... ments.html
http://docs.textadventures.co.uk/quest/ ... ender.html
http://docs.textadventures.co.uk/quest/ ... ticle.html

ask if you need any help!

The Pixie
Offline there is a tab that lists all the attributes. I do not think it is there online however, and I suspect there is no way to do it.

jgm1077
I see. Could take a screenshot of the attributes tab for us poor webeditor peons?

Thanks

The Pixie
They appear in a scrolling box, and there are 30-40 of them, so if you are looking for a list, it is not that easy. It is different, depending on the type as well. The game object has a set, objects have another set, rooms yet another set and if you make something an object it gets a whole lot more.

What is it you want to get out of this exactly?

jgm1077
For example, I made a teleporter that when used displays a menu of all objects and transports the player to the selection. The problem is that I would only like to include objects which are rooms in the menu list.

menuList = NewStringList()
foreach (item, AllObjects()) {
if (item.?????=ROOM) { <--- What do I put in the condition to select only items that are rooms?
list add (menuList, item.name)
}
}
ShowMenu ("Go To?", menuList, true) {
if (result<>null) {
foreach (item, AllObjects()) {
if (item.name=result) {
player.parent = item
}
}
}

Silver
The web editor sounds like a proper leg iron. Just sell your mac and buy a windows machine.

HegemonKhan
you're going to have to give each of your 'room-type' Objects an Attribute, which you can then thus check for:

quest has the 'editor_room' Inherited Attribute (Object Type ~ Type: http://docs.textadventures.co.uk/quest/types.html ), except that this disappears during the actual game play, as it is only designed for telling quest during the editor mode (not actual game play mode), that the object is a 'room type' Object.

so, just make your own such attribute (you'll have to do it for each~every object that you want to be a 'room type' Object), then you got to check for it.

-------

you may want to refine your searched Objects via the other Scopes, as the 'AllObjects ()' searches through ALL OBJECTS IN THE ENTIRE GAME (if you use 'AllObjects ()', you'll likely need more checks in your scriptings):

http://docs.textadventures.co.uk/quest/scopes.html
(for example, usually you just want to search for Objects only within the room that you're in, and not the entire game's Objects)

<object name="room_1">
<inherit name="editor_room" /> // this attribute unfortunately is only temporary (editor mode only, not actual game play mode)
<attr name="object_type_string" type="string">room</attr>
</object>

<object name="room_2">
<inherit name="editor_room" /> // this attribute unfortunately is only temporary (editor mode only, not actual game play mode)
<attr name="object_type_string" type="string">room</attr>
</object>

<object name="object_1">
<inherit name="editor_object" /> // this attribute unfortunately is only temporary (editor mode only, not actual game play mode)
<attr name="object_type_string" type="string">object</attr>
</object>

<object name="npc_1">
<inherit name="editor_object" /> // this attribute unfortunately is only temporary (editor mode only, not actual game play mode)
<attr name="object_type_string" type="string">npc</attr>
</object>

<object name="player_1">
<inherit name="editor_player" /> // this attribute unfortunately is only temporary (editor mode only, not actual game play mode)
<inherit name="editor_object" /> // this attribute unfortunately is only temporary (editor mode only, not actual game play mode)
<attr name="object_type_string" type="string">player</attr>
</object>

<function name="function_1">
foreach (object_x, AllObjects () ) {
if (object_x.object_type_string = "room") {
msg ("blah1")
} else if (object_x.object_type_string = "object") {
msg ("blah2")
} else if (object_x.object_type_string = "npc") {
msg ("blah3")
} else if (object_x.object_type_string = "player") {
msg ("blah4")
}
}
</function>


~OR~

you can use the 'inherited' Attribute (Object Type ~ Type) too:

<type name="room_object_type">
<attr name="blah1A" type="string">blah1</attr>
<attr name="blah1B" type="int">50</attr>
// etc attributes
</type>

<type name="object_object_type">
<attr name="blah2A" type="string">blah2</attr>
<attr name="blah2B" type="int">50</attr>
// etc attributes
</type>

<type name="player_object_type">
<attr name="blah3A" type="string">blah3</attr>
<attr name="blah3B" type="int">50</attr>
// etc attributes
</type>

<type name="npc_object_type">
<attr name="blah4A" type="string">blah4</attr>
<attr name="blah4B" type="int">50</attr>
// etc attributes
</type>

<object name="room_1">
<inherit name="editor_room" /> // this attribute unfortunately is only temporary (editor mode only, not actual game play mode)
<inherit name="room_object_type" />
</object>

<object name="room_2">
<inherit name="editor_room" /> // this attribute unfortunately is only temporary (editor mode only, not actual game play mode)
<inherit name="room_object_type" />
</object>

<object name="object_1">
<inherit name="editor_object" /> // this attribute unfortunately is only temporary (editor mode only, not actual game play mode)
<inherit name="object_object_type" />
</object>

<object name="npc_1">
<inherit name="editor_object" /> // this attribute unfortunately is only temporary (editor mode only, not actual game play mode)
<inherit name="npc_object_type" />
</object>

<object name="player_1">
<inherit name="editor_player" /> // this attribute unfortunately is only temporary (editor mode only, not actual game play mode)
<inherit name="editor_object" /> // this attribute unfortunately is only temporary (editor mode only, not actual game play mode)
<inherit name="player_object_type" />
</object>

<function name="function_1">
foreach (object_x, AllObjects () ) {
if (HasAttribute (object_x, "room_object_type") {
msg ("blah1")
} else if (HasAttribute (object_x, "object_object_type") {
msg ("blah2")
} else if (HasAttribute (object_x, "npc_object_type") {
msg ("blah3")
} else if (HasAttribute (object_x, "player_object_type") {
msg ("blah4")
}
}
</function>


-------

OR, if you notice, you could use a structured 'naming~labeling' convention~system, then with a little bit of 'advanced' (it's not really advanced in the coding world, but for noobs to coding it is a bit 'advanced' ) scripting, you could just skip the extra Attribute, and just use the 'NAME' (ID) Attribute of the Objects, itself~themselves.

HegemonKhan
also... I just noticed you're making a 'goto (room)' scripting, hehe.

if you want, you can take a look at this (it's a bit messy ~ unrefined ~poor coding, but it's functional), for ideas (though it might be a bit too advanced if you're new to coding ~ not sure what your level is with coding, as it uses lists~dictionaries):

viewtopic.php?f=10&t=4943&hilit=explore+and+travel+code (scroll down a bit to my posts)

ask if you got any questions and~or need help with anything.

jaynabonne
In answer to your original question, you can do something like this:

      names = GetAttributeNames(player, true)
msg(names)

That will print out all the attributes for the "player" object, for example. Here are some (and please don't ask me what they're all used for), which are just the default objects in a newly created game:

* game object *
List: name; elementtype; type; gamename; gameid; version; firstpublished; start; lastoutputsection; currentturnoutputsection; commandbarformat; pov; verbattributes; verbattributeslookup; backgroundimage; enablehyperlinks; echocommand; echohyperlinks; showdescriptiononenter; autodescription; defaultfont; defaultfontsize; defaultbackground; defaultforeground; defaultlinkforeground; setbackgroundopacity; backgroundopacity; menufont; menufontsize; menubackground; menuforeground; menuhoverbackground; menuhoverforeground; underlinehyperlinks; compassdirections; clearframe; timeelapsed; appendobjectdescription; allobjects; parserignoreprefixes; displayroomdescriptiononstart; showpanes; showcommandbar; showlocation; setcustomwidth; customwidth; setcustompadding; custompaddingtop; custompaddingbottom; custompaddingleft; custompaddingright; showborder; showscore; showhealth; showtitle; autodisplayverbs; autodescription_youarein; autodescription_youcansee; autodescription_youcango; autodescription_description; autodescription_youarein_useprefix; autodescription_youarein_newline; autodescription_youcansee_newline; autodescription_youcango_newline; autodescription_description_newline; changeroom_newline; command_newline; description; languageid; gridmap; mapscale; mapsize; feature_lightdark; feature_pictureframe; feature_limitinventory; feature_asktell; deactivatecommandlinks; changedpov;

* player object *
List: name; elementtype; type; parent; external_gender; external_article; pov_alt; pov_used; alias; alt; look; gender; article; visible; displayverbs; inventoryverbs; take; use; givesingle; drop; isopen; open; close; container; descprefix; objectslistprefix; exitslistprefix; contentsprefix; description; scenery; hidechildren; listchildren; usedefaultprefix; volume; dark; lightstrength; darklevel; grid_width; grid_length; grid_fill; grid_border; grid_borderwidth; grid_bordersides; grid_render; grid_label; grid_parent_offset_auto; grid_parent_offset_x; grid_parent_offset_y; pov_alias; pov_look; pov_gender; pov_article; feature_usegive; feature_container; feature_switchable; feature_edible; feature_player; feature_lightdark; changedparent; changedisopen; changedlocked; changedswitchedon;

* room object *
List: name; elementtype; type; description; var; visible; displayverbs; inventoryverbs; take; use; givesingle; drop; gender; article; isopen; open; close; container; descprefix; objectslistprefix; exitslistprefix; contentsprefix; scenery; hidechildren; listchildren; usedefaultprefix; volume; dark; lightstrength; darklevel; grid_width; grid_length; grid_fill; grid_border; grid_borderwidth; grid_bordersides; grid_render; grid_label; grid_parent_offset_auto; grid_parent_offset_x; grid_parent_offset_y; pov_alias; pov_alt; pov_look; pov_gender; pov_article; feature_usegive; feature_container; feature_switchable; feature_edible; feature_player; feature_lightdark; changedparent; changedisopen; changedlocked; changedswitchedon;

Alex
Most of those are documented here http://docs.textadventures.co.uk/quest/elements/ under the game or object links. Some of those are just used internally so won't be documented, but if you have any questions let me know.

jaynabonne
Well, there you go! :)

Silver
Linux I can understand but you can at least duel-boot it with Windows. But mac? It used to be true that they were superior for music production because they placed audio at a higher priority than other background processes. It still came second to an Atari ST for the ultimate in reliable midi clock though. A mate of mine bought mac - I think it was £1,500+ and he uses it to watch some films and chat crap on facebook. Just, why? Buy something functional. If you want fashion buy some nice trousers lol.

jgm1077
Thanks a lot -- HegemonKhan for the specific info on this script and Jaybonne for the general info on the attributes.

I decided the way to go was to only put objects with at least one exit in the menu,

Teleport Script

menuList = NewStringList()
foreach (item, AllObjects()) {
exitList = ScopeExitsForRoom(item)
numberOfExits = ListCount(exitList)
if (numberOfExits>0) {
list add (menuList, item.name)
}
}
ShowMenu ("Go To?", menuList, true) {
if (result<>null) {
player.parent = GetObject(result)
}
}

and Silver: it is worse than you thought -- I have a Chromebook.

Silver
Ouch! I've only just discovered what those are recently. Perhaps even from posts you made: it was on either here or intfiction anyway that I read about them. My mate with the £1,500+ mac that he uses for films and facebook would be well suited for one.

The Pixie
jgm1077 wrote:I decided the way to go was to only put objects with at least one exit in the menu,

That is an excellent way to do it. You could also use the "visited" attribute to stop the player teleporting to a room he has not visited yet (but use GetBoolean, as it is true if the room has been visited and just missing otherwise).

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

Support

Forums