• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Computer Not Casting Ability

Status
Not open for further replies.
Level 6
Joined
Aug 12, 2007
Messages
201
  • SelfSleepSpell
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Go To Sleep
    • Actions
      • Set SleepingHero = (Position of (Triggering unit))
      • Unit Group - Add (Triggering unit) to SleepingUnits
      • Unit - Create 1 SleepDummy for (Owner of (Triggering unit)) at SleepingHero facing Default building facing degrees
      • Unit - Order (Last created unit) to Undead Dreadlord - Sleep (Triggering unit)
      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
      • Trigger - Turn on SleepingGainFatigue <gen>
      • Custom script: call RemoveLocation (udg_SleepingHero)
This trigger works just fine whenever I cast 'Go To Sleep', yet when a computer character casts it, the summoned dummy won't cast sleep on his hero. What could be causing this? Computer AI getting in the way somehow? I know the trigger is firing because of the Turn on at the end messages me when the trigger is turned on for testing purposes and it is getting that far at least, and the spell he's casting can target the hero because it can target me when I cast it.

I tried changing the summoned dummy to Neutral Hostile in case it just wasn't casting sleep on it's own units, but it wouldn't cast sleep on the hero either.

Tried setting all the Triggering Units and Last Created Units to variables and it still won't cast on it.

It WILL cast on the enemy hero if I set the dummy's team to my own team for some reason, but I'd rather have the dummy belong to his team, as a dummy on my team with no view distance won't cast. No other team but myself seems to be able to do this.
 
Last edited:
Level 6
Joined
Aug 12, 2007
Messages
201
I had that one before and it makes no difference, the PC won't cast on himself, but mine will. I'll put it back on but that doesn't solve that the PC won't cast on his own units for some reason.

All I can think of is that Sleep is an inherently hostile action and that the AI is overriding the order and not letting itself cast sleep on its own unit or something dumb like that. The trigger looks sound no matter how I look at it and it works just fine if I trigger it.

EDIT: Huh. I don't know what or why it changed, but setting the cast backswing point and cast point to 0 made it work, even though it cast fine on my own guys, it wouldn't on computers. Weird, and I'm pretty sure the dummy had enough time to cast the spell and all.
 
Last edited:
Level 6
Joined
Aug 12, 2007
Messages
201
Yeah, I'm also guessing what Justify bets. I'd create the dummy for the Neutral Hostile, since you muddle up with AI.

I tried Neutral Hostile actually and it wouldn't cast for some reason, maybe it was trying to auto attack even though it had no attacks or something? Either way the backswing of 0 fixed it now.
 
Status
Not open for further replies.
Top