Sie sind nicht angemeldet.

1

Donnerstag, 1. April 2021, 11:30

if() action loop break/exitcall on meeting condition

Hi all,

in a tour of say three rooms with three panos each I would like to create a button to jump from one room to the next room (sometimes skipping a pano in the current room).

My loop below is working but it doesn't stop when the condition was met and my simple approaches trying with wait(0);/break();/exitcall();/callwhen();/stopcallwhen(); didn't lead to success.
Maybe there is a "on-meeting-condition stop & restart the action" solution as a workaround?
I see the indexing examples but I feel it is way out of my league.

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<layer 
name="button-jump-to-next-room" 
.. 
onclick="jump-to-next-room();" 
/>

<action name="jump-to-next-room">
if (
scene[get(xml.scene)].title == 'room1scene1-title'
OR 
scene[get(xml.scene)].title == 'r1scene2-title'
OR 
scene[get(xml.scene)].title == 'r1scene3-title'
, 
jump-to-room2scene4();
);
if (
scene[get(xml.scene)].title == 'room2scene4-title'
OR 
scene[get(xml.scene)].title == r2scene5-title'
OR 
scene[get(xml.scene)].title == r2scene6-title'
, 
jump-to-room3scene7();
);
etc.
</action>


Could someone lead me to the right direction please?

Thanks and happy Easter!
loki

Beiträge: 1 120

Wohnort: Angers - France

Beruf: 360 experiences creator

  • Nachricht senden

2

Donnerstag, 1. April 2021, 13:13

You could set the "jump to room" for each scene

Quellcode

1
2
3
4
5
6
7
8
9
10
11
<scene name="scene_1" jumpto="scene_4"...></scene>
<scene name="scene_2" jumpto="scene_4"...></scene>
<scene name="scene_3" jumpto="scene_4"...></scene>
<scene name="scene_4" jumpto="scene_6"...></scene>
<scene name="scene_5" jumpto="scene_6"...></scene>
...
<layer 
name="button-jump-to-next-room" 
.. 
onclick="loadscene(get(scene[get(xml.scene)].jumpto))" 
/>

3

Donnerstag, 1. April 2021, 14:31

method 1: (exitcall)

Quellcode

1
2
3
4
if(	a, action_a(); exitcall()	);
if(	b, action_b(); exitcall()	);
...
if(	z, action_z()	);

method 2: (if/else)

Quellcode

1
2
3
4
5
6
if(
	a, action_a(),
	b, action_b(),
	...
	z, action_z()
);

the above just for the syntax...
jeromes idea is good *thumbup*

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »indexofrefraction« (1. April 2021, 15:10)


Ähnliche Themen