jaynabonne wrote:Asyranok: Yeah, I tried that as well. I even tried removing the "firsttime". No joy.
levicki: Good idea. It works fine that way.
switch (result) {
case ("Move to first spot") {
Constellation01.order = 1
}
case ("Move to second spot") {
Constellation01.order = 2
}
...
<order_dictionary type="stringdictionary">
<item>
<key>Move to first spot</key> // or even better just "first"
<value>1</value>
</item>
<item>
<key>Move to second spot</key> // or even better just "second"
<value>2</value>
</item>
...
</order_dictionary>
order = StringDictionaryItem(order_dictionary, player_choice) // where player_choice is a string "Move to first spot", etc
Asyranok wrote:Thanks, Levicki, I will change that as soon as I have the time. It looks more efficient.
if (condition1) {
if (condition2) {
if (condition3) {
msg ("yes")
}
else {
msg ("no")
}
}
else {
msg ("no")
}
}
else {
msg ("no")
}
<template name="Yes">Here comes a story continuation once all the conditions are met.</template>
<template name="No">Here comes my really long explanation why you can't do something until all the conditions are met.</template>
...
msg(Template("No"))
if (condition1 and condition2 and condition3) {
msg (Template("Yes"))
}
else {
msg (Template("No"))
}
game.turns = game.turns + 1
<function name="game_turns_function" parameters="turns">
game.turns = game.turns + turns
</function>
<turnscript name="game_turns_turnscript">
game_turns_function(1)
<turnscript>
<exit alias="south" to="lounge">
<inherit name="southdirection" />
<attr name="turns" type="integer">5</attr>
<script type="script">
... process your exit checking, unlocking, etc ...
game_turns_function(this.turns)
</script>
</exit>
Object-oriented coding techniques make it easy to
extend one class into another, but there is a risk of confusion
and error when the new class is so different from the original
that it might as well be a completely new class.
A deep inheritance tree complicates the
problems of changing something in a base class without
adversely affecting many classes that inherit from it.