Loadscenes depending on title

  • I want to create a button that depending on the scene title/name loads another pano, pretty much like this:


    Code
    <plugin name="measure" url="skin/measure_btn.png" keep="true" enabled="true" edge="bottomleft" x="0" y="0" scale="0.45" alpha="1" visible="true" onclick="loadpanos()"/>
    <action name="loadpanos">  if(scene.title == scene_kitchen, loadscene(scene_kitchen2, null, MERGE, BLEND(1)));  if(scene.title  == scene_bath, loadscene(scene_bath2, null, MERGE, BLEND(1)));</action>


    I have tried many different version of the "if(... == " but I just can't get my head to make it work, what should I search for after the if statement to get it to work?

  • No if needed. Define scene to load when scene started and send it to loadpano like in this examlpe:
    Link: (logo is your button)
    Code:

  • I didn't sad that it is not possible. I sad it is not needed. If you have 50 sceene why to make 50 IFs?
    You would anyway need to use scene name to be able to access to scene[pano1_2].title so instead of sending scene name into action with so many IFs you could simply define .scene_to_load and use them instead and skipp all not needed IFs.

  • I got your example to work but it is not a good solution for me, it requires me to type manually in every scenes onstart to what the destination will be.

    I always know the names of the scenes in every tour I create, I always have a bath, bath2, kitchen, kitchen2 etcetera..


    It would be easier for me to only create one button which has all of the code since I do not know how to manipulate the multires vtour properly to be able to read the correct names of the scene and then create the correct onstart to that specific scene.

  • Don't get it but you know what you are doing. Here is the code for this:
    Example:
    Code:

Participate now!

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