iiYO Community

Full Version: Old undocumented behaviour of choice
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
While adding nesting for
Code:
<choice>
command, i found some attributes that are not documented on wiki, which affects
Code:
<choice>
work a lot, they are
Code:
hide="false"
and
Code:
next="false"
.

Both of them are really misterious for me, I don't get the point, what are they intended for.

With
Code:
next="false"
player gets the blank screen, already without a meny, without the next event yet.

Code:
hide="false"
is not compatible with nesting in general, because another interactive interface element may appear behind or above the menu that is still not hidden.

Are whose undocumented features really needed or are they some rudimentary debug leftovers?

Guest

I'm not sure, to be honest. I've never used those attributes and I don't think anyone else ever has (since they're not documented - which is a good hint that I didn't intend to release them at the time). If they ever served a purpose, which is doubtful, they don't now. I guess you can safely remove them. If we find out what they were intented to be used for we can add them back in if necessary - in a non-broken way. Wink

Guest

Ok, removed support for legacy
Code:
hide="false">
and
Code:
next="false">
. (see https://github.com/jsteinbeck/WebStory-Engine/pull/20 )

The only open question is if should we allow this situation and how to handle it:
Code:
<choice>
                <option label="scene, var children" scene="text">
                    <var name="text" value="SIMPLE" />
                </option>
            </choice>

I think this can be allowed so that a jump is performed AND a frame is added to a stack to execute commands inside. If you are ok with this implementation, i will add this.

Guest

I think it's a little confusing, to be honest. I suppose it would be clearer to not allow elements inside of option when there's a scene= jump defined.

Thanks for the changes! Smile

Guest

Well, anyway this was allowed in 0.3 for
Code:
<var/>
children, which may be useful for situations like this:
Code:
<choice>
    <option label="To town center" scene="town_center"/>
    <option label="To marketplace" scene="marketplace"/>
    <option label="To King's castle" scene="castle" ifvar="been_to_castle" ifnot="1">
        <var name="been_to_castle" value="1"/>
    <option>
</choice>

So, as it was allowed, I thought of generalizing this behaviour to allow just any commands in this case too.

Code:
<option label="123" scene="XXX">
    ...
<option>
in general should IMHO have the same semantics as
Code:
<option label="123" >
    ...
    <goto scene="XXX">
<option>

This means that block is evaluated before scene XXX is started and if block contain tricky stuff like
Code:
<goto scene="YYY">
, then XXX will not even be reached, just like in case of
Code:
<option label="123" >
    <goto scene="YYY">
    <goto scene="XXX">
<option>

In fact, this is not much different from what i was already doing with a call stack in
Code:
<option>
, and I was so unwaitful, that supported this yesterday ( https://github.com/lolbot-iichan/WebStor...dd4bcc1f2c ). Bad thing that it was automaticly added to my current pull-request.

I can remove allowing commands inside
Code:
<option label="123" scene="XXX">
completely, but it will break backward compatibility with 0.3. Allowing only
Code:
<var/>
seems wrong and unfair to me, because once you put
Code:
<var/>
here, you might want to put custom commands and stuff like
Code:
<set_vars/>
as well.

Guest

Well, I guess you're right. Let's leave this feature in there then.

Guest

Ok, then i'll just jeave this as it is at my pull request.