Difference between revisions of "An Event in Time"

From The Official Visionaire Studio: Adventure Game Engine Wiki
Line 23: Line 23:
 
== Pause (dynamic) ==
 
== Pause (dynamic) ==
  
The same action part above can also be used to create dynamic pauses, which can be really useful for making your game projects feel much more alive & less like they are stuck on some kind of fixed looping pattern that occurs every x amount of time passed.
+
The same action part above can also be used to create dynamic pauses, which can be really useful for making your game projects feel more alive & less like a broken record stuck in a never-ending loop.
  
To setup dynamic pauses you will need to create a '''value''' that you can link to the pause action part. The integer number belonging to values can be modified at any time via action parts or script, however we will only be covering action parts for now to keep things as simple as possible.
+
To setup dynamic pauses you will need to create a '''value''' that you can link to the pause action part. The integer number belonging to values can be modified at any time via action parts or script; however we will only be covering action parts for now to keep things as simple as possible.
  
 
Anyway, let's just assume you have created a value somewhere inside of the Visionaire Studio editor & have called it "v_time". Right, let's see an example of what a dynamic pause would look like inside of an action block...
 
Anyway, let's just assume you have created a value somewhere inside of the Visionaire Studio editor & have called it "v_time". Right, let's see an example of what a dynamic pause would look like inside of an action block...
Line 31: Line 31:
 
  set random value "v_time" between 100 and 3000
 
  set random value "v_time" between 100 and 3000
 
  pause for "v_time" milliseconds
 
  pause for "v_time" milliseconds
  additional action parts go here
+
  -- additional action parts go here
  
  
 
== Animation Frame Events ==
 
== Animation Frame Events ==
 +
 +
Did you know that you can edit animation frames via [[File:Anim_editframev2.png|16px|link=]] & assign sounds & actions to each individual animation frame? This is actually a really great method for precision timing based events as they are tied to animation frames instead of the frames per second that your game is running on the players device. It's much more accurate than using the pause action part.
 +
 +
[[File:Vs_anim_frame_actions.png|300px]]
  
 
{{toc}}
 
{{toc}}

Revision as of 17:35, 1 August 2022

On this page you will find a bunch of tips & tricks related to events, loops, & timing methods that you can use to control exactly when specific events &/or state changes (via values/conditions) should occur in your game projects.

Anyway, let's crack on...


Pause (static)

The simplest method for controlling time is to use the pause action part. The pause action part will prevent any action parts created after it from executing until the pause has finished.

Quick note: The pause action part allows you to specify the time in milliseconds, seconds, or minutes; however I highly recommend that you use milliseconds because it allows you to input precise time values.

Anyway, here's an example of the pause action part being used with some other action parts...

if condition "cond_example" is true
pause for 500 milliseconds
change condition "cond_example" to false
end if


Pause (dynamic)

The same action part above can also be used to create dynamic pauses, which can be really useful for making your game projects feel more alive & less like a broken record stuck in a never-ending loop.

To setup dynamic pauses you will need to create a value that you can link to the pause action part. The integer number belonging to values can be modified at any time via action parts or script; however we will only be covering action parts for now to keep things as simple as possible.

Anyway, let's just assume you have created a value somewhere inside of the Visionaire Studio editor & have called it "v_time". Right, let's see an example of what a dynamic pause would look like inside of an action block...

set random value "v_time" between 100 and 3000
pause for "v_time" milliseconds
-- additional action parts go here


Animation Frame Events

Did you know that you can edit animation frames via Anim editframev2.png & assign sounds & actions to each individual animation frame? This is actually a really great method for precision timing based events as they are tied to animation frames instead of the frames per second that your game is running on the players device. It's much more accurate than using the pause action part.

Vs anim frame actions.png