• 🏆 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!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

multiples of 'build tiny X' as a unit spell

Status
Not open for further replies.
Level 23
Joined
Aug 29, 2012
Messages
994
There are like 5 or 6 "build a tiny..." spells and they seem to all share the same ID. I tried to give "build a tiny barracks" and "build a tiny forge" to a peasant, and the two spells got mixed up when I ordered him to build a barracks.

I don't see any workaround for this, except giving your unit the regular "build" ability, or creating your buildings via triggers.
 
Level 41
Joined
Feb 27, 2007
Messages
5,191
Do the tiny X abilities cost gold to use? I don't think so but that's the only thing this wouldn't do:
  1. Unit casts dummy no-target, base off channel and you can literally give it any orderstring
  2. Detect when unit is issued the chosen orderstring, order it to stop, then reissue its order prior to the cast order (use something like Dusk's LastOrder library)
  3. Give the appropriate 'build tiny X' ability and cancel detector ability (see below) to the unit
  4. Delay 0.02+ seconds (see this thread for speculation as to why this is necessary)-- weitlol's solution may work for you, I haven't tested it yet.
  5. Select the unit for the building player
  6. Force the UI key for the 'build tiny X' you want to cast
In addition to all that you'll need another no-target channel-based ability to use as a cancel detector. A periodic timer will need to loop through all 'building' players and force the UI key for the cancel detector. If a unit ever casts the cancel detector ability you know the player either cancelled the building/targeting step by right-clicking (undetectable otherwise)/pressing ESC (detectable), deselected the unit, or successfully cast the 'build tiny X' ability.

If you wanna see this in action, lemme know and you can mess with my test map.
 
Level 45
Joined
Jul 29, 2008
Messages
9,542
Wait... So what's all that? He can't just have a Spellbook full of Channels (all labeled "Build X" and given different Order IDs), and then use a Trigger to catch the Channel-cast & summon the appropriate Dummy Caster who then casts the appropriate "Build Tiny X"?
 
Level 41
Joined
Feb 27, 2007
Messages
5,191
Wait... So what's all that? He can't just have a Spellbook full of Channels (all labeled "Build X" and given different Order IDs), and then use a Trigger to catch the Channel-cast & summon the appropriate Dummy Caster who then casts the appropriate "Build Tiny X"?
If you use the dummy spells for targeting you lose the tiny X abilities' property of showing the pathing of the target area on mouse hover (before clicking to actually cast) and how the building fits in that area. Ordering a dummy to Build Tiny X on the cast location may or may not work (if the location was appropriately pathable, for example) and you lose the shnazzy UI which I assume is the real reason for wanting to use this.

Second, if the unit you want to force a UI key for is not selected by the player you wish to force it for (as a dummy unit would be) or the unit doesn't yet have the ability you want to force (necessary in this case because multiple Tiny X abilities conflict) or the ability is disabled for the casting player, there is some sort of internal refresh time (not a frame draw, it seems) for the unit to be selected and the ability added to the command card that you must wait before the force key will actually do something. Check out my linked thread for more info.

Using them as actual items would work obviously, assuming that the map in question doesn't already use items, and you need 6 or less buildings.
If you use 1 or 2 of the item slots for dummy 'scroll up'/'scroll down' items, you can have an unlimited number of item-buildable buildings by cycling through different pages. A little clunky but it gets around this limitation.
 
Last edited:
Level 45
Joined
Jul 29, 2008
Messages
9,542
See, this is why I keep you around. : D

If you use the dummy spells for targeting you lose the tiny X abilities' property of showing the pathing of the target area on mouse hover (before clicking to actually cast) and how the building fits in that area. Ordering a dummy to Build Tiny X on the cast location may or may not work (if the location was appropriately pathable, for example) and you lose the shnazzy UI which I assume is the real reason for wanting to use this.
Ah, of course, the pathing UI thing. Daaaang. Guess this is why I only had a building doing this...

Pyrogasm said:
If you use 1 or 2 of the item slots for dummy 'scroll up'/'scroll down' items, you can have an unlimited number of item-buildable buildings by cycling through different pages. A little clunky but it gets around this limitation.
Hm. Different "pages" in the item slots?
 
Status
Not open for further replies.
Top