edited May 2014 in ORK Support
I want to setup a time calculation and transfer the values to my skybox but somethings wrong or missing...what I did is:
-Define the variables under Editor in ORKFramework
-created an Event for calculating the time:
I used the defined variables and selected Global. I have no Event Actor selected.
-I created a global event in the World Tab:
I selected the time event and used EventType Auto, Timeout 1, All states to ignore, available in all and no conditions.
So in my event every second 1 is added to variable MM (which stands for minutes -> 1 second is 1 Minute in the game, a day lasts 24 minutes...)
In my skybox script I'm trying to get the values:
Sky.Cycle.Hour = (int) ORK.Game.Variables.GetFloat("HH");
The (int) is needed cause the ORK variable is float and the scripts in the skybox use int.
If I use the command
ORK.Game.Variables.Set("HH", 12);
before I get the value it is changed to 12...otherwise HH=0, other Variables are 1 - could it somehow have to do with global/local variables?

Thank you very much for your help!
  • You don't need to define the variables in the editor first - it's just a helper/tool to define some names for the popup in variable fields :)

    I'd need to see your event, maybe there is something wrong ... the rest should work as expected.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Thank you very much for the immediate reply! After playing around with the events I figured out - some trys worked, some didn't - that if I use Value Type "Game Variable" in Variable Changes nothing happens, if I use Value Type "Value" it works...strange, that in Variable Checks I can use Value Type "Game Variable". At least it works now - don't know if this was intended this way...
  • That's because the value type Game Variables is used if your variable key is stored in another game variable.
    If you want to directly define the variable key, use the value type Value :)

    You can learn more details about this in this how-to on game variables.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.