[Trigger] Triggerred Spell Works... except when a computer uses it?

Status
Not open for further replies.
Level 11
Joined
Feb 11, 2010
Messages
199
As far as I can tell, this is GUI, MUI, etc and works just fine... when a human player uses it. Basically, it's Sleep with a projectile, using Acid Bomb as a dummy spell. However, when an AI player uses the spell, the dummy unit doesn't cast Sleep. Why? What's wrong?

  • Knockout Dart
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Knockout Dart
    • Actions
      • Set KnockoutDart = (KnockoutDart + 1)
      • Set KnockoutDartSkip = (KnockoutDartSkip + 1)
      • Set KnockoutDartOn[KnockoutDart] = True
      • Set KnockoutDartTarget[KnockoutDart] = (Target unit of ability being cast)
      • Set KnockoutOwner[KnockoutDart] = (Owner of (Triggering unit))
      • Set KnockoutDartTimer[KnockoutDart] = (MASTERTIMER + 5.00)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • KnockoutDartSkip Equal to 1
        • Then - Actions
          • Trigger - Turn on Knockout Dart Loop <gen>
        • Else - Actions
  • Knockout Dart Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer KnockoutDartA) from 1 to KnockoutDart, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • KnockoutDartOn[KnockoutDartA] Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (KnockoutDartTarget[KnockoutDartA] has buff Knockout ) Equal to True
                • Then - Actions
                  • Set KnockoutDartPoint[KnockoutDartA] = (Position of KnockoutDartTarget[KnockoutDartA])
                  • Unit - Create 1 KNDummy for KnockoutOwner[KnockoutDartA] at KnockoutDartPoint[KnockoutDartA] facing Default building facing degrees
                  • Unit - Order (Last created unit) to Undead Dreadlord - Sleep KnockoutDartTarget[KnockoutDartA]
                  • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
                  • Set KnockoutDartSkip = (KnockoutDartSkip - 1)
                  • Set KnockoutDartOn[KnockoutDartA] = False
                  • Custom script: call RemoveLocation(udg_KnockoutDartPoint[udg_KnockoutDartA])
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • KnockoutDartSkip Equal to 0
                    • Then - Actions
                      • Set KnockoutDart = 0
                      • Trigger - Turn off (This trigger)
                    • Else - Actions
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • MASTERTIMER Greater than or equal to KnockoutDartTimer[KnockoutDartA]
                    • Then - Actions
                      • Set KnockoutDartSkip = (KnockoutDartSkip - 1)
                      • Set KnockoutDartOn[KnockoutDartA] = False
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • KnockoutDartSkip Equal to 0
                        • Then - Actions
                          • Set KnockoutDart = 0
                          • Trigger - Turn off (This trigger)
                        • Else - Actions
                    • Else - Actions
            • Else - Actions
(Note: The "timer" part at the bottom is just to make sure the spell loop doesn't run on forever in case the target unit dies or something and the buff is never applied. MASTERTIMER increases based on a periodic event (increases by 0.03 every 0.03 seconds))
 
Last edited:
Level 11
Joined
Feb 11, 2010
Messages
199
a) computer? neutral player? empty player?
pls tell exactly what you mean.

Caedrus said:
However, when a Computer player uses the spell, the dummy unit doesn't cast Sleep.

I mean exactly what I said in the first post: Not a neutral player, not an empty player, a Computer player (EG, a player slot that is filled by a Computer(Easy), Computer(Normal), or Computer(Insane) instead of a human being). I'm not sure how I can be any more explicit than what I've already said. I said, specifically, a computer player (not a neutral player, not an empty player) in the first post.

it may happen that the dummy is created for the wrong player.

This is not the case. The spell works properly for a human player in any player slot. It does not work properly for a computer-controlled player in any player slot. Player slot has nothing to do with it.
 
Level 9
Joined
Aug 21, 2008
Messages
533
after its not important who is casting the sleep, create the dummy for a fixed player and try it again. Make sure that sleep is castable on allies.

I think even this reduce the needed vars.


if you mean a computer player , please say AI. Also empty players are controlled by you computer =/
 
There's an "AI - Ignore Guard Position" command, though I don't know how effective it is at neutralizing his assigned orders. Like SlayerII said (I think), you should throw the spell in a Neutral Player slot to cast it. After all, it is "Sleep", not a spell that damages over time. Unless you want it to damage over time, in which case you could probably get away with dumping on an empty player slot that is allied with the Caster's owning player.
 
Status
Not open for further replies.
Top