• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Dummy Unit

Status
Not open for further replies.
Level 34
Joined
Sep 6, 2006
Messages
8,873
I have been trying to make an arrow that reduces armor. I can do it another way, but I want to be able to do it through a dummy unit.

I have a hero that can select different arrows. You open a spellbook and it shows you them all. I based them off different spells like roar and taunt. They are the dummy spells. I than made the real spells and triggered it so when the dummy spell is cast the hero is given the real spell and if another arrow was already chosen, it is removed.

I made a spell based on searing arrow and made it do nothing. Then I made this trigger.
  • Armor Arrow Data
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Armor Piercing Arrows
    • Actions
      • Unit - Create 1 Dummyunit for Player 1 (Red) at (Target point of ability being cast) facing Default building facing degrees
      • Unit - Add Armor Reduction to (Last created unit)
      • Unit - Order (Last created unit) to Night Elf Druid Of The Talon - Faerie Fire (Attacked unit)
      • Unit - Remove (Last created unit) from the game
This leaks because of the "last created unit" right? I can fix that later.

I don't really know what I am doing here. Help would be appreciated.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Just search it... answerd 2 threads like this in this past 2 weeks I think.

If you don't want to search, you basicly need a trigger that checks when the player activates the skill (with order IDs), another one that ends it, and then the trigger that does the casting like you did.
 
Level 14
Joined
Nov 18, 2007
Messages
1,084
The
  • Unit - Create 1 Dummyunit for Player 1 (Red) at (Target point of ability being cast) facing Default building facing degrees
leaks.
To not make it leak, you could do this....
  • Set loc = (Position of (Casting unit))
  • Unit - Create 1 Dummyunit for (Owner of (Triggering unit)) at loc facing Default building facing degrees
  • Custom script: call RemoveLocation( udg_loc )
Go here if you want to learn more about leaks: http://www.hiveworkshop.com/forums/showthread.php?t=35124
 
Level 34
Joined
Sep 6, 2006
Messages
8,873
I knew it leaked, and I can fix that.

Thanks guys, I'll see if I can get it to work.

Edit: I have it at this right now. Still won't work.
  • Armor Arrow Data
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Attacking unit) Equal to Archer 0013 <gen>
    • Actions
      • Unit - Create 1 Dummyunit for Player 1 (Red) at (Position of (Triggering unit)) facing Default building facing degrees
      • Unit - Add Armor Reduction to (Last created unit)
      • Unit - Order (Last created unit) to Night Elf Druid Of The Talon - Faerie Fire (Triggering unit)
      • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
Would anyone mind trying to make an arrow that will do this for me? I would appreciate it a lot.

Oh and I'll search GhostWolf.
 
Last edited:

Rui

Rui

Level 41
Joined
Jan 7, 2005
Messages
7,550
Your trigger leaks a point yes, and that "Last Created Unit" will most likely bug.
Either the trigger can run too fast, deleting the unit before it casts the spell, or run to slow and misunderstand the function, selecting another unit that has been created meanwhile (this happens only in rare cases).

The Searing Arrow does not answer to the "A unit starts the effect of an ability" event, as far as I know. So, if it is supposed to be used only once, just base it off Storm Bolt or something.
You can also disable the ability for the owner of the caster, I'm sure there's an action in the "Player" list somewhere that does that.
 
Level 34
Joined
Sep 6, 2006
Messages
8,873
Why would I want to disable the ability?

Also I don't want it to be a one time cast like SB. I want it to be an arrow spell.

There has to be a way to do this.
Does searing arrows not pick up on any of the ability triggers? Begins Casting, Finishes, Starts the effect....

Edit: I have it working, but I have to use A Unit is attacked. And I just turn on the trigger when that type of arrow is selected. But it still works when you are not auto casting. Is there are way to detect auto casting?
 
Last edited:
Level 29
Joined
Jul 29, 2007
Messages
5,174
Your trigger leaks a point yes, and that "Last Created Unit" will most likely bug.
Either the trigger can run too fast, deleting the unit before it casts the spell, or run to slow and misunderstand the function, selecting another unit that has been created meanwhile (this happens only in rare cases).


There is no reason this trigger should bug, it runs too fast to bug (and what do you mean by "too fast" ? never saw any problem with running triggers without waits ^^).


Does searing arrows not pick up on any of the ability triggers? Begins Casting, Finishes, Starts the effect....


Auto casts do not use those events.


Edit: I have it working, but I have to use A Unit is attacked. And I just turn on the trigger when that type of arrow is selected. But it still works when you are not auto casting. Is there are way to detect auto casting


Well I already told you the theorical part.

You use the "A unit is issued a order" event. Now check if the order was your ability ON ID (go check whats your ON/OFF ID in the object manager). If it is, you set a boolean's value to be true.

Now, whenever that unit attacks with its boolean true - do your actions.

When the unit is issued the "OFF" order, you make the boolean false.
You'll also need a trigger to detect if the unit has mana or not and disable it according to that.

If you want it to look good you will also need a Hit Detection system (not recommnded in GUI).
If you want it to be MUI (any unit can cast it at any time) and not PUI (one unit per player), you must use JASS.

[Edit] Don't listen to this nonsense I just wrote !

When a unit is issued the ON order, you change its custom value to someNumber (some number...), now whenever a unit attacks with that custom value - you do your actions.

When he is issued the off/has no mana, you change his custom value to something else.
 
Status
Not open for further replies.
Top