| 05-24-2009, 08:24 PM | #1 |
I have a chat command that causes a dummy caster to cast a spell on a pre-designated unit (always the same unit). The dummy caster is always for the same player and always moved to the predesignated unit before casting the spell. The predesignated unit can move around normally. The problem: When I enter the chat command and the target is alone, nothing happens. When I enter the chat command and the target has some enemy units on the screen (out of acquisition range), the spell is fired at him and he is affected by it. The problem is with IssueTargetOrder - when the spell doesn't work, this returns false. I can't figure out why this would be due to enemy units being nearby. Any thoughts? |
| 05-24-2009, 08:49 PM | #2 |
Sounds interesting. Make a test map that just shows off the problem and post it and I'll look it over. |
| 05-25-2009, 01:11 PM | #3 |
Hmm... my first test map didn't have the problem. Will need to copy over all the relevant aspects exactly as they are and test to narrow it down. In the meantime, if anyone has any generic thoughts on why IssueTargetOrder would fail I'd be much obliged. I've put debug in to confirm that caster does have the spell and is placed at the same coords as the target, etc. Spell doesn't need mana and isn't in cooldown. |
| 05-25-2009, 01:26 PM | #4 |
Could it be that the dummy caster belongs to an enemy player and doesn't have the vision of the target unit? |
| 05-25-2009, 01:35 PM | #5 |
Do you use trackables for something? I think they can make target and point orders fail or something. |
| 05-25-2009, 06:43 PM | #6 | |
Quote:
I disabled mask/fog in the test map which is why I didn't get the problem. A quick addition of UnitShareVision() fixed the problem. I feel like such a fool. However now I have to figure out a way around it. Simply giving the caster sight radius doesn't seem to work, and I can't undo UnitShareVision in case the enemy team already had shared vision of the unit for another purpose (my map has a couple of spells that could give temporary shared vision in this way). Also, most of the properties of my dummy caster are the same as Vexorian's so his 'caster system' may have the same problem (although how often do you cast dummy spells on targets you can't see). Speaking of which, Vexorian's dummy caster has another problem with projectile-type spells. At least with Drunken Haze, ENDCAST fires before the target units get the buff - I think this is to do with one or more of the properties that has the word 'projectile' in it's name being set to zero (I didn't narrow down precisely which one(s)). Only a problem if you need to check which units were 'hit' by drunken haze. Out of curiosity, what's a trackable? |
