//roll 4 dice with 5 sides
result=DiceRoll("4d5")
if (result>15){
msg ("A gold sword is perched upon a shelf in the weapons room.")}
<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="testing game stuff">
<gameid>d2b3cb55-fe14-4743-a5ba-fb1e7056e656</gameid>
<version>1.0</version>
<firstpublished>2015</firstpublished>
<author>HegemonKhan</author>
<pov type="object">player</pov>
<start type="script">
explore_function
</start>
</game>
<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
</object>
<object name="global_data_object">
<inherit name="editor_object" />
<attr name="location_stringlist_attribute" type="simplestringlist">hub;town;castle;cave</attr>
<attr name="hub_stringlist_attribute" type="simplestringlist">wagon</attr>
<attr name="town_stringlist_attribute" type="simplestringlist">tavernmaid</attr>
<attr name="castle_stringlist_attribute" type="simplestringlist">sword;axe</attr>
<attr name="cave_stringlist_attribute" type="simplestringlist">goblin;dragon</attr>
<global_scriptdictionary_attribute type="scriptdictionary">
<item key="hub">
invoke (ScriptDictionaryItem (global_data_object.global_scriptdictionary_attribute, StringListItem (global_data_object.hub_stringlist_attribute, GetRandomInt (0,ListCount (global_data_object.hub_stringlist_attribute)-1))))
</item>
<item key="town">
invoke (ScriptDictionaryItem (global_data_object.global_scriptdictionary_attribute, StringListItem (global_data_object.town_stringlist_attribute, GetRandomInt (0,ListCount (global_data_object.town_stringlist_attribute)-1))))
</item>
<item key="castle">
invoke (ScriptDictionaryItem (global_data_object.global_scriptdictionary_attribute, StringListItem (global_data_object.castle_stringlist_attribute, GetRandomInt (0,ListCount (global_data_object.castle_stringlist_attribute)-1))))
</item>
<item key="cave">
invoke (ScriptDictionaryItem (global_data_object.global_scriptdictionary_attribute, StringListItem (global_data_object.cave_stringlist_attribute, GetRandomInt (0,ListCount (global_data_object.cave_stringlist_attribute)-1))))
</item>
<item key="goblin">
if (RandomChance (20)) {
msg ("You encounter a goblin in the cave.")
} else {
msg ("You don't encounter a goblin in the cave.")
}
</item>
<item key="dragon">
if (RandomChance (10)) {
msg ("You encounter a dragon in the cave.")
} else {
msg ("You don't encounter a dragon in the cave.")
}
</item>
<item key="sword">
if (RandomChance (25)) {
msg ("You find a sword in~at the castle.")
} else {
msg ("You don't find a sword in~at the castle.")
}
</item>
<item key="axe">
if (RandomChance (90)) {
msg ("You find an axe in~at the castle.")
} else {
msg ("You don't find an axe in~at the castle.")
}
</item>
<item key="tavernmaid">
if (RandomChance (50)) {
msg ("You encounter a tavernmaid at~in the town.")
} else {
msg ("You don't encounter a tavernmaid at~in the town.")
}
</item>
<item key="wagon">
if (RandomChance (75)) {
msg ("You encounter a wagon at the hub.")
} else {
msg ("You don't encounter a wagon at the hub.")
}
</item>
</global_scriptdictionary_attribute>
</object>
<function name="explore_function">
show menu ("Explore?", global_data_object.location_stringlist_attribute, false) {
invoke (ScriptDictionaryItem (global_data_object.global_scriptdictionary_attribute, result))
on ready {
explore_function
}
}
</function>
</asl>
HegemonKhan wrote:
scb wrote:"HegemonKhan"
Thank you very much for your time & reply!
Clearly I'm trying to launch a space shuttle without even knowing how to use a microwave.
I see I'm going to have to learn a lot. Explaining anything further to me would be a waste of your time as it currently stands, as I won't understand it anyway. I'll go and learn. Thanks again.