JSDD wrote: ↑Thu, 22. Nov 18, 19:07
you want to figure out if the sector you´ve entered wasnt known before? then you´ve got to create a list of values beforehand, storing wheater it is known or not (is my first guess) ... when arriving, check the value stored in the list, and update it afterwards ... you want to figure out how to loop over a certain range of values?! => check out my example code pieces in my signature
...
Code: Select all
<cues>
<cue name="initCue">
<timing>
<time min="1s"/>
</timing>
<action>
<do_all>
<set_value name="earthKnown" exact="1"/><!-- this list is going to be endless! -->
<set_value name="moonKnown" exact="0"/>
<set_value name="venusKnown" exact="0"/>
</do_all>
</action>
</cue>
<cue name="cue01">
<condition>
<check_all>
<cue_is_complete cue="initCue"/>
<object_changed_sector/>
</check_all>
</condition>
<timing>
<time min="1s"/>
</timing>
<action>
<do_all>
<do_if value="{sector.known@sector.earth}" exact="1"><!-- this list is also going to be endless! -->
<set_value name="initCue.earthKnown" exact="1"/><!-- value@initCue.earthKnown? -->
</do_if>
<do_if value="{sector.known@sector.moon}" exact="1">
<set_value name="initCue.moonKnown" exact="1"/>
</do_if>
<do_if value="{sector.known@sector.venus}" exact="1">
<set_value name="initCue.venusKnown" exact="1"/>
</do_if>
</do_all>
</action>
<cues>
<cue>
<condition>
<cue_is_complete cue="cue01"/>
</condition>
<action>
<do_all>
<do_if value="initCue.earthKnown" exact="1"><!-- value@initCue.earthKnown? -->
<reward_player>
<money exact="1000"/>
</reward_player>
<remove_value value="initCue.earthKnown"/><!-- what happens if I remove a value, that's going to be checked in a loop...paradoxon of evil crash? -->
</do_if>
<do_if value="initCue.moonKnown" exact="1">
<reward_player>
<money exact="1000"/>
</reward_player>
<remove_value value="initCue.moonKnown"/><!-- remove needs to be done, so that the check doesn't happen all over again? -->
</do_if>
<do_if value="initCue.venusKnown" exact="1">
<reward_player>
<money exact="1000"/>
</reward_player>
<remove_value value="initCue.venusKnown"/><!-- because I want to get to know an unknown sector only once, to give reward for exploring -->
</do_if> <!-- otherwise that would only benefit the player, for doing mass jumps^^ -->
<reset_cue cue="cue01"/>
</do_all>
</action>
</cue>
</cues>
</cue>
</cues>
Edit:
Btw. if I'd just import a list like that upside, I could just as well do it like that, probably using less code, not using any resets...
Code: Select all
<cues>
<cue name="moonCue">
<condition>
<object_changed_sector/>
</condition>
<timing>
<time min="1s"/>
</timing>
<action>
<do_all>
<do_if value="{sector.known@sector.moon}" exact="1">
<reward_player>
<money exact="1000"/>
</reward_player>
</do_if>
</do_all>
</action>
</cue>
<cue name="moonCue">
<condition>
<object_changed_sector/>
</condition>
<timing>
<time min="1s"/>
</timing>
<action>
<do_all>
<do_if value="{sector.known@sector.venus}" exact="1">
<reward_player>
<money exact="1000"/>
</reward_player>
</do_if>
</do_all>
</action>
</cue>
</cues>
It doesn't necessarily matter if I set up a list, as long as MD can't handle lists, groups, whatever, dynamically. That is the simple solution that MD is supposed to deliver, as it is a simple one liner...
Code: Select all
<do_if value="{sector.known@player.sector}" exact="1" & value="initCue.unknownMoon" exact="0">
...bla bla bla give reward
...bla bla bla set initCue.unknownMoon exact="1"
</do_if>
The whole reason why MD is so complicated, is because it can't handle processing two value comparisons. It can't even handle a <do_if> after a <do_if>.
Btw. you bet I already figured how to make endless lists as long as 14 days back. Figuring how endless those lists would be, I tried to figure how to make this dynaically. But obviously MD isn't a script engine.