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

complicated problem with dummy spells and auto casting

Status
Not open for further replies.
Level 4
Joined
Jun 29, 2004
Messages
64
is anyone familiar with dummy units to cast spells? ...like auto cast on charm by using the dummy spell of slow and making a unit appear for 1 sec to cast the spell at the targeted unit by the slow and then remove the dummy?

alright well my problem is based on that. i have it so when a unit (lurker model from starcraft) burrows in the ground, then a dummy unit will pop up with the auto cast of slow to target a unit, and whenever a unit gets targeted by dummy 1, a new dummy pops up with the spell of impale to cast it at the targeted unit, make sence? so it looks like the lurkers actually attack with spines while burrowed!

but the thing is, the dummy 1 appears when i burrow the lurkers, and it also appears when i unburrow them because i made it so they appear when a spell of type burrow is used.

is there a way to make it so they APPEAR when i burrow, and DISappear when i unborrow? right now i have it so that when a lurker burrows or unburrows, dummy 1 pops up, and dummy 1 gets removed whenever a unit of type lurker is issued an order targeting a point/no point, so its like whenever he unborrows and moves, the dummy goes away. but, if i have 12 lurkers burrows, and i decide to unborrow 6 of them and tell them to move somewhere, then all 12 dummy units get removed, making the 6 that are still burrowed with no way to cast impale.... do you see my problem? can you help so that when only that particular lurker unborrows that his dummy 1 dies, and the others dont?.... thanks if you can!
 
Level 3
Joined
Jun 22, 2004
Messages
59
how about
"Unit - Remove (Random unit from (Units within 10.00 of (Position of (Triggering unit)))) from the game"
 
Level 4
Joined
Jun 29, 2004
Messages
64
hello again. about the unit group. it sounds like a good idea but i don't exactly know how to do that with unit groups and sticking to them. whats the trigger info for doing that?

_________________________________________________________

also, the way you make it seem is that if i unborrow any lurker, then all dummys will be removed, which is what is already happening and what im trying to get around

i want it so that when 1 lurker is unburrowed, then only his dummy is removed....etc

________________________________________________________

oh and jontel, thanks for the idea but if i did that, then it would remove the dummy as soon as it was made because the game couldnt tell if i was burrowing or unborrowing, just that i was casting an ability...
 
Level 4
Joined
Jun 15, 2004
Messages
72
You should make one threand and just post from there :? anyways i replied to your problem with teh burrowing and missile animations.

Ok so the trigger would be something like this...
Dummy Create
Events-
Unit - Unit Begins Casting An Ability
Condition:
(Ability Being Cast) Equal to Burrow
Actions:
Unit - Create 1 (Dummy) In bla bla bla
Unit Group - Add Unit Being Created to (Unit Group Name [Variable])

Dummy Remove
Events-
Unit - Unit Begins Casting An Ability
Condition:
(Ability Being Cast) Equal to Unburrow
Actions:
Unit Group - Remove all units in (Unit Group) From Game
 
Level 7
Joined
Mar 26, 2004
Messages
350
u can use a unit variable array variable and two different dummy spells

Code:
event - 1. dummy spell
condition - like yours
action - create 1 dummy for player (owner of triggering unit) at position etc.
variable - set "unitarray" (player number of owner of triggerin unit) = last created unit

Code:
event - sec. dummy spell
condition - like yours
action - remove "unitarray" (player number of owner of triggerin unit) from the game

think it should work, but i haven't tested
 
Level 4
Joined
Jun 29, 2004
Messages
64
Lady_Rhiea said:
You should make one threand and just post from there :? anyways i replied to your problem with teh burrowing and missile animations.

Ok so the trigger would be something like this...
Dummy Create
Events-
Unit - Unit Begins Casting An Ability
Condition:
(Ability Being Cast) Equal to Burrow
Actions:
Unit - Create 1 (Dummy) In bla bla bla
Unit Group - Add Unit Being Created to (Unit Group Name [Variable])

Dummy Remove
Events-
Unit - Unit Begins Casting An Ability
Condition:
(Ability Being Cast) Equal to Unburrow
Actions:
Unit Group - Remove all units in (Unit Group) From Game


yes i have done this, but now lets say i have 12 lurkers burrow and i unborrow 7 of them. that means all 12 dummys are removed making the other 5 useless until i unborrow and burrow them again, do you see what i mean? i am trying to figure out how to remove the dummy created for each individual lurker when it unborrows, insteal of removing all.
 
Level 8
Joined
Apr 3, 2004
Messages
507
Yes, there are three solutions to your problem that I know of. None are particularly simple.

Firstly, you can assign a unit to another unit by storing one in the gamecache under a variable indexed by the handle of the other. It involves using the return bug to get the handle of both the Lurker and the slow-caster.

If that sounded complicated, it damn well is. And pretty annoying. But if you're interested in following up on it, bring your question to the Trigger Haven forum of http://www.wc3campaigns.com/

Another option involves figuring out what the real problem is.
The problem is that burrowed units don't cast spells. But what if, instead of burrowing, you gave the Lurker a morph-style spell that changed it into an un-moving, invisible unit that played the Burrowed animation and had no attack? It would, for all intents and purposes, look just like it was Burrowed. However, it would still be able to cast spells, which means that you wouldn't need a dummy caster. In fact, you could use the Orb of Slow ability to cast Shockwave, or whatever your spines ability is, so you could have it attack after all.

The third option is to do similar to what a person already said. When you create the Slow caster, be sure to make it exactly at the location of the Lurker. When the Lurker unburrows, pick all Slow casters belonging to the owner of the Lurker within 20.00 of the Lurker's position, Kill them, and Remove them.

That being said, I want you to make sure that you get rid of each and every caster that you make in order to implement this ability. Kill it and then Remove it to make it "the most gone". If you leave units lying about purposelessly, it will severely cut into your map's processor efficiency.

Good luck.
 
Level 4
Joined
Jun 29, 2004
Messages
64
Panto said:
The third option is to do similar to what a person already said. When you create the Slow caster, be sure to make it exactly at the location of the Lurker. When the Lurker unburrows, pick all Slow casters belonging to the owner of the Lurker within 20.00 of the Lurker's position, Kill them, and Remove them.
Good luck.
i have tried this, but i can not figure out how to tell the game whether the lurker is burrowing or unborrowing. i can make a condition that says ability bein cast = to burrow, but there is no unburrow ability, so it will remove the slow caster when he burrows and unburrows since its the same ability.

for the variable stuff i will need help because i am not familiar with how they work. if you have time, i can submit a test map with my lurks on it and let you look at it to see what is going on.

http://www.thehelper.net/forums/attachment.php?s=&postid=81074
that is a link straight to my test map.
 
Level 8
Joined
Apr 3, 2004
Messages
507
I couldn't find the map that you linked to. It just queried the host indefinitely.

If you can get the map to me, I can hopefully have a look at it, depending on how busy I end up being.

Even if there isn't a discrepancy between burrow and unburrow, if the unit is burrowing, the caster unit doesn't yet exist, so it doesn't matter if it's destroyed.

The only trick is to make sure that you catch the caster unit that's made when it unburrows.
 
Status
Not open for further replies.
Top