Hi,
I'm using the latest beta and there seems to be an issue with the combination of a if statement and a wait.
I made a little rotate animation, here's my code. (I've edited for easy reading, so the animation is way to fast, sorry for the sloppiness)
<events onxmlcomplete="action(start);" />
<plugin name="startup" firstrun="1" showhelp="1" keep="true" />
<action name="start">
if(plugin[startup].firstrun EQ 1,
action(rotate);
)
</action>
<action name="rotate">
oninterrupt(action(returnaction));
lookat(50,50,85);
wait(2000000);
lookto(-100,-1,85);
set(plugin[startup].firstrun, 0);
</action>
<action name="returnaction">
lookat(50,50,85);
set(plugin[startup].firstrun, 0);
</action>
Alles anzeigen
Basicly, if it's the first location you're watching, perform a small rotation, else don't. The animation should/could be interupted if the user don't want to see it. I got this in a global xml which is included in every other panorama. When a user clicks on a direct link to a specific location, if will perform the animation, but if the user gets to that excact location by clicking hotspots in the tour, the animation doesn't get triggered. After the animation, the firstrun attribute is set to 0, and since keep is true, I will remember if a user first visits a location. Next step would be cookies, but for now this works fine.
Now the problem:
The thing is, you see that massive wait if put in there for testing? It gets ignored. It shoots right to the lookto part. BUT if I remove the If statement. It does the thing he's supposed to, sit right their and wait 2000000 seconds ;p. Somehow wait gets ignored in a if statement.
Another question, not related to the "bug"(?). As you can see I have this custom plugin (startup), with nothing in it, cept 3 attributes. And for me, it kinda hurts my eyes a little bit hehe :P Its not really OOP, creating an instance of plugin to hold variables. Because firstrun isn't a plugin, it's a boolean. Is it possible to declare global variables in the xml? Or atleast put the variables in the krpano attribute (not sure if it supports custom attributes and if MERGE doesn't clear them, thats why I used a plugin with keep=true) or is the data object reserved for that? I probally answered my own question somewhere in here :P =(
Edit: I temporary solved it by setting a delayedcall before the action delayedcall(0, action(firstrun_animation);); Now, the action can have wait() in it.