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?
 
Make sure the dummy unit has the spell as an ability.
 
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
 
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.
 
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 :)
 
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
 
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! :)
 
Anytime ;) . Tut's are for the mods to decide though, I guess.

dArKz
 
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.
 
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
 
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.
 
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?
 
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.
  • Varine Varine:
    Luckily I live in an age with electricity so it's way fucking faster, but when I was just a boy trying to find my place I had some hardcore chefs that made use do things like that by hand. It is WAY easier to get right by hand because you control it and can feel it, but it takes soooooo much longer. And on the scale a modern kitchen requires... I serve 400-500 guests on average per day right now, if I had 100 then we could do things way better
  • Varine Varine:
    But we can't do that. In the winter yeah, but I HAVE to get people through here right now so I can afford the staff that we CAN do that. We have about 100 days of summer, and if that summer doesn't make us what it will, then I can't operate the other most of the year with my staff. The owner is talking about closing two days a week to cut down on labor, I told him he should cut down on vacations and it did not go great. I do think I won though, I have to keep my fucking core staff and they have to be gainfully employed
  • Varine Varine:
    Sure some of them might take a second job, but I can't just cut my entire staff to unlivable hours, nor can I can cut them off all winter if I want them to come back.
  • Varine Varine:
    And also, there is no fucking way I'm pulling these hours come september. I only do this right now because I have to, the second I don't have to be the one doing it I won't be
  • Varine Varine:
    I have a 5 person core staff in the kitchen, not including me or Chef Ben
  • Varine Varine:
    Though two of those people are likely not making it this year. One of them has been replaced, the other I am kind of trying to. He's being a giant bitch, today I had to get onto him because in the three hours before I left he had taken like thirty minutes for cigarette breaks
  • Varine Varine:
    And he was also complaining to me the other day that he was out of weed so couldn't smoke any before work that day, and was confused about why I was annoyed he was telling me, his boss, that he is smoking weed everyday before work.
    +1
  • Varine Varine:
    Like yeah I can tell. I don't need to fucking know.
  • Varine Varine:
    So now he's getting scrutinized and will not be top of the list. I know I don't have the smartest people but I do expect them to have some common fucking sense
  • Varine Varine:
    I did do a rare thing for me and hire a girl last month without warning. Everyone was made at me because I started her at like 21, but she worked with me before and I was like don't care. She made 19 at her old job and I wanted her to come work with me, she is the best
    +1
  • Varine Varine:
    I'm going to get her a raise at the end of the summer. She wants to go to school again, but I want her to still work with me so.... she kind of can just tell me what the price is. I can go to 25 if she keeps up. I need to get her onto line more, that's what she wants, but I need her where she is and it's not fair that she doesn't get the little bit of raise that comes with it. She can do it no problem, I've worked with her there.
  • Varine Varine:
    It's just hard to move and train people unnecessarily right now. And also the line fucking sucks, it's not any more fun. This is turn and burn so I have the bankroll, and everyone suffers for it
  • Varine Varine:
    Eventually we'll get it balanced, we'
  • Varine Varine:
    we're starting online orders and stuff, but I also turn that off all the time because I barely keep up trying to be the best at Sysco shit
  • Varine Varine:
    I think it's gonna be a good fall and winter though. We're going to have a good staff, they will get along, they will be able to manage the workload and the complications, they know how to really cook this year, like every person on line knows their steak temps. Some of them use thermometers a lot and they don't always use them right, but they do know how to do it. Failure, especially in this field, is the only way to get better. They'll get it
  • Varine Varine:
    They won't get feel down while they do the thermometer, but we didn't have an instant read probe when I was learning. Like they did but god knows how off it is, you HAD to do it by feel. Even if the chef was fine with me bringing my own, it takes too long. Poke and know
  • The Helper The Helper:
    420 threads in the Artificial Intelligence forum :)
  • The Helper The Helper:
    Happy Monday!
    +1
  • The Helper The Helper:
    and then it was Tuesday!
    +1
  • The Helper The Helper:
    fyi I am going out of town to lake somewhere in bfe texas for the weekend will be gone Friday morning to sunday afternoon for a paranormal thing and some rest peace
  • jonas jonas:
    cool take it easy
  • jonas jonas:
    I recently had an experience with a waiter that really brought down @Varine's point about them being in sales. The first waiter just asked "anything else? deserts?" and when the table shook their head said "ok" and left. Then the other waiter came in and started going off describing the deserts and you could see the heads turning, and they finally got a bunch of deserts
  • jonas jonas:
    makes sense if you consider that the tip is basically a commission on sales

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials
      Top