Not always resolving krpano variables.

  • When I enter vr mode, I have the following block to turn on the VR only hotspots in the tour:

    Code
    <action name="showVRHotspots">    for(set(i,0), i LT hotspot.count, inc(i),  set(hotspot[get(i)].visible, false);  if(hotspot[get(i)].tag == vr,        set(hotspot[get(i)].visible, true);      );  error("-----");  error(hotspot[get(i)].tag);  error(hotspot[get(i)].tooltip);  error(hotspot[get(i)].name);  error(hotspot[get(i)].visible);  error("-----");  if(hotspot[get(i)].tag == vr_menu,        set(hotspot[get(i)].visible, true);      );         );  </action>


    Grr, the code block keeps dismissing newlines....

    The problem is some of the hotspots with a "vr" tag don't get their visible set to true. The error output show "ERROR: hotspot[get(i)].tag" instead of the tag name. The hotspots that work correctly actually resolve that to the correct tag.

    What can I do to make sure the krpano variable always gets resolved?

    Thanks

  • i think the problem are your conditions
    you should check for "vr" and "vr_menu" in quotes
    if you use vr and vr_menu without quotes
    then the condition interprets them as variables
    and as they are unsed the condition is for both
    the same as if(hotspot[get(i)].tag == null, ...

    also maybe better use trace() or debug()
    for such output, not error()

  • Thanks for the help!

    They should be strings, sure. So I have fixed that, but that doesn't change the original problem:


    The error output from `error(hotspot[get(i)].tag);` shows
    "ERROR: hotspot[get(i)].tag" instead of:


    "ERROR: <actual tag name>".


    And to be clear, it is inconsistent. There are 10 + hotspots and some show the correct name, and some show "hotspot[get(i)].tag" instead.


    Tags such as "photo" and "text" print correctly. Tags "vr" do not. I even tried changing the tag to a nonsense string in case "vr" has some special meaning. I still get inconsistent output from the error debug statements.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!