HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Dummy casting spells in fog

08-27-2009, 07:21 PM#1
EvilNoodle
Is there any way to make a dummy unit cast a spell like for example shadow strike in fog on a unit?
Would kinda save me alot of triggering ><
08-27-2009, 09:17 PM#2
Zerzax
I'm pretty sure dummy units don't need vision to execute an order...

Has the order not been working? Make sure the unit has the ability, has mana, and is not allied to the target unit, and that you've used the right order.
08-27-2009, 09:20 PM#3
Rising_Dusk
Quote:
Originally Posted by Zerzax
I'm pretty sure dummy units don't need vision to execute an order...
If it is an order targeting a unit, then they do. You cannot complete an order targeting a unit that you cannot see.

Simply do the following:
Collapse JASS:
local player OriginalOwner = GetOwningPlayer(DummyUnit)
call SetUnitOwner(DummyUnit, GetOwningPlayer(TargetUnit))
call IssueTargetOrder(...)
call SetUnitOwner(DummyUnit, OriginalOwner)
08-27-2009, 09:33 PM#4
Zerzax
That's good to know. I guess you'd need to make sure the spell could hit allies. That's pretty simple though.
08-27-2009, 10:05 PM#5
Themerion
Er... Dusk, won't that cause any instant spell to be credited to the wrong player? For instance if it's a killing spell, will the player, or the killed player get bounty?

Just use UnitShareVision otherwise?
08-27-2009, 10:21 PM#6
Rising_Dusk
Quote:
Originally Posted by Themerion
Er... Dusk, won't that cause any instant spell to be credited to the wrong player?
Sharing vision won't work (if memory serves) as it takes longer than an instant for the vision to propagate between players. Changing the owner of the ability is the only surefire way. This still causes some issues with invisible units, though.

The best way to do things is to just avoid using target spells whenever possible. The only thing you should use them for ever is stun. (And silence, though that can almost perfectly be reproduced)
08-28-2009, 12:54 PM#7
Anitarf
Quote:
Originally Posted by Rising_Dusk
Sharing vision won't work (if memory serves) as it takes longer than an instant for the vision to propagate between players.
Seems to work just fine in xecast.
08-28-2009, 01:05 PM#8
Rising_Dusk
Hrm. That might fix the silly invisible-cast bug then. I remember testing that and not using it for some reason... I wish I had a better memory or kept notes or something.
08-28-2009, 05:30 PM#9
EvilNoodle
UnitShareVision doesnt seem to work, gonna try Dusk's suggestion, but i got a question. If i use this method will the owner of the dummy caster get the bounty+xp?
08-28-2009, 07:05 PM#10
Rising_Dusk
Yes, if you use this method for a dummy spell that will kill the target. What you should do, however, is have the dummy spell perform effects only, such as stun, and then for damage simply trigger the effect.
08-28-2009, 07:13 PM#11
TKF
I use a very simple solution for this in my custom abilities. I just make a minor visualization dummy at the target area/near target unit in fog maps. Problem solved.


Or I'm getting this wrong?
08-28-2009, 07:56 PM#12
Anitarf
Quote:
Originally Posted by EvilNoodle
UnitShareVision doesnt seem to work,
That's odd, I specifically tested this with xecast and it worked under fog of war, this is the code xecast uses:
Collapse JASS:
            call UnitShareVision(target, .owningplayer, true)
            call IssueTargetOrderById(dummy,this.oid,target)
            call UnitShareVision(target, .owningplayer, false)
08-28-2009, 08:35 PM#13
Rising_Dusk
Quote:
Originally Posted by TKF
I use a very simple solution for this in my custom abilities. I just make a minor visualization dummy at the target area/near target unit in fog maps. Problem solved.
Super lame solution, man. Why create units when you don't have to? :/
Quote:
Originally Posted by Anitarf
That's odd, I specifically tested this with xecast and it worked under fog of war, this is the code xecast uses:
I'll test it further later tonight, but I suspect xecast works fine and that you're actually doing something wrong, Noodle.

Ani, that works on invisible units to the source player too, correct?
08-28-2009, 08:48 PM#14
Anitarf
What I did was use the sheep staff sample in the xe6.0 demo map (before testing, I set the corresponding xecast calibration constant to true) from behind some trees so I had no vision of the targeted area. The owning player of the xecast object (and therefore the dummy unit) in that sample is set to the owner of the casting unit, which was me. I had no vision of the targeted area and indeed in a previous test before I changed the calibration constant to allow this it didn't work.
08-28-2009, 10:48 PM#15
EvilNoodle
Quote:
Yes, if you use this method for a dummy spell that will kill the target. What you should do, however, is have the dummy spell perform effects only, such as stun, and then for damage simply trigger the effect.
Well the idea was to avoid this so it wouldnt be as much work, but since i couldnt figure any other way i had to do it.

Quote:
That's odd, I specifically tested this with xecast and it worked under fog of war, this is the code xecast uses:
I actually i hooked up your system and tried to use that code, but i didnt test with the "IssueTargetOrderById" function so im not sure if thats why.
I didnt get Dusk's method to work either (Im using both GUI and Jass if that has anything to do with this? xD)