• 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.

Simple Way To Make Passive Spells

Level 5
Joined
Mar 13, 2008
Messages
126
SIMPLE WAY TO MAKE PASSIVE SPELLS

I'm sure you tried to make some passive spells that should fire on attack. You probably triggered it using unit is attacked. That is bad because trigger takes effect as soon your unit attacks so even if he misses! You can notice it very good on ranged atttacks. There are many JASS triggers that are complicate and hard for beginners. So i found a way to make it with almost no triggers, except ofcourse spell effect.

First lets explain ability Orb of Slow to those who don't know what this is. That ability gives you X% chance (X is modifiable number) to make it cast some spell on attack. Perfect! It just has one MAJOR flaw... It takes effect only on ordered attack. We'll fix that!

Now just make some dummy spell and use Orb of Slow ability to make it cast on, for example, 50% chance. Make a new trigger and add: „Unit - A unit Starts the effect of an ability“ event. Use conditions and actions here to make your desired spell effects.

And now we shall make it cast normally on 50% chance on EVERY, not just ordered attacks! Add this trigger also:
  • Passive Fix
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • Wait 0.00 seconds
      • Unit - Order (Attacking unit) to Attack (Attacked unit)
      • Wait 0.00 seconds
      • Unit - Order (Ordered unit) to Stop
I think everyone understands this... It orders units that attack even when not ordered and then stops them so they wont follow attacked unit until it dies.

Pls give credits if used and more importantly POST COMMENTS!

Thanks for your time!
 
Last edited:
Level 3
Joined
Jul 20, 2008
Messages
41
The last trigger doesnt make sense... What it currently does is to prevent any unit from attacking at all. Also why the wait of 0 seconds?
 
Level 5
Joined
Mar 13, 2008
Messages
126
you missunderstood...wait must be there, because then WE knows it has to wait,not to run trigger asap and it doesn't prevent from attacking it ORDERS to attack so even unordered attack is actually ordered and Orb of Slow works only on ORDERED attacks... Do you get it now? Tnx for comment!
 
Level 3
Joined
Jul 20, 2008
Messages
41
OK but the attack is not executed at once. The attack animation stops a bit and then starts to attack again :/
 
Level 47
Joined
Jul 29, 2008
Messages
9,685
Although I disagree about not using "Unit is Attacked" (for me, it works in most situations), I had a few things to add about using "Orb of Slow".

~~~

First off, you can use "Orb of Slow" or "Orb of Lightning". Both (seem to be) exactly the same.

Secondly, since using either leaves you with a nasty disabled-version of the icon for your command card, I would highly suggest making dummy placeholder abilities with your intended icon on them. The "dummy" ability would just be, like, a passive, that requires the same upgrade to get the ability (if that applies). The actual O-o-L ability would have no icon, and just work automatically.

Finally, their is a common-known bug concerning the usage of OoL/OoS; in that, if the unit with the ability isn't ordered to attack a target (i.e., it sees an enemy and attacks by itself), no matter what, the ability won't activate.

--EDIT-- My bad, I didn't realize you already knew this. Props, man.

To fix this, I've come up with this:
  • Force Attack for OoL Copy
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Level of Laceration (Visible Icon) for (Attacking unit)) Equal to 1
    • Actions
      • Unit - Order (Attacking unit) to Attack (Attacked unit)
With "Laceration" being the custom ability ("(Visible Icon)" is just what I used as the 'dummy' ability). That way, if a unit has this ability (it requires an upgrade, so Level 1), and it attacks something, it orders it to attack, thus making it able to activate it's "passive" ability.

(The only thing wrong with it is... maybe you wanted him to just attack a few times, then run back to his 'post' where he was standing still, but now he's attacking...?)

~~~

Anyway, hope that helped.
 
Level 5
Joined
Mar 13, 2008
Messages
126
yes i know that he continues attacking,i don't want that, that's why i used 0 second wait and stop...
anyway tnx^^

--EDIT--
there is another problem with making ordered attacks...if u make a unit is attacked event and then use action to make units attack there is a nasty "twich" because unit attacks,stops and re-attacks...
that's the reason why i dropped this...
 
Level 5
Joined
Mar 13, 2008
Messages
126
k...
P.S. What does OoL/OoS mean? =P

--EDIT--
i don't have WE here,i'm on vacation, so i'm not sure if laceration is your custom ability or...?
i didn't understand you completely thats the reason i'm asking...
TNX AGAIN

--EDIT 2--
sorry for ool and oos, i figured it out XD
 
Level 5
Joined
Mar 13, 2008
Messages
126
i've returned home and tested your way...
i found 2 bugs...
the first thing is the first attack.it isn't even performed, the attacked unit start running and THEN attacking actually starts attacking...
and sometimes attacked units start attacking you!!!!(tested on peasants, they usually just stand)

--EDIT--
maybe the reason of this bug is that i tested it with different CONDITION, i've put level of OoL instead level of some upgrade, but i don't think so...

if that is the reason please post your test map here, i don't have time to mess with this anymore...
TNX
 
Level 47
Joined
Jul 29, 2008
Messages
9,685
Well, I'm actually working on a test map for a tutorial, but I don't want to post that yet, because I ran into problems with it (ironically enough).

See, I made 3 different versions of the OoL ability for testing, but one (the melee, 100% version) doesn't work at all. In fact, nothing on that unit works, which is disturbing.

To answer your question... I'm not sure. "Laceration (Visible Icon)" was just a placeholder, dummy passive skill that shows up to show you you have that ability. I set it to require the same upgrade as the actual Laceration ability, so if you had one, you had the other. Thus, "Integer - Level of Ability for Attacking Unit = 1", should work if you use the (Visible Icon) ability for the Ability^^.

If not, no clue. Perhaps "level of ability for attacking unit Greater Than 0"?
 
Top