Timer

Special forum to share and discuss skins for Pano2VR and Object2VR
User avatar
jare
Posts: 365
Joined: Thu Mar 19, 2009 1:26 pm
Location: RU/CZ
Contact:

I understand how to use timer for hide elements.
But now for my tour's intro, I need some elements to appear step-by-step. For example one element appears at init, after 2 seconds appears other one, after 2 seconds other one....
Is the timer capable to do this?
User avatar
Hopki
Gnome
Posts: 13005
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Hi Jare,
There are two ways to do this, one smarter then the other.

The first is just wrap a timer around each element and set a different timeout.

Then under the timer set:
Timeout 2 (for the first timer, then 4 for the next and so on)
Type: Loaded
Repeat: One time

Deselect visible for the timer and set the logic block to:
Trigger: Active
Comparison: =
Value: false

Visible: True.

When the timer ends (value becomes true) the timer will become visible so making the child element visible to.

The second way is using variables and a timer.
So set a variable in the skin something like:
Name: intro
Type: Number
Init Value: 0

Add a timer,
Remove the logic block from the timers visible as its not needed.
Set under Timer:
Timeout: 1
Type: Loaded
Repeat: Toggle

As the Repeat is toggle the timer will increment the value every 2 seconds, so 1sec trigger, 1sec off, 1sec trigger and so on. As an example 5 seconds would be 2.5 second repeat.

Give the timer the action:
Source: Activate
Action: Set Variable Value
Operation: Add(+)
Value: 1
Variable Name: intro

Now in the element that you want to show, deselect visible then add the logic block to the visible.
Trigger: *intro
Comparison: >=
Value 1 (for the next element change the value to 2, then for the next 3 and so on)

Visible: True

How this works is the variable value starts at 0. The timer will increment this value every 2 seconds.
The elements have logic blocks that are looking for the value to make them visible.

You can also use the Alpha and fade in the elements using the delay in the logic block rather then use visible.
Also if you use:
Comparison: =
Then the elements will show for 2 seconds then hide.


Then to finish off, you can wrap all your elements in a container then set the containers visible logic block:

Trigger: *intro
Comparison: >=
Value 4

Visible: false.

So now what will happen is all the elements will show one after another then at the count of 4 they all hide.
I have attached a skin that has the above using the alpha, then after a time out hides the elements.
Regards,
Hopki
Attachments
skin.ggsk
(1.07 KiB) Downloaded 444 times
Garden Gnome Support
If you send an e-mail to support please send a link to the forum post for reference.
support@ggnome.com
https://ggnome.com/wiki/documentation/
User avatar
jare
Posts: 365
Joined: Thu Mar 19, 2009 1:26 pm
Location: RU/CZ
Contact:

Hi Hopki,

that is what I need. thanks a lot for the example and explanations!!!
User avatar
jare
Posts: 365
Joined: Thu Mar 19, 2009 1:26 pm
Location: RU/CZ
Contact:

Here is my tour with intro done with the first way http://3dpano.pindora.com/public/medved/tour.html

Now I'm doing another tour, where is vertical menu with 15 items. I want the items to be displayed one by one, with a little delay.
I tried the second way with variables but there can be only the whole numbers used, I can not type values like 0.5 or 1.8 into the Logis block's Value field :(
When doing with the simple first way, I can reach needed effect, but after the next panorama is loaded, the effect repeats again. I need it only once, when my tour begins.
User avatar
Hopki
Gnome
Posts: 13005
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Hi Jar,
In my example if you add a second action so it looks like this.

Activate, Set Variable.., Add(+1), intro
Deactivate, Set Variable.., Add(+1), intro

This will trigger the event every second so speeding up the fade in's.

You can then also speed up the timer, so setting the Timeout to: 0.200.
Then for the container that will hide everything, set its logic block so the value is higher such as 20.

So the fade in happens very quickly, boom, boom, boom then you see it for a bit then all three elements hide.
Regards,
Hopki
Garden Gnome Support
If you send an e-mail to support please send a link to the forum post for reference.
support@ggnome.com
https://ggnome.com/wiki/documentation/
User avatar
jare
Posts: 365
Joined: Thu Mar 19, 2009 1:26 pm
Location: RU/CZ
Contact:

Ok, thanks Hopki.
And what if I want to hold the effect start for some seconds, now they appear from tour init.
For example in this order:

1- 0 second - panorama is loaded
2 - after 1 second show element x (welcome screen)
3 - after 3 seconds hide element x
4 - after next 1 second show the buttons set, one after one
5 - after x seconds show some others elements

Pity that using the simple way with wrapping the elements by timers causes repeating the effect when panorama reloads.
User avatar
Hopki
Gnome
Posts: 13005
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Hi Jare,
For the elements that you want to hold for a few seconds you would use the logic.
logic.png
logic.png (67.23 KiB) Viewed 9693 times
The above image shows the logic to show the element at count 2.
Then staying visible until the count of 3.

