• 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.
  • Vote for the theme of Hive's HD Modeling Contest #7! Click here to vote! - Please only vote if you plan on participating❗️

[Trigger] Minimum Range Ability (Triggered)

Status
Not open for further replies.
Level 2
Joined
Jan 1, 2007
Messages
6
I've made an ability for a throwing weapon, but I want to make it unusable if it is within melee range of the unit's target, and am stumped on how to trigger it.

Event: ???
Condition: Something along the lines of Targeted unit within range 200 of Casting unit
Event: Disable ability Thrown Knife for Casting Unit

With the condition I just posted, there is a unit "Targeted unit" and down the bottom it says "When responding an "Acquires a target" unit event, this refers to the unit being targeted." I looked through all the unit events, but couldn't find this one. Also, I'm assuming that sort of condition would be under Integer, but couldn't find something that would work there either.

If anybody know how I could do this, please help!
Thanks,
Hidden Demon~
 
Level 2
Joined
Jan 1, 2007
Messages
6
Thanks for the replies.
@Fl4meS: No it isn't a passive ability, but that is sort of how I wanted it to work.

@paskovich: Yep, that is how I wanted it to work, but it's a "specific" unit event, so I have to actualy select a unit, I can't use a variable. And I'm not sure how to do this...

@Dalaran_Gaurd: Same thing there as well, it's a specific unit event, but I need it to be generic.
----
I can select "No unit" under the event, so "No unit aquires a target", would there be a way to set no unit to the triggering unit?

Cheers,
Hidden Demon~

P.S <grumbles> You would think that blizzard would put it in generic and make triggering unit the one that aquires the target, and targeted unit as the target, but noooo, had to do it their way >.<
 
Level 8
Joined
Sep 13, 2006
Messages
431
You would think that blizzard would put it in generic and make triggering unit the one that aquires the target, and targeted unit as the target, but noooo, had to do it their way >.<

Ya, i guess. Idea for ya.. try making it a ranged attack with a minimum range, and use triggers to enhance the attack.
For example, unit attacks a unit, wait (dist. between attacker and attacked/missile speed) seconds, create dummy unit to add effect (i.e. stun, etc).

It's worth a try at least...
 
Level 2
Joined
Jan 1, 2007
Messages
6
So make their attack 1 melee, attack 2 distance with a throwing knife and minimum range, make it attack 1 only, and then enable their attack 2 when they use the ability?

(I think that is what you meant :p)
 
Level 2
Joined
Jan 1, 2007
Messages
6
Made an action but I'm not sure
1) What event to do it with
2) A small problem in the action.

Unit Group - Pick every unit in (Units in (Playable map area) matching ((Level of Throw Knife for (Picked unit)) Greater than or equal to 1)) and do (Actions)
If (All Conditions are True) then do (Then Actions else do (Else actions)
If - Conditions
--No Unit equal to (Random Unit from (Units within 200.00 of Position of (Picked unit)
Then - Actions
--Player - Disable Throw Knife for (Owner of (Picked Unit unit ))
__________________________________________________________________
Where it says No unit equal to I selected "No unit" because I don't know what to put there.
Also, will "picked unit" work in the condition if the condition is in the unit group actions?
Any Ideas?

Cheers,
Hidden Demon~
 
Level 8
Joined
Sep 13, 2006
Messages
431
Unit Group - Pick every unit in (Units in (Playable map area) matching ((Level of Throw Knife for (Picked unit)) Greater than or equal to 1)) and do (Actions)

Okay, first, ..."of Throw Knife for (Picked Unit)..." should be for matching unit.

But regardless, here's the trigger, and I tested it and it works fine. Just replace Storm Bolt with the spell oof your choice.

Throwing Knife
Events
Time - Every 0.10 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in (Units in (Playable map area) matching ((Level of Storm Bolt for (Matching unit)) Greater than 0)) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
No unit Equal to (Random unit from (Units within 250.00 of (Position of (Picked unit)) matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of (Picked unit))) Equal to True))))
Then - Actions
Player - Enable Storm Bolt for (Owner of (Picked unit))
Else - Actions
Player - Disable Storm Bolt for (Owner of (Picked unit))

Good thinking, by the way. That one was a toughie, and you had a great start on it.
 
Last edited:
Level 4
Joined
Sep 20, 2005
Messages
72
That looks really inefficient to use a periodic event
also, that would not allow the unit to throw the knife at a unit that is more than 200 away if there is an enemy unit within the radius

if the spell requires:
- a unit-targeted spell (ie. storm bolt)
- if targeted unit is within 200 range, disable spell

i would do this (im working off memory of gui so its not exact but the idea is there)

event - a unit is issued a unit-target order
condition
- issued order id is equal to '____' (your ability's base orderstring)
- unit-type of triggering unit is equal to ______ (or compare a unit if thats how u want it)
actions
if distance between targeted unit's location and triggering unit's location is less than or equal to 200 then
pause triggering unit
order triggering unit to stop
unpause triggering unit
//(the pause/stop/unpause combo causes the unit to forget its last order and replaces it with stop. therefore, the unit would stop casting the spell, cooldown will not trigger, mana will not be reduced, and any trigger linked to the spell firing off of the event "a unit starts the effect of an ability" will not go off, as the ability has not been casted yet.)

next, i personally would use cs_error function to display a error message...but since its gui forum... er you can use some gui error message, displaying to owner of triggering unit that "The target is too close to throw a knife at!" or something along those lines.
*be aware that the above leaks two locations
 
Status
Not open for further replies.
Top