Dummy Unit

  • Thread starter Thread starter wml
  • Start date Start date
W

wml

Guest
Ok, I dont quite understand this whole dummy unit thing. I read in a topic, I forgot which one but it was from dark echo I guess, and he said something about a skill that puts an AOE selection to sleep, and ryoko said you would need a AOE spell and a dummy unit to cast sleep on all the units in the facinity, and I figured if I figured out how this is possible it would let me expand ont he amount of abilities I can come up with. So please, explain this to me :D
 
You make a dummy unit, and a dummy ability.

DUMMY ABILITY:
A new custom ability based on the effect you want, with the art you want, with ZERO mana cost and cooldown time.

DUMMY UNIT:

The base unit doesn't matter too much. I use a seal.
-Delete all existing abilities, if any
-Change the model to NONE
-Change shadow to NONE
-Change the pathing to NONE.
-Add the 'Locust ability' so it can't be selected.
-Change the collision size to zero.
-Change the attacks enabled to NONE.

Now give the dummy unit the dummy ability.

When the time comes, create the dummy ability on the map near the commotion, and order the dummy unit to cast the ability, or multiple times if you like. Then remove the dummy unit from the game.
 
Could you give an example of the trigger to create and remove the dummy unit when the spell starts then when his job is done? I mean like where you cast a spell, it does what it does and when thats done its destroyed? I dont know how you would spawn a unit in the AOE region that you selected, or one where a spell you choose to cast on a unit to get the dummy to cast it on that unit and only that unit... Sorry for all the trouble just I dont know how that would work.
 
Well, I dont realy understand what you mean, but if someone could explain to me how to get a dummy unit to cast on a specificly chosen unit, or units in a AOE circle would be great...Because I would REALY like to know.
 
You'd order to it to cast the abiltiy to the unit you want to in the event. Ok so let's say your event is "Unit - A unit casts an ability" then you would make the dummy unit attack the (Target unit of abiltiy being cast). Do you get what I'm saying?
 
So what I want is...

event
unit casts ability

condition
ability = what ever ability you want it to do something special with

action
-summon unit with the custom ability....no cool down if you use a AOE cursor like with monsoon
-Cast ___ on selected units


Or would I split that into another trigger?
 
I think the dummy unit idea does not work well outside of JASS. There is no way to keep the abilities threadsafe.

ThySpektre
 
I believ you could do a triggerlike this:

Event:
A unit casts an ability
Conditions:
Ability being cast equals to (Ability you choose)
Actions:
Unit Summon (Dummy Unit)

Now the Dummy unit should have the ability and if for example you want it to cast someone that will affect a lot of targets in AOE then give it an autocast type.

There was a thread about autocast charm not long ago, better search for it
 
I wasn't very clear as to what I meant by "threadsafe".

At the end of the Dummy unit tutorial above, the last step is to remove the dummy unit you created. I don't think there is a reliable way to do this if you have multiple dummy units being cast (if one is created while you are still casting a previous spell for example).

ThySpektre
 
You really have to use local variables to make any triggered spell thread-safe (unless the trigger is absurdly simple). So yeah, you're correct about requiring JASS.
 
Sargon,

Could you point me to a good JASS manual/tutorial. I have been looking at:
http://jass.sourceforge.net/doc/ , but I do not see much in the way of built in functions that I typically see in custom scripts.

For example, the hero revival trigger I am using (based on the tutoral to the left over there) uses many functions such as GetDyingUnit(), GetHeroLevel(), etc. Do you know of anywhere that documents these functions? PolledWait() looks very interesting.

ThySpektre
 
I have no idea. All I know is vague stuff like "you need local variables for triggered spells to be thread-safe." Sorry. :P

Don't worry though, there are plenty of people here who can answer that.
 
i did this for my map

E: unit begins casting an ablility
C: ablility being cast = to (searing light)
A: set c_unit = casting unit
unit create 1 Dummy Unit for (owner of casting unit) at (c_unit)
set d_unit = last created unit
order d_unit to xxxx-slow target unit of ablility being cast
wait 2 seconds
remove d_unit
set c_unit = no unit
set d_unit = no unit
:D

~WM
 
kc102, and other map makers....

Your method wrks well if only one unit can cast an ability at a time. It may even work relatively well with multiple units if the time it takes to complete the ability is short.

However if the ability is long or even occasionally when it is short you run the risk of the variable d_unit getting overwritten by the second caster.

Do you see the 2 second wait. Assume one caster starts the ability, followed 1 second later by another. Before the 1st caster is done, d_unit gets overwritten by the second caster.

This will definately result in the 1st caster never getting removed, and may cause the 2nd spell to fail.

ThySpektre
 
ThySpektre said:
Sargon,

Could you point me to a good JASS manual/tutorial. I have been looking at:
http://jass.sourceforge.net/doc/ , but I do not see much in the way of built in functions that I typically see in custom scripts.

For example, the hero revival trigger I am using (based on the tutoral to the left over there) uses many functions such as GetDyingUnit(), GetHeroLevel(), etc. Do you know of anywhere that documents these functions? PolledWait() looks very interesting.

