Hi,

I am trying to add some info to my HUD, this info comes from an object variable component of my game object.

In this tutorial (http://orkframework.com/tutorial/howto/text-codes/), it mentions we can use a game variable in text codes like below;

#varstringX#
The current string value of the game variable with key X.

But I am not sure where this variable getting from. Based on above description, I feel like it uses an unique key within a scene to locate my variable?

To be more specific, let's say I have below two game objects in my scene, how can I get Value1 and Value2, respectively? They shared the same variable key but in different objects.

GameObject1
- Object Variable Component with object id "OB1"
-- Key1 - Value1

GameObject2
- Object Variable Component with object id "OB2"
-- Key1 - Value2

Thanks.
  • The text codes are using global 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!
  • edited September 2017
    Thanks for the insights, @gamingislove.

    I wonder is there a way to achieve what I have described though?

    I understand it's not supported out of box now, but just want to see if it's feasible to create custom code to achieve it?

    If yes, would you give me some hints from high level?
    If no, then I'll figure out something else.

    To be more specific, what I want ultimately is
    1) I'll use object variable component to serve as a "Model"; for instance, I'll create a city model using object variable component and declare a list of variables within it. I'll have a list of city within a scene; like below

    CityA(GameObject)
    - Object Variable Component with object id "City_A"
    -- Key1 - Value1

    CityB(GameObject)
    - Object Variable Component with object id "City_B"
    -- Key1 - Value2

    2) Then I want to display this city model through ORK UI system.

    Or is Makinom able to achieve it out of box?
    Post edited by ljx00_520 on
  • edited October 2017
    Hm, I think the best way to do this is via Scene Objects, which can optionally use object variables (when using text codes) in their content information. You can set up scene objects in World > Scene Objects and attach them to game objects in your scene with a Scene Object Component.

    The information can e.g. be used in Tooltip HUDs displayed when hovering over the game object or in dialogues when using the game object as an actor.

    Makinom can use variables from other sources (e.g. object variables) in texts, but you're limited to having one source for the text, e.g. you can't display global and object variables together in a dialogue.

    How/where would this be displayed? E.g. in a dialogue or a HUD?
    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 October 2017
    Thanks GIL. Super helpful!

    I just looked into Makinom, I think it looks more like a solution to me at this point. (I didn't mean to display global and object variables together in one place. Just display for object variables is good enough.)

    Also evaluated Scene Objects, felt like it serves for a very specific purpose (like what described in the Scene Objects HowTo tutorial); it may not feasible for my use cases where I plan to use it mainly on HUD (in type of Information I believe).

    Apart from that, I do have another question regards Game Variables while I deep dived into this problem. I saw there are "Game Variables" options here and there (some in Editor and other in Event Nodes), however, some of them I can designate an origin of the "Game Variables" but not for the others.

    For example, In "Inventory - Items - User Settings", there is an option to "Change Variables"; when I click "Add Game Variable", there is no option for origin for the game variable I just added. So does it mean to change a global game variable in this case? If yes, is this assumption applied to the other places where no origin option for a Game Variable?
    Post edited by ljx00_520 on
  • This depends on where the variable settings are used. E.g. in the items, it's just a convenient setting to change global variables (e.g. setting a bool when using an important quest item). You can do more detailed variable changes in the events of the item (or ability).

    If there is no origin selection for variable checks or changes, it's using the global 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.