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

[Trigger] Trigger works for Human Player, but not for Computer controlled Players

Status
Not open for further replies.

SpasMaster

Hosted Project: SC
Level 24
Joined
Jan 29, 2010
Messages
1,994
Hello, Hive

I've recently run into an issue with a triggered spell. It's an instant lightning strike that deals damage immediately when cast and spawns 6 Lightning Globes in a circle around the target. The globes then immediately move towards the cast point and upon reaching it begin to attack nearby enemies. When testing the spell it worked properly. When given to enemy controlled creeps (which automatically cast the spell) one of its actions was not executed - the movement towards the center part. Let me repeat: it works when testing it with a unit of my own, it doesn't when an enemy casts it. And again, when an enemy casts the spell every single part of the trigger is executed correctly except the movement part. I am going to post the trigger below including 2 screenshots.

Screenshot 1: My hero has casted the ability, the dummy lightning globes have spawned in a circle and moved towards the center.
Screenshot 2: An enemy unit has casted the ability, the dummy lightning globes have spawned in a circle but have not moved towards the center.
Note: The spell is not a subjected of any other triggers, it's fresh and new, so nothing else is messing with it.

[trigger=""]
Lightning Circle
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to (CREEP) Lightning Circle
Actions
Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (40.00 x (Real(AIAbilities_Level))) damage of attack type Spells and damage type Magic
Set Generic_Point = (Position of (Target unit of ability being cast))
Special Effect - Create a special effect at Generic_Point using Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl
Special Effect - Destroy (Last created special effect)
Set Degree = 0
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
Set Degree = (Degree + 60)
Set DummySpawnLoc = (Generic_Point offset by 175.00 towards (Real(Degree)) degrees)
Unit - Create 1 Dummy Lightning Globe for (Owner of (Triggering unit)) at DummySpawnLoc facing Generic_Point
Unit - Order (Last created unit) to Move To Generic_Point
Unit - Add a 9.50 second Generic expiration timer to (Last created unit)
Custom script: call RemoveLocation(udg_DummySpawnLoc)
Custom script: call RemoveLocation(udg_Generic_Point)
[/trigger]

full


full


Thanks.
 
Level 4
Joined
Jul 26, 2016
Messages
88
I'm not certain why this happens... but why not just trigger the movement? o_o
Pretty sure you're capable of it.
 
Level 13
Joined
Mar 24, 2013
Messages
1,105
I would debug by seeing what order the dummy is getting when you aren't controlling it.

I would guess the unit's being told to do something by the AI and causing the interference. First thing I would try is "Ignoring the guard position" keep in mind it doesn't work for peon type units or heroes so be sure your dummy does not have those classifications.

Let us know how that works out. Worst case is you'll have do above as said above and trigger the movement.
 

SpasMaster

Hosted Project: SC
Level 24
Joined
Jan 29, 2010
Messages
1,994
Alright, debugging the orders given to the units indicates that the unit is ordered to stop twice after its move order is given. I have general dummy triggers which affect all my dummies and I checked them all, something somewhere else is doing this. Any idea how to narrow it down?
 
Last edited:
Level 20
Joined
Aug 13, 2013
Messages
1,696
Theres no such solution to enter inside the the internal scripts of the computer players, I have this as a main problem before and the only solution that I could see is manually triggering the whole ability without using dummies which is frustating but there's a way to stop this but I dont think it is recommended for such maps is making the dummy unit owner of a neutral extra or passive then go to gameplay constants set the guard distance return range to 9999999 and return time to 99999 seconds.

Edit:
Or you could do a simple trick using player slots artificially using code again :3
 
Last edited:
Level 13
Joined
Mar 24, 2013
Messages
1,105
Oh you're saying one of your triggers you think is causing the problem? Hm, I hate to say go trigger by trigger and disable until you find, but that is the surest way. However, if you're using GUI you can maybe get some luck by looking at the Object Manager (F11) and looking at triggers that have ordering of units in them.

Although Jake seems to be saying its the AI that's causing the problem, I do recall hearing something about guard position having some quirk with it but I don't remember what precisely.
 
Level 4
Joined
Jul 26, 2016
Messages
88
You could also try to give them an attack order about 0.05 seconds after they come into play, to see if the Stop orders are only overwriting your attack order when the dummies come into play, or if some internal AI script isnt letting them attack at all for some reason.
 
  • Unit - Create 1 Dummy Lightning Globe for (Owner of (Triggering unit)) at DummySpawnLoc facing Generic_Point
  • Unit - Order (Last created unit) to Move To Generic_Point
  • Unit - Add a 9.50 second Generic expiration timer to (Last created unit)
hi SpasMaster, if you're going to add expiration timer to dummy do it always right after creating unit, and after that issue orders
this will work for human and for comp slots:
  • Unit - Create 1 Dummy Lightning Globe for (Owner of (Triggering unit)) at DummySpawnLoc facing Generic_Point
  • Unit - Add a 9.50 second Generic expiration timer to (Last created unit)
  • Unit - Order (Last created unit) to Move To Generic_Point
 
Status
Not open for further replies.
Top