Regards,
Hopki
Garden Gnome Support
If you send an e-mail to support please send a link to the forum post for reference.
support@ggnome.com
https://ggnome.com/wiki/documentation/
User avatar
jare
Posts: 365
Joined: Thu Mar 19, 2009 1:26 pm
Location: RU/CZ
Contact:

Hi Hopki,
thanks, will look at it.
And is there an easy solution if we need to work with values les than one second?
there can be only the whole numbers used, I can not type values like 0.5 or 1.8 into the Logis block's Value field
User avatar
Hopki
Gnome
Posts: 13005
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Hi Jare,
If using the timer you can set the time out value.
The default is 5 seconds, but you can set this much lower, lower than one second, in fact 0.001.
Regards,
Hopki
Garden Gnome Support
If you send an e-mail to support please send a link to the forum post for reference.
support@ggnome.com
https://ggnome.com/wiki/documentation/
User avatar
jare
Posts: 365
Joined: Thu Mar 19, 2009 1:26 pm
Location: RU/CZ
Contact:

Ok, thanks Hopki, will try it.
User avatar
soulbrother
Posts: 545
Joined: Tue Apr 08, 2008 7:01 pm
Location: München
Contact:

Hi,

let me ask a more simple action with the timer:

How to do this:
I have a picture in the skin, it´s an overlay, just like that:
https://ggnome.com/blog/creating-3d-dis ... pot-images

How to do an action, that this overlay is "blinking" without any mouse-action (alpha 0 to alpha 1 and reverse), lets say with a 3 seconds frequency.
What is the most efficient way to handle - with the goal that it works in flash and html5 and in most browsers...
User avatar
Shytsko
Posts: 80
Joined: Sat Dec 31, 2011 10:56 am
Location: Minsk, Belarus
Contact:

Hello.
In Pano2VR 5betta3a logic Block:
Снимок экрана 2015-12-09 в 18.19.59.png
Снимок экрана 2015-12-09 в 18.19.59.png (74.8 KiB) Viewed 9358 times
Where is * intro ?

Regards,
Shytsko Peter
User avatar
Hopki
Gnome
Posts: 13005
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Hi Shytsko,
* intro is a variable you manually enter in the skin editor.
Click a blank area in the skin and you will see the variables list show.
Regards,
Hopki
Garden Gnome Support
If you send an e-mail to support please send a link to the forum post for reference.
support@ggnome.com
https://ggnome.com/wiki/documentation/
PhilS
Posts: 9
Joined: Tue Jan 03, 2017 1:18 pm

Hi Hopki
I have adopted the skin you prepared for Jare in 2015 but would appreciate your advice on further modifications.

I have a welcome page with a start button which opens a single node. The sequence I would like is that upon the start button being clicked the sequence of the three images display at 2 second intervals and then all disappear and the node opens.

I would have thought require an action for start button to trigger click Timer 1 and then amend Timer 1 so it does not commence sequence of images from outset but on start button being clicked. Also not sure how to set up subsequent opening of node upon images disappearing.

Your guidance on how to achieve this would be much appreciated.

Thanks

Phil
User avatar
Hopki
Gnome
Posts: 13005
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Hi Phil,
You can use a Numbered Variable and a timer to change the variable value, lets call it: vis_startup
In version 6 beta you can set the timer to Manual and set Repeat to toggle.
Then have a button to set value "1" to the timer. I will be using an Activate action so as it toggles to deactivate and activate every second it will be two seconds in-between activate states.

The timer can then have the action:
Activate, Set Variable Value, Add(+), 1
Activate, Set Value, 0 (but set an action filter so *vis_startup, =, 4)
Activate, Set Variable Value, =, 0 (but set an action filter so *vis_startup, =, 4)

You can then add an external image loader, in my example External 1 and under the External URL have the logic block set to when the variable is 1, show image 1, when the variable is 2, show image 2 etc.

Then in the image loader set the visible logic block so: *vis_startup, = 0, Visible false.

What should happen is as the variable is at 0 the external image loader is hidden.
When you click the button to set "1": to the timer, after 2 seconds changes the variable to 1, this will then show the external image loader and image 1.
After 2 seconds the timer will set the variable value to 2 and now the external loader will show image 2 and so on.

When the variable get to 4, the action to set the timer value to 0 will be actioned due to the action filter, thus stopping the timer.
And the action to set variable value cack to 0 will also get actioned because of the action filter.

I have added a screen tint which has a visible logic block and also a text box to display the variable number. This is only for testing and can be deleted.
Regards,
Hopki
Attachments
timer.zip
(33.04 KiB) Downloaded 235 times
Garden Gnome Support
If you send an e-mail to support please send a link to the forum post for reference.
support@ggnome.com
https://ggnome.com/wiki/documentation/
Post Reply