edited December 2015 in ORK Support
i'm using Tenkoku DynamicSky for my weather effects (and Suimono for my water effects, both from the same author and highly recommended)

Tenkoku keeps track of the time of day in order to create its weather effects, and i'd like the time to be fed back into ORK, so that i can use it to create appropriate time-based behaviours in ORK

soooo, i can access the appropriate Tenkoku Component from within ORK no problem...

and, if i run a CheckFields event check on the appropriate Tenkoku field variable, that works ok too. i can compare if Tenkoku's currentHour variable is 8, and if it is i know it's 8 o'clock, if it's 9 i know it's 9 o'clock, and so on

however, if it try and use FieldToVariable to convert Tenkoku's currentHour into an ORK Global Variable, i get... nothing. i display the Global Variable in the console and it hasn't been set to any value, it's just blank. (Tenkoku's currentHour is stored as an int, which i guess might be the cause of the problem, although as i say, CheckFields works as expected) (edit: oh, and the main module is written in javascript, not c#)

at present all i can think of doing is to compare if Tenkoku's currentHour is 8 and set my ORK_Hour variable to 8 if it is. compare if it's 9 and set... etc etc, you get the picture. very long winded and inelegant (and a complete pita if i want to do the same for minutes)

soooo, am i missing something obvious?


p.s. i can use ChangeFields to change the Tenkoku currentHour value successfully, so i guess at a stretch i could use ORK to control the time and force that into Tenkoku, but everything's currently set up so that Tenkoku controls the time, not ORK, so that isn't really an ideal solution for me
Post edited by gamingislove on
  • a brief summary of the above waffle:

    interfacing from ORK to a public int variable in a javascript component of a non-ORK product :

    > Accessing the Component works ok

    > CheckField on the variable works ok

    > ChangeField on the variable works ok

    > FieldToVariable from the variable to a global ORK variable, doesn't work ok
  • edited December 2015
    Might be that it only uses float fields/properties for the Field To Variable step. Will investigate.

    Ok, did a quick test and had no problem storing an int field into a float variable.
    Post edited by gamingislove on
    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!
  • edited December 2015
    i clearly must be doing something stoopid then

    in the attached Event, the disabled stuff on the right is the current - "CheckField on Tenkoku:currentHour and then update ORK_Hour accordingly". that took a while to set up, because it's 24 separate checks, but it does at least work ok

    on the left is my attempt to get FieldToVariable to do the same thing. ChangeGameVariables is only there to make sure that a field called ORK_Hour exists and is a float, initialised to 0

    the step to print the value to the Console only ever displays what was in the ChangeGameVariables step (or blank, if the ChangeGameVariables step is omitted), so i'm obviously doing something bone-headed in the FieldToVariable step, but... what?

    image
    Post edited by HarryOminous on
  • edited December 2015
    Yep, you're clearing doing something stoopid :D
    Change the variable key's Value Type to Value - currently, you're trying to store the value into a variable key that's stored in the string variable ORK_Hour.

    Check out the help text of the value type or this how-to on variables to learn more about this :)
    Post edited by gamingislove on
    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!
  • why yes, now you mention it, that approach does seem to work rather well... could have sworn i tried that before at some point... but obviously i must have dreamt it... or something...


    (woo hoo! that means i don't have to do 60 different checks to get the minutes!)
Sign In or Register to comment.