How compare boolean from events occurred with if statement ( == and nested if statements )?

  • Do you use logical / releational operator "==" and nested if statements to test for the occurrence of multiple events? I gathered this code from

    A Tutorial on Krpano Action Arguments (pt 1)


    The type boolean found variables were declared local to each particular hotspot.


    if (hotspot[JohnCard].johnFound == true,
    if (hotspot[JamesCard].jamesFound == true,
    set(hotspot[bandUnited].visible,true);
    );

  • If I want to call an action after five events occur, How do I code the if statement that tests the "logical and" of multiple boolean tests.

    Five hotspot instances {one, two, three, four, five}
    Each instance has a boolean variable found attribute

    if( hotspot[one].found == true,
    if( hotspot[two].found == true,
    if( hotspot[three].found == true,
    if( hotspot[four].found == true,
    if( hotspot[five].found == true,
    showBandReunited();</action>
    );
    );
    );
    );
    </action>

    So that method showBandReunited is called when instances one.found and two.found and three.found and four.found and five.found are all true.

  • okay, sorry, there are some errors in the code:
    - there is one closing ');' missing
    - and there is a wrong closing '</action>' inside the action

    this would be right:

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!