<!--Saved by Quest 5.6.5510.29036-->
<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="forest">
<gameid>14bb0e0b-4b6c-4c27-96fa-c6c7e975d392</gameid>
<version>1.0</version>
<firstpublished>2015</firstpublished>
</game>
<object name="hut">
<inherit name="editor_room" />
<description>You are in a wooden hut</description>
<alias>Hut</alias>
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
<exit alias="out" to="forest_path">
<inherit name="outdirection" />
</exit>
</object>
<object name="e_forest">
<inherit name="editor_room" />
<object name="forest_path">
<inherit name="editor_room" />
<description>There is a hut you can go in, or a path going east.</description>
<alias>Forest Path</alias>
<transparent />
<exit alias="east" to="forest_clearing">
<inherit name="eastdirection" />
</exit>
<exit alias="in" to="hut">
<inherit name="indirection" />
</exit>
</object>
<object name="forest_clearing">
<inherit name="editor_room" />
<alias>Forest Clearing</alias>
<description>A clearing.</description>
<transparent />
<exit alias="west" to="forest_path">
<inherit name="westdirection" />
</exit>
</object>
<object name="tree">
<inherit name="editor_object" />
<scenery />
<look>It is a tall thing with leaves on.</look>
<alt type="stringlist">
<value>trees</value>
</alt>
</object>
<object name="sky">
<inherit name="editor_object" />
<look>The sk is blue; it is a great day.</look>
</object>
</object>
</asl>
A rabbit watches you.
A gust of wind rustles the leaves.
Butterflies chase each other over the flowers.
rabbit
butterfly|butterflies
It is a large brown bunny with big floppy ears.
The butterflies are bright blue.
flavour_object.parent = game
if (HasAttribute(game.pov.parent, "parent")) {
if (HasAttribute(game.pov.parent.parent, "flavour")) {
n = GetRandomInt(0, 20)
if (n < ListCount(player.parent.parent.flavour)) {
msg (StringListItem(player.parent.parent.flavour, n))
if (HasAttribute(player.parent.parent, "flavournames") and HasAttribute(player.parent.parent, "flavourdescs")) {
if (n < ListCount(player.parent.parent.flavournames) and n < ListCount(player.parent.parent.flavournames)) {
if (not StringListItem(player.parent.parent.flavournames, n) = "" and not StringListItem(player.parent.parent.flavournames, n) = "") {
flavour_object.parent = player.parent
flavour_object.alt = Split(StringListItem(player.parent.parent.flavournames, n), "|")
flavour_object.look = StringListItem(player.parent.parent.flavourdescs, n)
}
}
}
}
}
}
<!--Saved by Quest 5.6.5510.29036-->
<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="forest">
<gameid>14bb0e0b-4b6c-4c27-96fa-c6c7e975d392</gameid>
<version>1.0</version>
<firstpublished>2015</firstpublished>
<roomenter type="script"><![CDATA[
flavour_object.parent = game
if (HasAttribute(game.pov.parent, "parent")) {
if (HasAttribute(game.pov.parent.parent, "flavour")) {
n = GetRandomInt(0, 5)
if (n < ListCount(player.parent.parent.flavour)) {
msg (StringListItem(player.parent.parent.flavour, n))
if (HasAttribute(player.parent.parent, "flavournames") and HasAttribute(player.parent.parent, "flavourdescs")) {
if (n < ListCount(player.parent.parent.flavournames) and n < ListCount(player.parent.parent.flavournames)) {
if (not StringListItem(player.parent.parent.flavournames, n) = "" and not StringListItem(player.parent.parent.flavournames, n) = "") {
flavour_object.parent = player.parent
flavour_object.alt = Split(StringListItem(player.parent.parent.flavournames, n), "|")
flavour_object.look = StringListItem(player.parent.parent.flavourdescs, n)
}
}
}
}
}
}
]]></roomenter>
<object name="flavour_object">
<inherit name="editor_object" />
</object>
</game>
<object name="hut">
<inherit name="editor_room" />
<description>You are in a wooden hut</description>
<alias>Hut</alias>
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
<exit alias="out" to="forest_path">
<inherit name="outdirection" />
</exit>
</object>
<object name="e_forest">
<inherit name="editor_room" />
<flavour type="stringlist">
<value>A rabbit watches you.</value>
<value>A gust of wind rustles the leaves.</value>
<value>Butterflies chase each other over the flowers.</value>
</flavour>
<flavournames type="stringlist">
<value>rabbit</value>
<value></value>
<value>butterfly|butterflies</value>
</flavournames>
<flavourdescs type="stringlist">
<value>It is a large brown bunny with big floppy ears.</value>
<value></value>
<value>The butterflies are bright blue.</value>
</flavourdescs>
<object name="forest_path">
<inherit name="editor_room" />
<description>There is a hut you can go in, or a path going east.</description>
<alias>Forest Path</alias>
<transparent />
<exit alias="east" to="forest_clearing">
<inherit name="eastdirection" />
</exit>
<exit alias="in" to="hut">
<inherit name="indirection" />
</exit>
</object>
<object name="forest_clearing">
<inherit name="editor_room" />
<alias>Forest Clearing</alias>
<description>A clearing.</description>
<transparent />
<exit alias="west" to="forest_path">
<inherit name="westdirection" />
</exit>
</object>
<object name="tree">
<inherit name="editor_object" />
<scenery />
<look>It is a tall thing with leaves on.</look>
<alt type="stringlist">
<value>trees</value>
</alt>
</object>
<object name="sky">
<inherit name="editor_object" />
<look>The sk is blue; it is a great day.</look>
</object>
</object>
</asl>
Marzipan wrote:As an addition to the 'no coding' example, I just want to point out that if your game takes place entirely in a forest, you could just add a game-wide command for examining the trees. Or if your player will spend most of their time in outside locations, having one of these for the sky is handy. Some jerk always wants to test your attention to detail by examining the sky. (I'm that jerk, it's me)
invoke (ScriptDictionaryItem (Object_name.Script_Dictionary_Attribute_name, StringListItem (Object_name.String_List_Attribute_name, GetRandomInt (0, ListCount (Object_name.String_List_Attribute_name) - 1))))
eagle7000 wrote:First of all, thanks for the helpful tips and tutorials!
I'm stumped on the string attributes - I am using the online game editor on a mac to the extent that makes a difference. I can add the flavour "object", move the rooms into the e_room add the code but cannot figure out how to adjust the string attributes or even what that means / how one accesses same. Help would be much appreciated!
[]Set object [name][ ]
Attribute: ["" ]
Value [ ]
[]Set object [name][lounge ]
Attribute: ["transparent" ]
Value [true ]
Oh, I also get the following errors after adding my e_room and then moving the individual rooms into same:
Could not set value 'not StringListItem(player.parent.parent.flavournames, n) = "" and not StringListItem(player.parent.parent' - The number of opening brackets "(" does not match the number of closing brackets ")".
Could not set value 'not StringListItem(player.parent.parent.flavournames, n) = "" and not StringListItem(player.parent.parent' - The number of opening brackets "(" does not match the number of closing brackets ")".
if (HasAttribute(player.parent.parent, "flavournames") and HasAttribute(player.parent.parent, "flavourdescs")) {
if (n < ListCount(player.parent.parent.flavournames) and n < ListCount(player.parent.parent.flavournames)) {
if (not StringListItem(player.parent.parent.flavournames, n) = "" and not StringListItem(player.parent.parent.flavournames, n) = "") {
Perhaps relatedly, I don't see any option to make a room transparent. Thanks for any assistance you can offer!