Dummy units and abilities

F

Frockner

Guest
I am finally getting the hang of the World Editor, but this is still an area that i just don't understand--making dummy units and getting them to cast spells.

I just have some general questions first, then i'll ask about an ability i am trying to make. What is the best way to make a dummy unit? When i use a trigger to issue that unit to cast a custom spell, it doesn't show up on the list--the only spells that appear are the generic abililities in the game. Is it possible to order a unit to cast a CUSTOM spell instead of having to use one that the game provides?

The ability i want to create is a hex-like spell (cast by a unit, NOT a hero) that hexes all enemies (even enemy creeps) into a random creep for 8 seconds (same time for both heroes and creeps). I really didn't know what unit to base it off of, so i tried to base it off of Starfall. I increased the cast range and AOE to the max level possible. I removed all damage. Tweaked mana costs and the amount of time the spell is channeled for.

Then i did a trigger that said when a unit begins channeling an ability equal to (custom ability name) to create the dummy unit at the position of the casting unit. I ordered that unit to use Orc-shadow hunter hex.

That's where i got lost. I tried to use a random unit from a random 200 units in the playable map area, but it seems like the dummy unit doesn't even cast the spell. Then i waited 1 second and removed the dummy unit from the game.

I just don't know why it's not working. I tried a similar spell before when a unit would cast shadowstrike to create a dummy unit that would cast shadow strike on units around the casting unit but once again, the dummy unit never cast the spell.

Does anyone know how i could do that ability and more importantly, tell me what i am doing wrong with the creation of these custom abilities?
 

Sargon

New Member
Reaction score
83
Make sure the dummy unit has the spell as an ability.
 

phyrex1an

Staff Member and irregular helper
Reaction score
447
A little guide to the world of dummies (Tha Daa):


Why use dummies?
The biggest use of dummies in GUI triggers is the mass spells. Spells with effects that allredy is in the game but targets a group of units insteed of a single one.
Name examle for such spells is:

Mass Bloodlust
Super Slow
Area Inner Fire
ect.



When we are making these spell we need 3 things from the object editor.


Ability 1 The spell that the caster has. IE the spell that the player sees. This spell can have grapics but shouldent have any game effects such as damage and such. The best spell to start this of is channel. A channel tutoriall can be found here.


The most imortand part of this spell is how it is cast. If you want a aoe effect around the caster it should be Instant (Just click to use). If the effect should be aoe around another point it should be point targeteble. It can ofcourse be unit targetable to but this is just a worse version of a point targetble spell when we are talking about the mass spells.

This spell should have prober tooltip. If your are using the short cuts, (<XXXX,YYYY>), they should point to the Ability 2.

Ability 2 The spell that have the effects. It sould be a unit ability and have 0 mana cost and long range. It may be custom and it may have more than one level

This spell should have the custom buffs if it is any.


Unit 1
A dummie that has the spell Ability 2. You may have the same dummy for all spells if you want. But it is reqomendet that they dont have all spells if you only have a single unit. Then you have to add the spell with a extra actio in a trigger.

The dummy should have locust and the model ".mdl"



When all this things is done we only need one thing: The trigger.
The begining of the trigger looks at the same way for both of the point targetable and the instant spells. Only the actions is different.

Code:
Mass Spell
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to [B]Ability 1[/B]

The actions is sligtly different if you have a instant or a point targetable.

To make this easier to read we have a few variables:

Real Area is the area of effect
Point Point is the center of the area of effect.

