autotour step increment

  • Hallo,
    I put together a simple autotour, going through the scenes showing one full circle each. If user input, it should start with the scene where the user started klicking.
    Problem: after falling back to the autotour, it doesn't start the scene where the user left, but at the next one (step + 1)!
    How could I solve this?
    May be I need something checking if the 360° are finished. I tried "nonblocking, donecall" - no difference...

    this is my autotour: panotour Buchara
    this is the relevant code:

  • I tried, as a workaround, to decrease step, like so:

    Code
    set(idletime,8);
    	  set(events.onidle, dec(step) );
    	  set(events.onidle, autotour() );


    Nothing changes.
    I'm clueless, no answer on this problem since months and I don't know how I could learn this krpano actions coding. I can work through the examples and build tours accordingly - but there is nothing on autotours for instance - a very important feature.
    Usually, as a non-coder, I'm able to work my way through things with the help of the community <3 I learnt flash actionscript that way even.
    But here, I'm desperate.
    No step forward.

    On other questions, Klaus, you gave me advice...

    Iit's often mentioned in the forum: the lack of docu or tuts to dive into the language...

    sorry for rude tone, but I'm really hacked off ^^

  • I would try to set the set(step,1) inside the action autotour.
    if interrupted, than the actual action is on break...
    ... if events.onidle takes place, the step value is no longer 1, so if action autotour is starting again, its not beginning with step == 1 ...
    ... so I asume the tour starts at first pano again (so not that what you want either...

    an what if you try:

    Code
    set(events.onidle, dec(step); autotour(); );


    instead of using 2 lines...

    Liebe Gruesse,
    Georg

  • danke, danke Georg!!! an answer!!! I couldn't sleep last night because of fear of not being able to learn this code...
    last of your ideas works... though I don't understand the syntax.
    If I try to translate the row: set(events.onidle, dec(step); autotour();)
    first part: according to documentation set the variable "events.onidle" to "dec(step)" - this doesn't make sense...
    why the senicolon, what does "autotour()" refer to??
    but it is also being executed, when no user input after idletime, as desired...
    Why dosn't it work when split into two lines, as was??

    and still, I don't understand, why it needs this workaround and doesn't just do what we want, start at the current step after idletime...

    Just to learn the structure...

  • its easy - as everything in live - if you know it ;-)))

    in above example, in action startup events.onidle get the command to execute: autotour().
    this means that the action autotour will be executed. But what do you have to do if the events.onidle should execute more than one action or command?
    For this the ; is used:

    set(events.onidle, dec(step); autotour(); );
    this now says that the events.onidle should execute: 1. reduce the value of variable step with 1 and than 2. execute the code in action autotour. The () says that no additional values are assigned to the action autotour.

    it does not work if using two lines ... I assume that the last assignement is valid so when the autotour() is executed the dec(step) is no longer valid.
    (but this I dont know... if events.onidle would be an ordinary variable your approach would have success, but because events.onidle is no variable this is handled other way...)

    Quote

    and still, I don't understand, why it needs this workaround and doesn't just do what we want, start at the current step after idletime


    in line 10 and 11 of your code at the end you have places the inc(step). The value of variable step get a new value assigned +1. and this value does remain valid during execution of all of your xml code. The value of the variable does not expire or does not get reset it remains valid until you give the variable a new value.

    so step==1 ... first pano gets loaded .... step get the value 2
    so step==2 ... second pano gets loaded ... step get the value 3
    lets say you now interrupt with a mousclick.... the action autotour is left...
    what happens now... the onidle counter is starting and if event is true (the idletimeout has reached) than the autotour() action will be executed again.
    but now the step==3 so normally it should now proceed with step3 pano... why in your original case the pano4 is shown I cant explain.
    if you place the line "set(step,1);" at the beginning of the action autotour() the behaviour should change so that after every idletimeout the tour should automatically start with pano 1

    Liebe Gruesse,
    Georg

  • gorgious, I will sleep tonight!! new hope to learn this... thx

    Quote from gkaefer

    its easy - as everything in live - if you know it ;-)))

    jaaaa... later I will call myself stupid to having taken such a long time to get that.

    Quote from gkaefer

    set(events.onidle, dec(step); autotour(); );
    this now says that the events.onidle should execute: 1. reduce the value of variable step with 1 and than 2. execute the code in action autotour. The () says that no additional values are assigned to the action autotour.

    Great explanation for dummies!!!!! Are these conventions from Javascript? (which, obviously, I don't know either...)
    But why do I have to put the "set"? (I just copied it...) How can I know (for other cases in the future), how could I learn?

    Quote from gkaefer

    so step==1 ... first pano gets loaded .... step get the value 2

    when does the step increase? after loading? then that would be the reason. We then would need a command to increase the step after finishing the lookto process.

    Quote from gkaefer

    if you place the line "set(step,1);" at the beginning of the action autotour() the behaviour should change so that after every idletimeout the tour should automatically start with pano 1

    works!! but I suppose we don't know why...
    Allerbeste Grüße
    Gertrud

  • Hi,

    try breaking-up the loadscene() calls and the lookto() calls into separate steps,
    then you can continue with the lookto() in the current scene before switching to the next scene,
    and important don't set the step to 1 in the autotour action,

    e.g. here the whole code:

    best regards,
    Klaus

  • came back to this one
    as mentioned by gkäfer, putting the set(step,1) into the <autotour> makes the tour fall back to the first pano...

    Tried your solution, Klaus, of breaking up the actions into two steps - gives me the same problem - next scene will be loaded after interrupt and not the current!
    also, no initial scene is being loaded without the call in the startup()

  • I've used the suggestion by Klaus and it works for the 1st 2 scenes. Once it finishes the 360 rotation on my 2nd scene it doesn't move to the 3rd, it just stays in a loop on the 2nd. Any reason why that would happen?

    <action name="startup">
    buildthumbs();
    loadscene(scene_SHQ1, null, MERGE, ZOOMBLEND(1,2) ); inc(step);); wait(load);
    set(idletime,4);
    set(events.onidle, autotour() );
    </action>

    <action name="autotour">
    set(step,1);
    oninterrupt(break);
    if(step == 1, lookto(360, get(view.vlookat),get(view.fov), smooth(2,2,15), false); inc(step); );
    if(step == 2, loadscene(scene_SHQ2, null, MERGE, ZOOMBLEND(1,2) ); inc(step);); wait(load)
    if(step == 3, lookto(360, get(view.vlookat),get(view.fov), smooth(2,2,15), false); inc(step,4); );
    if(step == 4, loadscene(scene_SHQ3, null, MERGE, ZOOMBLEND(1,2) ); inc(step);); wait(load)
    if(step == 5, lookto(360, get(view.vlookat),get(view.fov), smooth(2,2,15), false); inc(step); );
    if(step == 6, set(step,1); autotour(); );

    </action>

Participate now!

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