edited January 2017 in ORK Support
Howdy @gamingislove,

okay so, I'm trying to print the result of a dice roll to a dialogue in the event system. It always prints 0. Here are my steps:

1. I roll some dice using a formula, store the result in a variable using the "Formula to Variable" event node. I try storing it two different ways:
1a. As a Game Variable named X using the 'Set' operator
1b. As a Value named Y using the 'Set' operator

2. I have a custom print node i created, that prints the value of game variables to the console, i confirm that the dice roll works (example: 5). X prints as 0, Y prints as 5.

3. Next node is the dialogue node, the text reads:
Result: #varifloatX# #varifloatY#

The resulting text is:
Result: 0 0

What am I doing wrong here?
Post edited by chud575 on
  • That's cause maybe instead of the text codes being #varifloatX# and #varifloatY#, it should be #varfloatX# and #varfloatY#
  • Varifloat prints floats as integers. Neither works.
  • @gamingislove @Shadow_Fire
    okay, so here's something interesting...
    dug around in the source a bit and see that the TextHandler ReplaceSpecials() code only passes ORK.Game.Variables, which im assuming only contains global variables.

    Changing X to a Global Value confirms this result. It prints the proper value, but not object values or local values.

    Is this intended behavior gil? Or can we add support for local vars? Maybe #lvarfloatX#?
  • Ahh yeah I remember long ago Gil said that showing variables on text code doesn't support object or local variable.
  • Yes, the text codes only support global variables in ORK.
    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.