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

Item Selection Question

Status
Not open for further replies.
Level 10
Joined
Sep 3, 2009
Messages
458
Well I'm experimenting to disable the selection functionality and do selection through triggers. It works on units but not on items.

Here's a scenario:

An item drops. This certain item says "[Weapon] Sword". Also this certain Item, when selected normally, has an item description saying, "A sturdy iron sword".

Now because this map has selection disabled, I give my unit/hero an ability where it targets an object. Cast I trigger a "Unit - Select Unit for Player" or "Item - Select Item for Player" (if there was one).

I do think I can just really live without that item function. I'm just hoping if there was a way to do it, I'd go and do it.
 
Level 39
Joined
Feb 27, 2007
Messages
5,013
Typecasting has been entirely removed since H2I was added natively, right? The only thing I can think of is trying to typecast an item into a unit via hashtable save & load, and then just calling SelectUnit() on it.

There might be a way if you can get the function to take a widget instead, and both units and items are widgets.
 
Status
Not open for further replies.
Top