I'm relatively new to the programming side but do have some basic idea on html, css and Javascript. I'm currently making a bit of a RPG on SugarCube. As I mentioned, I'd like to have multiple events that could happen as part of a passage you can revisit. I was able to make the basic idea work with if/else conditionals:
Exploring...
<<set $explore = random(99)>>Debug: $explore
<<if !$foundLocationA && !$foundLocationB>>
<<if $explore < 50>> [[Random Event]]
<<elseif $explore < 80>> [[Location A]]
<<else>> [[Location B]]
<</if>>
<<elseif $foundLocationA && !$foundLocationB>>
<<if $explore < 80>> [[Random Event]]
<<else>> [[Location B]]
<</if>>
<<elseif !$foundLocationA && $foundLocationB>>
<<if $explore < 70>> [[Random Event]]
<<else>> [[Location A]]
<</if>>
<<elseif $foundLocationA && $foundLocationB>>
[[Random Event]]
<</if>>
Basically if I wanted such that there are multiple events more than Random Event, B, C here; if I found A or B I will no longer be able to find it again (I have another passage for old locations). Going to location A and B will set the foundlocationA/B to true which unlocks it for old locations. Is there some easier way to do this? (someone mentioned me used nodes not sure how) This would drive me insane if I have to repeat this for Location A-Z.
Exploring...
<<set $explore = random(99)>>Debug: $explore
<<if !$foundLocationA && !$foundLocationB>>
<<if $explore < 50>> [[Random Event]]
<<elseif $explore < 80>> [[Location A]]
<<else>> [[Location B]]
<</if>>
<<elseif $foundLocationA && !$foundLocationB>>
<<if $explore < 80>> [[Random Event]]
<<else>> [[Location B]]
<</if>>
<<elseif !$foundLocationA && $foundLocationB>>
<<if $explore < 70>> [[Random Event]]
<<else>> [[Location A]]
<</if>>
<<elseif $foundLocationA && $foundLocationB>>
[[Random Event]]
<</if>>
Basically if I wanted such that there are multiple events more than Random Event, B, C here; if I found A or B I will no longer be able to find it again (I have another passage for old locations). Going to location A and B will set the foundlocationA/B to true which unlocks it for old locations. Is there some easier way to do this? (someone mentioned me used nodes not sure how) This would drive me insane if I have to repeat this for Location A-Z.