Note: Things in italic is things i added just becuse I am a idiot and use jass in gui :nuts: . If you dont know what it is you dont need it. It has with something called momory leaks to do.
Code:
Actions
    Set Area = 200.00 [B]OR[/B] Set Area = 150 + (Level of (Ability being cast) for (Casting unit) * 50)
    [B] - The radius, first as constant and second as level based-[/B]
    Set Point = (Position of (Casting unit)) [B]OR[/B] Set Point = (Target point of ability being cast)
    [B] -The middle of the aoe depends on wich type your ability is-[/B]
    [I]Custom Script: set bj_wantDestroyGroup = true[/I]
    Unit Group - Pick every unit in (Units within Area of Point matching [B]<You May choose you conditions>[/B] and do (Actions)
        Loop - Actions
            [I]Custom Script: call RemoveLocation(udg_Point)[/I]
            [B] -If you dont have the ting below this. There is no idea to have this-[/B] 
            Set Point =  ???
            [B] -If Ability 2 is a projectil spell, you may want that the cast comes from another place than the center-[/B]          
            Unit - Create 1 [B]Unit 1[/B] for (Owner of (Casting unit)) at Point facing Default building facing degrees
            Unit - Add [B]Ability 2[/B] to (Last created unit)
            [B]- If you are using the same dummy for all abilities-[/B]
            Unit - Set Level of [B]Ability 2[/B] for (Last created unit) to (Level of [B]Ability 1[/B] for (Casting unit))
            [B]-If you are using a ability with more than 1 level-[/B]
            Unit - Order (Last created unit) to Human Priest - Inner Fire (Picked unit)
            [B]-The order should be the one you based Ability 2 off-[/B]
            Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
     [I]Custom Script: call RemoveLocation(udg_Point)[/I]

Some tips on condions is:
Pick only allies or only enemies.
Dont pick buildings or other units that cannot be affected of the spell.
Dont pick the caster.


I made a little tutorial or something :D
 
D

dArKzEr0

Guest
What is the best way to make a dummy unit?

Make a "new custom unit" from any unit. Let's use the archer for the purpose of this thread. Make a new archer and give it a name you'll remember such as "Dummy Casting Unit". Delete the abilities the archer has, and give it the locust ability. That'll make the archer invulnerable (and I think unselectable - but don't quote me). Then make the collision size = 0, so your units don't bump into the dummy. Change "Movement Type" to "None" so your dummy doesn't move around at will. I'll list the rest for easier reference:
*Food Cost = 0
*Sight Radius (Day/Night) = 50 (You don't want your dummy seeing further than it should)
*Categorization Special = True (This is a personal preference, you don't have to do it though)
*Unit Sound Set = None
*Has Water Shadow = False
*Model File = .mdl (To get this, simply put something the edittor won't recognize, this is so that there is no model assigned to your dummy unit, so you can't see it in game)
*Selection Scale = 0 (Just incase I was wrong about locust up there ^)
*Shadow Image (Unit) = None
*Combat Attacks Enabled = None (So your dummy doesn't deal damage when it shouldn't)

Ok, your dummy is now ready to use!

When i use a trigger to issue that unit to cast a custom spell, it doesn't show up on the list--the only spells that appear are the generic abililities in the game. Is it possible to order a unit to cast a CUSTOM spell instead of having to use one that the game provides?
Every custom spell you use is based off of one of the spells Blizzard already made, therefore, every custom spell IS on that list. The trigger is referring to the value "Order String Use/Turn On" in the ability tab of your object edittor. Look at that string for your custom spell and use it in the trigger, it should work as long as you gave the custom spell to your dummy.

I increased the cast range and AOE to the max level possible
Don't bother, as a matter of fact, let's use a different spell, as Starfall can get a bit buggy. Use something like water elemental or fan of knives and set all of the values to 0. Then, for your trigger do something like this:
Code:
Mass Hex
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to [I]Ability assigned to your casting unit[/I]
    Actions
        Unit Group - Pick every unit in (Units within [I]XXX.XX[/I] of (Position of (Casting unit))) and do (Actions)
            Loop - Actions
                Unit - Create 1 [I]Archer Dummy Unit[/I] for (Owner of (Casting unit)) at (Position of (Casting unit)) facing (Position of (Picked unit))
                Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
                Unit - Order (Last created unit) to Orc Shadow Hunter - Hex (Picked unit)

I ordered that unit to use Orc-shadow hunter hex
Make sure to give your dummy unit the dummy version of hex you want him to use, with the correct time and whatnot. Also, set the range to a ridiculous amount, such as 3000. Set the mana cost to 0 and the casting time to 0 as well.

and more importantly, tell me what i am doing wrong with the creation of these custom abilities?
Well, there could be a billion things you're doing wrong, but I hope this post helps! If you read through it and you're still having problems, post specifically what your problem is.

dArKz

//edit: Meh, looks like you and I were doing the same thing phyrex1an, but you beat me to it :( . Oh well, hope one of us helped him.

////edit #2: To the original poster: phyrex1an's mini-tutorial is a great read for overall dummy usage and mine goes more in depth to your particular spell.

Also, the problem with using variables such as in the last trigger phyrex1an supplied, is that if you have two units casting the spell at the same time, you're going to have some major bugs, so I prefer either using "casting unit" and whatnot or creating local variables.
 
F

Frockner

Guest
Wow, you guys are awesome. I'll try the info from the super tutorial and see what happens.


Just one question though, why the use of "picked unit" in that trigger and how does it help?

Ok, gonna try to set up the spell now. Thanks again :)
 
D

dArKzEr0

Guest
Lol, and without knowledge of each other's doing so...

When you use the action "Pick every unit in...", it literally "picks" the units that you want to be affected, then it DOES something. "Picked unit" is simply a way of saying "The unit you just picked a few seconds ago using 'pick every unit in...'". Get it?

dArKz
 
F

Frockner

Guest
Wow, it's working PERFECTLY. Thank you very much--you have all been very helpful.

Just a suggestion, though. I don't think there is a generic tutorial on more advanced unit abilities. One or both of you might want to submit one on this subject. You helped me out SO much (as i am sure you will help others who read this thread, as well) and i am sure you could help so many others if you chose to do a quick tutorial on this.

Once again, thank you very much! :)
 
