I need to have on some of some hotspots a very quick timeout for the autp_click action of the vr_cursor.
I've created a new action on webvr.xlm, and added after the standard one:
ZitatAlles anzeigen<!-- vr_auto_click_veloce() - call this action in the onover event of a
hotspot to trigger automatically a click after some time. -->
<action name="vr_auto_click_veloce">
if(webvr.isenabled,
if(%1 != null, set(vr_aclk_timeout, %1), set(vr_aclk_timeout, 20));
copy(vr_aclk_t1, timertick);
set(vr_aclk_waiting, true);
copy(vr_aclk_hotspot, name);
set(hotspot[vr_cursor].crop,'0|0|80|80');asyncloop(vr_aclk_waiting AND vr_aclk_hotspot == name,
sub(dt, timertick,vr_aclk_t1);if(!hovering,
set(vr_aclk_waiting, false);
set(hotspot[vr_cursor].crop,'0|0|80|80');
,
div(f, dt, vr_aclk_timeout);
mul(f, 16);
roundval(f);
Math.min(f, 16);
mul(f, 80);txtadd(hotspot[vr_cursor].crop,get(f),'|0|80|80');
<!-- wait another 100ms delay after finishing the animation before doing the
click -->
sub(dt, 100);
if(dt GT vr_aclk_timeout,
set(vr_aclk_waiting,false);
set(hotspot[vr_cursor].crop,'0|0|80|80');
<!-- call onclick -->
onclick();
);
);
);
);
</action>
And then I've added this line on my tour.xlm
Zitat<hotspot name="spot1" style="skin_hotspotstyle2" ath="0" atv="0" onover="vr_auto_click_veloce()" linkedscene="scene_p2" />
But my timeout remain the standard one (2000).
Someone could tell me where I've made the mistake?