Let's say your goal is to fetch the file path of the Marine's icon so that you can input it to the Dialog action which asks for an image file path.
Use the thing called Catalog Field Value Get in anything that uses String value, like UI - Text Message
In the Catalog part, you put in Actors. This is because Actors has a field with the unit's icon path.
In Entry, choose Marine. This is just a text box where you really have to type Marine, but you can also choose to convert the text box into a game link (where Data objects like Units and Abilities exists) so you can use variables and such.
Then in Field Path, you type in UnitIcon. If you go to the Marine's actor data, and then look for UI - Unit Icon, press Control - D to turn UI - Unit Icon into CActorUnit_UnitIcon. For some reason, you only need to grab UnitIcon from it. This goes for any other field data like HP Amount and Model Path.
But the thing is... If you use the action: Dialog - Set Image of Dialog Item... You are only allowed to type in a file path. No strings. You cannot use the Catalog Field Value Get in some actions like the one I just gave.
To fix this, you'll need to use use the raw script of
so you can get (Game text for (Blah)) and turn it into "CatalogFieldValueGet(c_gameCatalogActor, (gv_trainUnitType[gv_playerRace[gv_selectedPlayer]][gv_playerRole[gv_selectedPlayer]][IntLoopCurrent()]), "UnitIcon", c_playerAny)"
Then in the action, choose Custom Script and paste it.
If you're still confused, just tell me. I'm too tired to perfect this.
Rollback Post to RevisionRollBack
Member since 2010. Made the -The Thing- [Revival] game. Nostalgic of the WC3 days.
There's a problem with this though, if the effect has any bonus damage applied for whatever reason (attribute bonus, buff on the unit, whatever) it won't register. What exactly is your use case, maybe we can suggest a better approach?
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Let's say i have the Dark Templar - Warp Blades (Damage) effect. How can i fetch the Damage Amount from the data editor and put it in a variable?
Let's say your goal is to fetch the file path of the Marine's icon so that you can input it to the Dialog action which asks for an image file path.
Use the thing called Catalog Field Value Get in anything that uses String value, like UI - Text Message
In the Catalog part, you put in Actors. This is because Actors has a field with the unit's icon path.
In Entry, choose Marine. This is just a text box where you really have to type Marine, but you can also choose to convert the text box into a game link (where Data objects like Units and Abilities exists) so you can use variables and such.
Then in Field Path, you type in UnitIcon. If you go to the Marine's actor data, and then look for UI - Unit Icon, press Control - D to turn UI - Unit Icon into CActorUnit_UnitIcon. For some reason, you only need to grab UnitIcon from it. This goes for any other field data like HP Amount and Model Path.
But the thing is... If you use the action: Dialog - Set Image of Dialog Item... You are only allowed to type in a file path. No strings. You cannot use the Catalog Field Value Get in some actions like the one I just gave.
To fix this, you'll need to use use the raw script of
so you can get (Game text for (Blah)) and turn it into "CatalogFieldValueGet(c_gameCatalogActor, (gv_trainUnitType[gv_playerRace[gv_selectedPlayer]][gv_playerRole[gv_selectedPlayer]][IntLoopCurrent()]), "UnitIcon", c_playerAny)"
Then in the action, choose Custom Script and paste it.
If you're still confused, just tell me. I'm too tired to perfect this.
Member since 2010. Made the -The Thing- [Revival] game. Nostalgic of the WC3 days.
@Skoite: Go
Set YourVariable = Catalog - Get Field Value from catalog Effects, path "Darktemplar", field Amount.
I don't have the editor in front of me, so I can't look up how eactly the function is named. It's under catalog.
"EffectIdentifier,Amount"
There's a problem with this though, if the effect has any bonus damage applied for whatever reason (attribute bonus, buff on the unit, whatever) it won't register. What exactly is your use case, maybe we can suggest a better approach?