You are not logged in.

1

Monday, June 3rd 2013, 1:24am

counting hotspots

Hi,

Is there a command I can call to return the total number of hotspots in a tour? Trace(hotspot.count) gives you all the hotspots in a scene but I couldn't find anything that counts up all the hotspots in all the scenes.

Instead I wrote this action:

<action name="count_hs">
if( x === null, set(i,-1); set(n,0); sub(sc_num,scene.count,1); );
if( i LT sc_num, inc(i); loadscene(get(i), null, MERGE); set(x,get(hotspot.count)); add(n,x); count_hs();, trace(get(n)); );</action>

The above action works well enough but its a bit messy. Is there a better way to get the same result or is there even an equivalent command to "hotspot.count"?

Thanks

2

Monday, June 3rd 2013, 12:54pm

Hi,

that's not possible.
A <scene> is only a kind of 'inline-xml'. It's content doesn't get parsed until it will be loaded through loadscene().

Best regards,
Klaus

3

Monday, June 3rd 2013, 5:17pm

Thanks Klaus,

I found something odd about this code. If I set "x" as the scene hotspot count to add to "n" it works, but if I just add the hostpot.count directly as follows : add(n,get(hotspot.count)); I get an error warning "actions overflow". What's more is that if I just replace "x" with any other variable name such as "m" or "hs_inc" I get the same error.
Only "x" works and I just used that by luck. Is there any reason for this? I found this out because I thought it would be better not to use "x" as a variable because it is already used as the X coordinate in layers.

Is this a bug or is there something wrong with my action?

Thanks

4

Monday, June 3rd 2013, 5:51pm

Nope, Forget that. I just forgot to change the condition - If( x === null, );