• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

(Resolved) Get String for an Icon Path (Was this feature removed??)

Status
Not open for further replies.
Hello and thank you for your time,

A while ago I created an inventory system (show in old youtube link), then later just before reforged released I had perfected it (no video). Due to frustrations with the new EULA I took a long break. Anyway, now that I am back it doesn't work anymore.

The item spawner system spawns a "heart of searinox" then runs it through a series of triggers that set and concatenate that item's icon path. This icon path works in conjunction with my path reader system to make the items functional.


I've been using a string variable to: [Set Stringvariable = Icon Path of Last Created Item]

But it seems like Blizzard has removed the ability to reference an Icon Path for items as I can no longer assign that variable to an iconpath.

Does anyone know if this is true, or know of another way to access it such as jass? (I know very little Jass)

Simply regaining the ability to assign this variable to be equal to "Last Created Item's" iconpath would fix everything and save me some significant rewriting :)
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,517
  • Set Variable udg_item = YourItem
  • Custom script: set udg_icon = BlzGetAbilityIcon(udg_item)
icon = string variable
item = item variable

It gets the icon path for whatever 'id' you put in the parameters(). So it can be a unit's icon, ability icon, item icon, etc.

Although I could be wrong about this returning an item path. Anyway, patch 1.29 might not have this as an option.
 
Last edited:
  • Test
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • Item - Create Tome of Experience at (Center of (Playable map area))
      • Set VariableSet udg_item = (Last created item)
      • Item - Set Icon Path of (Last created item) to (String((Random integer number between 1 and 14000)))
      • Custom script: set udg_icon = BlzGetAbilityIcon(udg_item)
      • Game - Display to (All players) the text: udg_icon

@Uncle This is what I have, it says that my variables for udg_item and udg_icon are undeclared. Do you know what I need to change?
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,517
"udg_" is a prefix that tells custom script (jass) that you're referencing a User Declared Global variable.

So your variables aren't actually supposed to have "_udg" in their variable name, you add that when you reference them in custom script.

  • Set Variable item = (Last created item)
  • Custom script: set udg_icon = BlzGetAbilityIcon(udg_item)
  • Game - Display to (All players) the text: icon

This is how jass differentiates between variables created in jass code and variables created inside of the variable editor (user declared global variables).
 
Last edited:
Haha thanks. I'm sure that was a very novice question.

It looks like it didn't work because of a conversion error

1627279385674.png


However after some searching I changed the trigger to this:

  • Test
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • Item - Create Tome of Experience at (Center of (Playable map area))
      • Set VariableSet item = (Last created item)
      • Item - Set Icon Path of (Last created item) to (String((Random integer number between 1 and 14000)))
      • Custom script: set udg_icon = BlzGetItemIconPath(udg_item)
      • Game - Display to (All players) the text: icon

Unfortunately it displays the item's natural path and not the new path I set for it. So maybe after a few patches they just did something that broke the function.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,517
It's weird because I know that this function works for both abilities AND units, so I assumed it was just poorly named and would work for anything that had a rawcode such as items.

Anyway, there's a lot of unfinished/broken stuff in Reforged. I've seen many posts regarding issues with these Set/Get functions so I think it's safe to assume that it just doesn't work yet, and since this game has pretty much been abandoned by the devs I wouldn't expect it to ever get fixed.

That being said, not all is lost. Custom UI is pretty great for getting around these limitations if you're willing to put in the time to learn how to code. Why rely on Warcraft 3's item system when you can create your own ;)
 
Status
Not open for further replies.
Top