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.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
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?
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?
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
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?
If there is no origin selection for variable checks or changes, it's using the global variables.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!