I would like to Reference the information of a given unit but i am having a problem linking it together in a trigger. what i have so far (that isn't working for some reason, lol)
Events Game - Map initialization Local Variables Conditions Actions Data Table - Save (Value of Units InfestedAbomination Description for player Any Player) as "Aberration" in the Global data table
Since the Description is already made on the unit in the data, i would like to grab that info and use it to display in a trigger.
This doesn't seem to work at all, XD
Events Game - Player Any Player types a chat message containing "", matching Partially Actions General - If (Conditions) then do (Actions) else do (Actions) If (Triggering player) == 1 (Entered chat string) == "Aberration" Then UI - Display ("Aberration" from the Global data table) for Ind.Player.Group[1] to Debug area UI - Display "abc" for Ind.Player.Group[1] to Debug area <---this will display "abc" so i know the triggering is firing and is for that player. Else
This however ""UI - Display ("Aberration" from the Global data table) for Ind.Player.Group[1] to Debug area"" isn't working.
Found maybe an odd - well maybe normal - way of doing this.
In the Map start up trigger I set it like this
Data Table - Save (Game text for "Button/Tooltip/InfestedAbomination") as "Aberration" in the Global data table Variable - Set GlobalDataTableString[1] = ("Aberration" from the Global data table)
Then referenced the Variable in the Trigger
UI - Display ("Aberration" from the Global data table) for Ind.Player.Group[1] to Debug area
-My only other question, is there a shorter way of doing this? It does work by displaying the info from the Data Description but do i need to do the extra steps to put it into a variable?
Edit: Never mind. i deleted the variable and it still works fine.
I am guessing the initial problem was that you were saving a string to the data table then trying to read it as text. You either need to save it as text or load it from the data table as a string and then convert it to text (which is what your second solution does I am guessing). Be aware that some description information is editor only so has no catalog links.
-My only other question, is there a shorter way of doing this? It does work by displaying the info from the Data Description but do i need to do the extra steps to put it into a variable?
You do not need the variable, only to make sure that you load from the data table the same type as you save. All UI elements take text types while catalog lookups return strings. You will need to convert the string to text before it can be displayed.
Text is localized so potentially different between clients. Strings are used internally by the game engine so are the same between all clients. You cannot convert from text to string but can convert from string to text.
I would like to Reference the information of a given unit but i am having a problem linking it together in a trigger. what i have so far (that isn't working for some reason, lol)
Events
Game - Map initialization
Local Variables
Conditions
Actions
Data Table - Save (Value of Units InfestedAbomination Description for player Any Player) as "Aberration" in the Global data table
Since the Description is already made on the unit in the data, i would like to grab that info and use it to display in a trigger.
This doesn't seem to work at all, XD
Events
Game - Player Any Player types a chat message containing "", matching Partially
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Triggering player) == 1
(Entered chat string) == "Aberration"
Then
UI - Display ("Aberration" from the Global data table) for Ind.Player.Group[1] to Debug area
UI - Display "abc" for Ind.Player.Group[1] to Debug area <---this will display "abc" so i know the triggering is firing and is for that player.
Else
This however ""UI - Display ("Aberration" from the Global data table) for Ind.Player.Group[1] to Debug area"" isn't working.
Is the "Save" at the start up incorrect? idk.
HELP!? ~thanks. :D
Found maybe an odd - well maybe normal - way of doing this.
In the Map start up trigger I set it like this
Data Table - Save (Game text for "Button/Tooltip/InfestedAbomination") as "Aberration" in the Global data table
Variable - Set GlobalDataTableString[1] = ("Aberration" from the Global data table)
Then referenced the Variable in the Trigger
UI - Display ("Aberration" from the Global data table) for Ind.Player.Group[1] to Debug area
-My only other question, is there a shorter way of doing this? It does work by displaying the info from the Data Description but do i need to do the extra steps to put it into a variable?
Edit: Never mind. i deleted the variable and it still works fine.
I am guessing the initial problem was that you were saving a string to the data table then trying to read it as text. You either need to save it as text or load it from the data table as a string and then convert it to text (which is what your second solution does I am guessing). Be aware that some description information is editor only so has no catalog links.
You do not need the variable, only to make sure that you load from the data table the same type as you save. All UI elements take text types while catalog lookups return strings. You will need to convert the string to text before it can be displayed.
Text is localized so potentially different between clients. Strings are used internally by the game engine so are the same between all clients. You cannot convert from text to string but can convert from string to text.
I think you where right about the differences between TEXT and STRING being i had to use
For awhile i was getting the ""Button/Tooltip/InfestedAbomination"" to display instead of the text below it from the description.
-anyways- thanks for the reply.