Random hero button question..

Noritox

New Member
Reaction score
0
I'm having trouble with this random hero button I'm making for my tavern. Instead of making a unit for the player it makes it for the Passive Neutral tavern.
Event
Trigger:
  • Unit - A unit Starts the effect of an ability

Condition
Trigger:
  • (Ability being cast) Equal to Random Hero

Actions
Trigger:
  • Unit - Create 1 HeroType[(Random integer number between 1 and 38)] for (Owner of (Triggering unit)) at (Center of Hero Select <gen>) facing Default building facing (270.0) degrees


Anyone know how to make it so it makes a hero for the player? I'm using a wisp on the tavern to use the Random Hero Button ability.
 

Pharaoh_

The epic journey will soon begin... Prepare!
Reaction score
136
Yes, because the (Owner of (Triggering unit)) refers to the Triggering unit = the unit that casted the ability=the tavern. You can do instead a unit dummy with no model with the label "Random Hero" and make the player buy this dummy unit instead, forcefully removing it from the game afterwards:

Trigger:
  • Trigger
    • Events
      • A unit sells a unit
    • Conditions
      • (Sold unit) Equal to Random Hero
    • Actions
      • Set Point1 = (Center of (Hero Select <gen>))
      • Unit - Remove (Sold unit) from the game
      • Unit - Create 1 HeroType[(Random integer number between 1 and 38)] for (Owner of (Buying unit)) at (Point1) facing Default building degrees
      • Custom script: call RemoveLocation (udg_Point1)

Actions
 

Noritox

New Member
Reaction score
0
Yeah I realized that, I just didn't know how I could get around it. This should work, thanks a ton for the help!
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top