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

Ability help {making a spell only work on (non)sleeping units}

Status
Not open for further replies.
Level 6
Joined
Jan 27, 2007
Messages
208
Event - Unit start the effect of ability
Condition - Ability being cast equal to (Your Spell)
Action -
If Targeted unit ability being cast has Sleep buff equal to True
Then (Do Your Action)
Else Game Text Message to all Players (That target isn`t sleeping)
 
You'll need an an base ability that does nothing (edit the chain lightning so that it doesn't do any damage or jump on other units) then event "unit begins casting an ability" and the condition ability being cast equal to <your spell>

then you'll need if/then/else action, that goes:

if "targeted unit has buff "sleep"
then
Do what you wish to do here
else
dispay message/floating text..."You can't cast this spell on non seeping units"

Something like this.
 
Level 9
Joined
Feb 14, 2009
Messages
316
Don't use "Begins casting". Never, unless you want to add casting animation. It will fire the effect even if the caster begins casting and then stops => bug.

Moreover, if you use triggers, the caster will start the ability, use its mana, and then get the message that the unit isn't sleeping (if it really isn't).
You can try with this:

Add this trigger:

  • Classification
  • Events
    • Time - Every 0.10 seconds of game-time
  • Conditions
  • Actions
    • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
      • Loop - Actions
        • If (All conditions are True) then do (Then Actions) else do (Else actions)
          • If - Conditions
            • If (Picked unit) has buff Sleep Equal to True
          • Then - Actions
            • Unit - Remove clasification of A sapper from (Picked unit)
          • Else - Actions
            • Unit - Add clasification of A sapper to (Picked unit)
Then open Stats - Targets allowed in your ability and check Non-Suicidal.

Last, go in Advanced > Gameplay Constants, and on Text - Messages edit the message Unable to target sappers. to be That target is not asleep.

Good luck.
 
Last edited:
Level 8
Joined
Mar 12, 2008
Messages
437
How about this
  • Chocolate chip cookies are delicious
    • Events
      • A unit begins casting an ability
    • Conditions
      • Ability being cast equal to Bike Theft
      • ((Target unit) has buff Sleep) equal to False
    • Actions
      • Unit - Issue (Casting unit) to Stop
 
Level 20
Joined
Jan 6, 2008
Messages
2,627
How about this
  • Chocolate chip cookies are delicious
    • Events
      • A unit begins casting an ability
    • Conditions
      • Ability being cast equal to Bike Theft
      • ((Target unit) has buff Sleep) equal to False
    • Actions
      • Unit - Issue (Casting unit) to Stop
You cant 2 whole different Conditions at the time, that will make it only be castable at evry time and on Non sleepers,try this.

  • Sleep Spell
    • Events
      • A unit begins casting an ability
    • Conditions
      • Ability being cast equal to Spell
    • Actions
      • If / Then Else
        • If
          • Unit has buff Sleep Equal to true.
        • Then
        • Else
          • Do Nothing / order him to stop
 
Level 9
Joined
Feb 14, 2009
Messages
316
It is somewhat OK but won't work as other target incompatible messages (e.g. "Unable to target structures" or "Can't impale this unit").

Again, begins casting will issue with Stop order and if the target is sleeping, you can fire spells at it with no cld/mana cost if you begin the casting and then immediately stop.
Remember that Begins casting is used only if you want to add effect to the casting itself, but not to the effect.

P.S. That sig with Bush is hilarious
 
Level 9
Joined
Feb 14, 2009
Messages
316
Begins casting - Stop (Smiddle) will simulate it almost effectively and is easier than editing game interface and using 10 checks and actions per second. Let the OP choose a way to do it. The advantage in my method is that the ability looks more realistic itself (not aware you when you begin casting but when you choose a target, etc). Anyway, sometimes I'm too much detailish.

While in Slaydon's method there can be severe abuse (beginning casting the ability upon a sleeping unit will launch the trigger actions and when you press imediately Stop you can prevent the ability being actually casted => abuse/exploit/bug/whatever you call it but you will be able to cast rapid spells w/o mana cost).
 
Level 19
Joined
Nov 16, 2006
Messages
2,165
Smiddle his way is the most efficient way to make the spell work like it should be.
His trigger prevents your unit to cast the spell when the unit is not sleeping.

You cant 2 whole different Conditions at the time, that will make it only be castable at evry time and on Non sleepers,try this.
Fail. You can. It will check both conditions before launching the actions.
 
Status
Not open for further replies.
Top