ThySpektre
There's no documentation, per se, but all the "native" functions (that are called by every other function) can be found here. That's GetDyingUnit, GetHeroLevel, etc.

PolledWait and co. can be found here. You can actually see the source code for these.

And you can make simple dummy caster triggers thread-safe if you just add expiration timers instead of using waits.
 
ThySpektre said:
kc102, and other map makers....

Your method wrks well if only one unit can cast an ability at a time. It may even work relatively well with multiple units if the time it takes to complete the ability is short.

However if the ability is long or even occasionally when it is short you run the risk of the variable d_unit getting overwritten by the second caster.

Do you see the 2 second wait. Assume one caster starts the ability, followed 1 second later by another. Before the 1st caster is done, d_unit gets overwritten by the second caster.

This will definately result in the 1st caster never getting removed, and may cause the 2nd spell to fail.

ThySpektre


Can't you just say:

Actions:
- Create unit blah blah blah
- Add (x second) generic expiration timer to last created unit

What are the chances another unit will be created in the less-than-nanosecond it takes for the trigger to execute the next line?

(I'm asking, not explaining)

dArKz
 
> What are the chances another unit will be created in the less-than-nanosecond it takes for the trigger to execute the next line?

Hamsteron said:
And you can make simple dummy caster triggers thread-safe if you just add expiration timers instead of using waits.


So, none, basically...
Besides, triggers that don't "wait" definitely tend to finish their actions before running again.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Hmm what to do about the World Editor site though?
  • Stephen Stephen:
    I'd rather personally just own a backup of the Nuon data than see it go to AtariAge honestly. If it gets enshittified as per usual, or if some of the "regular" Jaguar folks get there, it's not gonna be fun
  • The Helper The Helper:
    There will be a github of the forum data so the NUON Forum Data I guess would be available there
  • The Helper The Helper:
    World Editor is technically Ryoko stuff not mine you guys can keep that I am not in that even
  • jonas jonas:
    :( end of an era :(
  • The Helper The Helper:
    Dont think of it as an end jonas - think of it as a beginning, because really my friend that is what it is.
  • A Andyoyo:
    Thank you for the hard work over the years. It did not go unnoticed.
  • U Uberplayer:
    Thanks for everything!
  • XXXconanXXX XXXconanXXX:
    And we JUST got a new warcraft 3 campaign after 20 years! Bummer lol. Thanks for building and maintaining such an awesome community over the years TheHelper! Forums like these are definitely a relic of their time, and in its heyday it really was the place to be in its niche. Hopefully the discord community stays active!
  • WildTurkey WildTurkey:
    All the best helper
  • WildTurkey WildTurkey:
    Thanks for what you have done for me and my family
  • WildTurkey WildTurkey:
    I wish you all the best and am saddened to say goodbye
  • The Helper The Helper:
    That is fantastic WildTurkey I am so happy to hear that! Bless you and your family!
  • The Helper The Helper:
    and i dont think I am going to close the site it is just likely to change drastically but I am working on something for the interim still fleshing it out. Most of the forums are going to be gone though and the NUON site and Warcraft sites will probably to to different hosts. I might keep the news forum though :)
    +1
  • The Helper The Helper:
    So I paired down the forums to what is going to be in the interim
  • The Helper The Helper:
    I might also just go for one news forum and make it Headline News only all that sub forum stuff was busy work on my part i think :)
    +1
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    I know right
    +1
  • Varine Varine:
    It's been great guys, I appreciate you having kept it up for so long! I feel like this has been a big part of my growing up in life, and I do very much appreciate everything that this forum has been able to give to me. So thank you.
    +2
  • Varine Varine:
    If there's bits still around I am willing to bet I will be, but I honestly wouldn't be too upset if some of my teenager posts were to no longer be around. I was a little fucking problem back then
    +1
  • Varine Varine:
    I'm going on a backpacking trip pretty soon. I've been trying to do it for a few years now and it just couldn't happen. I'll be by myself, and I think it'll be really good for me. My pack is already too heavy so I can't bring alcohol, and that might be a benefit to me. Like had that probation and couldn't drink, but it's a bit different when you can't do something voluntarily versus threat of literal imprisonment
    +1
  • Varine Varine:
    The trail is 40 miles altogether, but I'm planning on cutting cross country a bit because I want to camp on top of this mountain. I'm bringing a little telescope, if there's still a place for it I'll post some pictures when I get back!
    +2
  • jonas jonas:
    honestly there's nothing on that trip that would become better by drinking
  • jonas jonas:
    looking forward to those pictures
  • The Helper The Helper:
    Happy Thursday people! I think I have come up with a new direction for the site. One that will never fizzle out because a game is not popular anymore. I think I am going to try to make TheHelper.net a place that helps people with real stuff as much as it did with game technical support back in the day. Stay tuned...
    +3

The Helper Discord

Members online

No members online now.

Affiliates

Hive Workshop NUON Dome World Editor Tutorials
Back
Top