• 🏆 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!

Hero Inventory Modification Request

Status
Not open for further replies.
Level 4
Joined
May 24, 2017
Messages
93
I found this Video and I wanted to implement the interface with the 9 inventory slots, but I cant find a download or anything.

Is this video for showing off and not for a resource?

Does anybody know if this resource exists anywhere?

Thank you to anyone who answers
 
From the link you posted:

Yea man once Patch 1.31 went from PTR to Live all the stuff in this map just became green squares on the screen. I don’t know but I just stopped caring about the system and never looked back. I’d be hard pressed to make the demo run again.

Suffice it to say that while I worked to build this system, everything I used along the way was a total letdown on the part of Blizzard and the APIs that they added. I mean, I don’t support people hating Reforged just to hate like most of the community turned to but I’m just telling you this honestly from trying to build this system.

My first theory was that I would begin the system by querying the constant number of item slots a hero had specified in the editor. Shift enter allows you to enter a number larger than 6, so by the end you could enter 7 or 8 and my system would see it and block out the other slots with the slot filler image.

To make this work my theory was that I would use BlzGetUnitAbilityByIndex and then on each ability test the constant with a name like ABILITY_ILF_ITEM_CAPACITY for a nonzero value. But I was frustrated by failure. When iterating over the abilities that a unit has, you cannot test for “is it an inventory ability” and on non inventory abilities this constant for item capacity returns nonzero bogus values. For example, in this map the Peasant and Town Hall have 1 inventory slot because these queries return 1 for Call to Arms or something. I forget the details. Suffice it to say that there is not anything offered by the API to filter out those false positives.

My next theory after this was to iterate from 1 to N for the number of slots and draw the inventory item. The whole system is a facade made by square images spawned by the UI natives. So the hero only holds one item at a time. Whenever your mouse enters a square are that contains an item image, the hero’s 1 actual item from the legacy 6 slot system is dropped and swapped for the synthetically stored item in the slot you mouse over. Then, the 1 slot that I use from the original system is moved with BlzFrameSetPoints or whatever to be positioned on top of the synthetic UI frame for that item. That way, when you click that real item slot, you get the real mouse behaviors such as the option to drop it. Watch the video again. You will notice points where, if my mouse is carrying an item with the built in system, it goes away if I mouse over a different item square. This same issue occurs and interrupts the Lich’s order to drop an orb near the end. I tell him to drop an orb then mouse over a different item, and he loses the command to drop it. That’s because his underlying 6 slot builtin inventory changes it’s current “real” item to the one that I mused over. At that time, the Lich no longer “has the item” to drop at all. So he just stops and I have to tell him to do it again.

Once I developed all of that theres also the question you’re probably wondering, how was the Lich able to hold 9 orbs and actually gain damage bonus 9 times. I wanted to use BlzGetItemAbilityByIndex and query all the abilities the item had. However this native does not work unless a unit is holding the item, and furthermore cannot give you the integer rawcode of the item’s ability. This was garbage to me. So, instead, I made a giant hashtable for every single item that stored what abilities it was supposed to have in the editor. I did this with an external computer program that I built, which loaded the data from the game and from my map and then dumped out a gigantic JASS file that assigned the value to the table for every ability. That is the depths of how frustrated I was by BlzGetItemAbilityByIndex and how it failed to give me an integer rawcode.

And that’s how this system was made. A facade made from buggy parts stapled together that would probably never work in a production map where you don’t want bugs. Furthermore, I never tested multiplayer but I’m almost certain the way it swaps out hero items and abilities based on mousing over rectangles would cause a desync.

I attached a copy of the map that I still had so you can get a feeling for what this system is actually like if you try to use it.
The map doesn't work correctly on Reforged, even on the SD mode, it is crazy broken. I tested it on Patch 1.31 and on that patch it works as it did in the video, except there is some print statement that is logging a bunch on the screen in this version that I attached.

In Reforged, along with breaking things and flipping the icons backwards and making them overlay with the ability icons and making them fail to fire mouseover events, all of the underlying problems are still present such as Peasant and Town Hall showing 1 inventory slot even though they have no inventory ability.

I don't think that fixing this system is possible, and showing how completely broken the same map is on Reforged that works on Patch 1.31 (a patch that was supposed to be a tech preview for players of the Reforged APIs), to me shows how Blizzard doesn't care about this. You can't make a system like this that mods the game itself. The UI natives were added upon request by Chinese hackers who use them for making *completely new UI for a Diablo 2 style RPG* and so *replacing the whole UI* is generally the only context where you can probably get them to work with any decency.

I want to be able to mod the game, and attempting to make systems like 9 item inventory showed me how little motivated Blizzard is to support modding on Reforged, which is why I am trying to rewrite the game to make my own modding simulator where anything can be changed.

I'm still totally not finished but I made a video the other day that shows the engine running for about 2 minutes until it crashes, but it reports why it crashed, so I can fix it:
 

Attachments

  • 9ItemsSystem.w3x
    378.4 KB · Views: 40
Last edited:
Level 4
Joined
May 24, 2017
Messages
93
Thank you for answering my request. I watched both videos and read everything you wrote. I am not a serious coder myself so I tried my best to understand what you wrote. I opened the map and I see that the command card overlays the extra inventory slots and what you mentioned in the original thread about what was wrong with the system.

What I think you were saying is that the system is broken and wont work. Does this mean that when you finish your modding simulator, it could be possible to fix it? If I understood that wrong its OK. The idea behind this is amazing and I hope that it will one day function.
 
Status
Not open for further replies.
Top