I know this is code stuff, and being a new person you're probably using the GUI~Editor, but it's easier for me to try to explain stuff this way, hopefully, you can figure out how to do this stuff in the GUI~Editor on your own, but if not I can help you, but it takes a lot longer (more work) to explain how to do things via the GUI~Editor, than it does with code.
http://quest5.net/wiki/Category:All_Fun ... t_Commands (page 1, range: A-S)
http://quest5.net/w/index.php?title=Cat ... h#mw-pages (page 2, range: S-Z)
-----------
I'm still trying to learn how Object Lists work... (Jayna explained it to me), but I'm not able to get them to work, I don't know if you have to actually have the Objects within the same place as your Object List or not, I haven't had much time to work on figuring out how Object Lists work yet.
so hopefully someone else can help you, who knows exactly how to do this for you, but I can still offer some help (even if it doesn't exactly work correctly)
-------------------
Lists (String Lists and Object Lists) and Dictionaries (String Dictionaries, Object Dictionaries, and Script Dictionaries) are not easy for new people to understand. And, what you're asking for, is pretty complicated too.
think of a list as a 'pot or basket' which holds options~choices of "Strings" or "Objects", which you can grab-n-use: all of them, some of them specifically, some of them randomly, or all of them randomly.
A 'String' is a collection of characters (not all though), for examples:
a
1
abc
3716
a_3jn_3d8_redblueyellow
A 'String List' is a collection of choices~options (strings), for example:
1, 2, 3
a, b, c
red, blue, yellow
----------------
conceptually about "Spliting" and "Joining", for example:
http://quest5.net/wiki/Splithttp://quest5.net/wiki/JoinString: redblueyellow
String List: (1) red, (2) blue, or (3) yellow
a "String" is "split (apart)" into multiple separate strings to make a "String List"
a "String List" (multiple separated strings) is "joined (together)" to make a single (long) "String"
(You shouldn't be using "Join" much, as it doesn't have much use for basic stuff, unless you're doing much more complex code stuff, lol)
-------------
for yourself to do this later on, I'd first work on learning to use lists and dictionaries as basic and simple as you can, for example:
try to do the character creation as it uses lists:
http://quest5.net/wiki/Character_Creationhttp://quest5.net/wiki/Showing_a_menuhttp://quest5.net/wiki/Using_Liststhere's 3 ways to create a String List or Object List:
split ("option_1;option_2;option_3;etc" , ";")
split ("object_1;object_2;object_3;etc" , ";")
~or~
my_string_list = NewStringList ()
list add (my_string_list, option_1)
list add (my_string_list, option_2)
list add (my_string_list, option_3)
etc list add (my_string_list, etc)
my_object_list = NewObjectList ()
list add (my_object_list, object_1)
list add (my_object_list, object_2)
list add (my_object_list, object_3)
etc list add (my_object_list, etc)
~or~
(for objects, you can also get them from a room, other objects, or entire game, and put them into your list, for example...)my_object_list = ScopeInventory () // or 'AllObjects ()', or 'ScopeVisibleNotHeld ()', or etc Scopes
-------------------
"foreach" and "for"
http://quest5.net/wiki/Foreachforeach (team_member_x, team_members_string_list) {
-> team_member_x.run_laps
}
Every~All~(*Each*) team member ("team_member_x"), on the team ("team_members_string_list), is to run laps.
http://quest5.net/wiki/Forit's basically the same thing, except you can specify which 'team members', to do the action ('run laps') upon~with.
so for example:
team_members_string_list: (0) john, (1) jim; (2) jeff; (3) jake; (4) julius
(String List items start their counting~listing with 0, not 1, and starts from left to right as seen above)
foreach (all~every~*each*): john.run_laps, jim.run_laps, jeff.run_laps, jake.run_laps, and julius.run_laps
for (2,2): jeff.run_laps
for (1,3): jim.run_laps, jeff.run_laps, and jake.run_laps
for (1,3,2): jim.run_laps and jake.run_laps
for (0,4,2): john.run_laps, jeff.run_laps, and julius.run_laps
for (0,4,3): john.run_laps and jake.run_laps
for (0,4,4): john.run_laps and julis.run_laps
(I think you get the idea now)
-----------------
dictionaries are a bit more complicated to understand than lists.
think of dictionaries as 'tables' (or whatever you call it, lol):
(pretend that there's an expedition and there's only so much food, that to feed everyone ~keep everyone alive, food must be properly rations and divided, as an example)
(pretend that I made a table~grid~spread sheet ~ whatever you call it, lol)
family size: 1 ~ 2 ~ 3 ~~ 4
fish given: 5 ~ 10~ 15 ~ 20
1 = 5
2 = 10
3 = 15
4 = 20
(input) families of 1, (output) get 5 fish
(input) families of 2, (output) get 10 fish
(input) families of 3, (output) get 15 fish
(input) families of 4, (output) get 20 fish
A String Dictionary is literally: string_1 = string_2
an example of it's application:
1 = hi
2 = bye
1 ---> hi
2 ---> bye
if input is "1", then output is "hi"
if input is "2", then output is "bye"
a useful application of this is in a game with magic elements (doing more damage against opposite element, and less damage or no damage or damage gets absorbs or reflected ~lol~ against same element), though it's full scripting is a bit more complex.
fire = water
water = fire
fire ---> water
water ---> fire
monster.elemental = water
spell.elemental = fire
if cast fire spell (spell.elemental), fire -> water, if (water=monster.elemental), then you do x2 damage, else if (spell.elemental = monster.elemental), then do zero damage, else do x1 damage
Object Dictionary is the same thing, but it's equal to an object:
string_1 = object_1
1 = soccer ball
2 = baseball ball
red = apple
yellow = lemon
Script Dictionary is the same thing, but it's equal to a script:
string_1 = script_1
1 = msg ("hi")
2 = msg ("bye")
red = msg ("apple")
yellow = msg ("lemon")
--------------
if you want to take a look at a "game" that uses lists and dictionaries, though it's not exactly for what you need as it deals with traveling, it's got many of the same aspects:
<asl version="540">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="Testing Game Stuff">
<gameid>eef801a1-4e6b-4b0a-bdbf-8f3ecfa8389c</gameid>
<version>1.0</version>
<firstpublished>2013</firstpublished>
<turns type="int">0</turns>
<statusattributes type="simplestringdictionary">turns=</statusattributes>
<start type="script">
msg ("Important Note:")
msg ("Type in: help")
</start>
</game>
<object name="homeland">
<inherit name="editor_room" />
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
</object>
<object name="grassland">
<inherit name="editor_room" />
</object>
<object name="plains">
<inherit name="editor_room" />
</object>
<object name="desert">
<inherit name="editor_room" />
</object>
<object name="tundra">
<inherit name="editor_room" />
</object>
<object name="swampland">
<inherit name="editor_room" />
</object>
<object name="mountains">
<inherit name="editor_room" />
</object>
<object name="forest">
<inherit name="editor_room" />
</object>
<object name="wasteland">
<inherit name="editor_room" />
</object>
<object name="coastland">
<inherit name="editor_room" />
</object>
<object name="hills">
<inherit name="editor_room" />
</object>
<command name="help_command">
<pattern>help</pattern>
<script>
help_function
</script>
</command>
<command name="explore_command">
<pattern>explore</pattern>
<script>
explore_function
</script>
</command>
<command name="travel_command">
<pattern>travel</pattern>
<script>
travel_function
</script>
</command>
<object name="data_object">
<inherit name="editor_object" />
<travel_string_list type="simplestringlist">homeland</travel_string_list>
<homeland_events_string_list type="simplestringlist">grassland_discovery;plains_discovery;desert_discovery;tundra_discovery;swampland_discovery;forest_discovery;mountains_discovery;hills_discovery;wasteland_discovery;coastland_discovery</homeland_events_string_list>
<homeland_events_script_dictionary type="scriptdictionary">
<item key="grassland_discovery">
list add (data_object.travel_string_list, "grassland")
msg ("You've discovered the grassland! Now, you can travel to the grassland and explore it!")
</item>
<item key="plains_discovery">
list add (data_object.travel_string_list, "plains")
msg ("You've discovered the plains! Now, you can travel to the plains and explore it!")
</item>
<item key="desert_discovery">
list add (data_object.travel_string_list, "desert")
msg ("You've discovered the desert! Now, you can travel to the desert and explore it!")
</item>
<item key="tundra_discovery">
list add (data_object.travel_string_list, "tundra")
msg ("You've discovered the tundra! Now, you can travel to the tundra and explore it!")
</item>
<item key="swampland_discovery">
list add (data_object.travel_string_list, "swampland")
msg ("You've discovered the swampland! Now, you can travel to the swampland and explore it!")
</item>
<item key="forest_discovery">
list add (data_object.travel_string_list, "forest")
msg ("You've discovered the forest! Now, you can travel to the forest and explore it!")
</item>
<item key="mountains_discovery">
list add (data_object.travel_string_list, "mountains")
msg ("You've discovered the mountains! Now, you can travel to the mountains and explore it!")
</item>
<item key="hills_discovery">
list add (data_object.travel_string_list, "hills")
msg ("You've discovered the hills! Now, you can travel to the hills and explore it!")
</item>
<item key="wasteland_discovery">
list add (data_object.travel_string_list, "wasteland")
msg ("You've discovered the wasteland! Now, you can travel to the wasteland and explore it!")
</item>
<item key="coastland_discovery">
list add (data_object.travel_string_list, "coastland")
msg ("You've discovered the coastland! Now, you can travel to the coastland and explore it!")
</item>
</homeland_events_script_dictionary>
</object>
<turnscript name="global_turnscript">
<enabled />
<script>
game.turns = game.turns + 1
</script>
</turnscript>
<function name="help_function">
msg ("Type 'explore' to explore your area.")
msg ("Type 'travel' to travel to different areas.")
</function>
<function name="explore_function"><![CDATA[
switch (game.pov.parent) {
case (homeland) {
result_1 = ListCount (data_object.homeland_events_string_list) - 1
if (result_1 >= 0) {
result_2 = StringListItem (data_object.homeland_events_string_list,GetRandomInt(0,result_1))
invoke (ScriptDictionaryItem (data_object.homeland_events_script_dictionary,result_2))
on ready {
foreach (item_x, split ("grassland_discovery;plains_discovery;desert_discovery;tundra_discovery;swampland_discovery;forest_discovery;mountains_discovery;hills_discovery;wasteland_discovery;coastland_discovery",";")) {
if (result_2 = item_x) {
list remove (data_object.homeland_events_string_list, result_2)
}
}
}
} else {
msg ("There seemingly is nothing left to explore in this area.")
}
}
}
]]></function>
<function name="travel_function">
show menu ("Where do you wish to travel?",data_object.travel_string_list,false) {
if (not game.pov.parent = GetObject (result)) {
game.pov.parent = GetObject (result)
} else {
msg ("You are already at this area.")
ask ("Try again?") {
if (result=true) {
travel_function
} else {
msg ("You realize that you need to discover a new area to travel to first, before you can travel to that place.")
}
}
}
}
</function>
</asl>
or, the game file is an attachment at the bottom, you can download.
-----------
conceptually what you want~need~are to do~doing is this:
have a Non-Room (and Non-Player) Object existing by itself like it's a room (the Object isn't within a room). This will be our secret 'storage' (or 'data object') object that the game player doesn't know about. We use this secret Object to hold our needed Attributes and (the will be randomly selected) Objects. So, put~create~add your random objects into this secret Object, and then we'll need to make~add the Attributes needed as well.
If you want your "turns" Attribute to be shown in the right pane during game play, then you'll to create~add it to either the "game" Object or to a Player Object, such as your default "player" Player Object. Or, we can still display the "turns" via a similar effect of like a "stats screen", which we can do with a Command (you type in something to see your turns and~or other info) or via buttons~hyperlinks. I don't know how you want it done, lol.
As for 'after x turns move object here', this is achieved either via a Turnscript or the special 'changed' Script, and our 'turns' Attribute (and a turns increasing script). Also, in the scripting, we'll use the % sign to achieve the 'after x turns'.
I know you said this already, but for completeness, to randomly select three objects to move to 3 specific rooms:
you need an Object List Attribute, and the 'GetRandomInt' Script, and a 'moving' Script. You'll also need 'list remove' script too, so for the 2nd and 3rd time the 'GetRanomInt' script is run, you're not selecting the same object that you already selected and moved. And, you'll need to re-add the objects back to the object list too with 'list add' script.
as for moving random objects to random rooms (can you specify whether its the same objects and rooms that you acted upon at the start of the game, or are you talknig about after x turns moving randomly new objects to new rooms), you're basically using 'GetRandomInt' Script with: an Object List Script for the Objects and also an Object List Script for the Rooms.
--------------
if you still need help, let me know, and I can try to craft coding for you ~ what you want, but it'd take me some time to do so.
---------------