Hello Ventuzians!
THE FORUMS ARE CLOSED!

Please join our discord server HERE!! << click me :D

We are shutting our Ventuz Forum, but don't worry, it will all be archived for you to search in if you have a query. From now on, please add all your comments, questions or observations into our Discord Server

Thanks for the great time - see you on discord!!
Dee, Karol, Daniel and the whoooole Product and Support team!

Creating a memory mechanism

Q and A about functionality and how to solve a special task for your application.

Moderator: Support

Post Reply
User avatar
Etienne
Posts: 48
Joined: 20 Oct 2014, 19:46
Location: Los Angeles, California

Creating a memory mechanism

Post by Etienne » 18 Jan 2015, 02:46

Hello everyone,

I recently had to create a mechanism to store the previous value of a variable. It's nothing very complicated to do in Ventuz but I wanted to share my solution in case someone ever needs to do this:
Memory Mechanism.png
The Live Value is sent to a Live Value buffer which waits 1 frame before grabbing the new value. Another buffer grabs the previous value during that 1 frame.

Here’s what goes on:
1. Live Value fires a Changed event when its value changes.
2. Both On Change (Delayed) and On Change (Immediate) events get triggered.
3. On Change (Immediate) triggers the Previous Value buffer which is linked to the Live Value buffer. This buffer contains the previous value since it hasn’t been triggered yet.
4. One frame later, On Change(Delayed) triggers the Live Value buffer which grabs the new Live Value.

This cycle repeats every time Live Value changes and keeps the previous value available.

You can then merge all of this logic into a Content Container and re-use it in a chain:
Chain.png
Chain.png (4.82 KiB) Viewed 1443 times

Post Reply