• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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,037
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