D

dArKzEr0

Guest
Anytime ;) . Tut's are for the mods to decide though, I guess.

dArKz
 

phyrex1an

Staff Member and irregular helper
Reaction score
447
No, you have to submit tuts. You can write a tutorial submit it and they deside to take it or not. If not make it better and send again :D. I think there is a post by Ryoko somewhere on how tutorials should be.

part from this:
http://www.world-editor-tutorials.thehelper.net/index.php
"We accept submitted tutorials from the community. Upon approval, all tutorials are subject to revision for clarity and for web formatting. Credit is given to the original author when the work is approved..."

Some threads that the moderators/admins finds informative is bumbed sometimes.
 
M

metallic_boy

Guest
WOW A SPECIAL THANX TO YOU TWO!!!

I was just reading over this thread to see if i could help and i found out the great thing about the list of abilities. Like the poster of this thread, i was puzzled as to why you couldnt order units to cast custom spells! but now i know... CHEERS GUYS!

~metallic boy
 

SilverHawk

General Iroh - Dragon of the West
Reaction score
89
Well, in my opinion, while they are both very informative, Phreyxian's is more generic and better suited for a tutorial. If you want, I will post a link to this thread in the mod lounge so that all the mods can see it.
 

phyrex1an

Staff Member and irregular helper
Reaction score
447
Bumping this while saying: "Yeah, sure. If you havnt done that allredy" to Silver
If you want i can rewrite a few things and make some improments but i am not plannig to make a tutorial of it. If it cannot be considered as one after the improments ofcourse ;) .


Yes it took me this long time to read Silver's post, why are u asking?
 

mems

Memory Lapse
Reaction score
24
I want to add something
- Loctus is just working fine so u can use this i was wrong about it

Edit: newer mind about the comment i have posted below couse it will couse memory leak. Best way is to remove them from game which compleately removes all memorial issues of units while playing the game

Also if you have no spells based on corpses in your map, i reccomed you to create a trigger that removes decaying unit from game after death

I dont know if unit is compleately removed when having an expiration timer but searching about it.

And to make an alternate way to remove the dummy unit from game
i personally dont like to add many trigger functions if i can do the same thing with unit editor such as:
Unit - Add a 3.00 second Generic expiration timer to (Last created unit)

I make the dummy units hitpoints 3 and give it a hitpoint regeneration -1
if you used ".mdl" on dummy model you will not recieve a dying effect and it works fine. I personally feel thats a bit less laggy or lets say better on performance. Couse Game already has all units regeneration checking all the time.
Note: to assign negative values on unit editor u have 2 ways to do it
easiest way is holding shift key while double clicking on an attirube or
File-->preferences-->Allow negative real values
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top