#Ward Dispenser Icon Override

1 messages · Page 1 of 1 (latest)

vague willow
#

I have a lot of customizations around the look/feel of the wards in my game. After a lot of messing around with them, I eventually settled on overriding some of the AbilitySpecial values and the AbilityTextureName then forcing certain models in through the npc_spawned event so that a certain model is spawned rather than the default behavior to use whatever ward the player owns.

That worked great, but when wards stack, they form a item_ward_dispenser, which double-left-clicking will change which ward shows in the foreground of the image. I have images made up for that, but since there are two, it's not like I can just set the AbilityTextureName and it doesn't appear to be something I can inject as a AbilitySpecial, so presumably it's somewhere in Valve's Lua code.

Playing around with Panorama's debugger, It looks like the src image that gets loaded is file://{images}/items/ward_dispenser.png (whereas something for a custom game would be in a location like raw://resource/flash3/images/items/my_custom_item.png

Not sure if there's a way to be able to override that location/inject my custom png in its place, or would this end up being something I just need to write my own implementation of (which after my experience with obs/sents individually doesn't seem promising because of the whole placement UI/showing fog of ward particles that seem pretty impossible to emulate). I feel like the ideal would be if I could just override GetTexture(), but I'm not sure if there's a way to do just that with the way Lua runs (seems like it's always a fully custom script/no ability to call the parent/base functionality)

flat thicket
#

You can only override the image file, yeah. (Or manually look for and swap out the image in panorama)

No way to alter the item ability that could change the image.

The {images} in that file path should direct to: your_addon/panorama/images

#

Also, i imagine there would be 2 images you'd need to override, one for the blue ward up-front, and one for the yellow ward up- front

vague willow
#

So far haven't had any success with overriding the image file. I created my images and deployed them to:
C:\Program Files (x86)\Steam\steamapps\common\dota 2 beta\content\dota_addons\<my addon name>\panorama\images\items\ward_dispenser.png

But no luck. Not sure if it's something like addon assets load, then server side assets are copied down. Or maybe I need to close entirely out of dota and restart to refresh it, but I don't think that would be necessary

I'll see if I can tinker around in JavaScript and do that approach.

flat thicket
vague willow
#

I'll double check, but I think I tried it in both dirs

flat thicket
#

content is for raw, uncompiled files.
game is what your addon actually uses, and where compiled files go.

in the case of images, depending on the use you may need to put it in /content/ so that the resource compiler can compile it into something else in the /game/ directory. but for the most part you can just use a png without any compiling.

flat thicket
vague willow
#

no worries, was worth exploring and added a few notes to my PKMS now about panorama 😄

flat thicket
#

so step by step.

  1. put your custom png in /content/ at the same directory with the same name as the file you want to override.
  2. in an xml or css file you need to reference the image at that path in order to compile it.
    example:
<Panel>
  <Image src="file://{images}/items/ward_dispenser.png" style="visibility: collapse;" />
</Panel>
  1. start the game so that xml or css actually runs, and it will work
#

(note that you only need to do the reference to compile thing once, after its compiled that reference can be removed or commented)

vague willow
#

ah, I was suspecting if it's possible it would be through content. That's the only way I was able to get custom UI pngs to show up in-game

flat thicket
vague willow
#

ok, that finally did it. Not sure why, but only seemed to finally compile it when I added it through css

flat thicket
#

as long as the xml or css file you're using is actually included somewhere then it should work with either. i did it in xml when i was testing for you.

vague willow
vague willow
#

RIP might need to end up doing some javascript voodoo on the front end. This worked locally hosting through the play button in hammer. but I tried a match between my desktop and laptop using like that "publish as hidden" or w/e and it's still using the original icons when you play through Arcade on local hosting