edited August 2014 in ORK Scripting
I know I'm missing something obvious, but how can I (in a Game Event)

i) store the result of a function call on a c# component to a Game Variable,
EDIT: (current workaround is set an object variable in code, which means I need a wrapper around any function calls. Not that big a deal I guess)


ii) display the value using ShowDialogue?

EDIT: I found the Data button in the node editor Edit Text field, but adding the tag #varstringWelcomeText# does not display anything for an Object Variable. Works for global variables, but I need this to be object specific.


tia
Post edited by pj17903 on
  • edited August 2014
    1) Why don't you store the value from inside your c# code?
    ORK.Game.Variables.Set("GameVariableName", value);

    2) That variable can be set with #varstringGameVariableName#.
    Post edited by Kashrlyyk on
  • Thanks for the reply Kashrlyyk.

    As I said in my edit, my current workaround is to do what you suggested. However, I have existing C# code I want to call, so that means coupling that code to ORK, or writing a wrapper. No big deal if that's the only option, but if there's a way to get the return value from a function directly I'd be interested to know what it is.

    2) #varstringGameVariableName# seems to only work for Global variables. I need a way to display an Object variable. My workaround now is to use a Global for the display string in the dialog and an Object variable to store the value with the NPC.

  • I'll add a new step to store results from function calls into game variables - will be limited to string, bool, float (and int) and Vector3, of course :)

    The text codes are only available for global 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!
  • wow, thank you.
Sign In or Register to comment.