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

Triggered spell conflict

Status
Not open for further replies.
Level 2
Joined
Sep 19, 2008
Messages
25
I've gotten comfortable using channel for all of my custom spells. The problem I am running into, however, is that I'm not sure what to do when I need to use another spell to assist the triggers. I've set up a spell that is much like berserk, increase attack speed, decrease movement speed. Seeing as I can't modify attack speed directly through triggers, what is the best way to give a unit the effects of a spell, without actually giving them that spell.

I'm trying to avoid using spells that would conflict later on because of base spell IDs. Thanks for any help! :)
 
Level 2
Joined
Sep 19, 2008
Messages
25
Haha I've never really had to use a dummy unit for a spell and completely forgot! Thanks very much! That solves everything! +rep

So what determines if a spell will show up under the list of spells, located under the "Unit - Issue Order Targeting a Unit" action in the trigger editor?
 
Last edited by a moderator:
Level 6
Joined
Jul 25, 2005
Messages
221
The list of spells are all there. All custom spells use the same "casting method", look it up in the abilites tab:
Text - Order String - Use/Turn On

This decides what order string it is using. For example, you can create a cripple spell, change order string to "holybolt", now, to make it into an order, your "Unit - Issue Order Targeting a Unit" will have to be Human Paladin - Holy Light , for it to be able to work. Hope it was understandable. :)

Also, you can't create your order string. Unless you mess with the code around WE...
 
Level 2
Joined
Sep 19, 2008
Messages
25
So it sounds like the list is concrete, and whatever spell I create, I should change the use/turn on string to something in that list. What would I do if I needed to make more spells than are in that list? Just don't want to start working on it and come to that horrible realization that I screwed up :S thanks :)
 
Level 6
Joined
Jul 25, 2005
Messages
221
Don't worry, you can at most use 9 order strings per unit(unless you have 9 spell books, then its 10*8=80 spells), and there are alot more than 9 of those orders.
So, think of it instead as: 1 unit has 9 spells, each spell need to have its own order string. Otherwise when you order it through a trigger, both will be cast(just one) (and both will trigger a cooldown). Then you can simply add, oh say, 3 of those spells to another unit, and add additional spells that doesn't have their order strings.

It does give some limitation, but the usual amount of spells per unit is 4-5, so, again, no worries.
 
Level 2
Joined
Sep 19, 2008
Messages
25
Ok cool. I wasn't sure if two custom spells had the same order string, even though I didn't give the dummy those abilities, that they would both cast, regardless of whether the dummy had the abilities or not. I think that makes sense. Let me know if I should clarify. I gave you rep :)
 
Level 6
Joined
Jul 25, 2005
Messages
221
Be sure to check out the "Channel" spell, the one spell that blizzard prepared for map editors, it allows you to change almost any attribute a spell has. It's perfect for dummy casters, as well as general custom spells.

It's under Neutral Hostile - Heroes
 
Level 2
Joined
Sep 19, 2008
Messages
25
I must have made my dummy unit wrong because I've gotten my spell to trigger, create the dummy, assign the ability, and set its level, but it won't cast it. I've made sure to set the order strings accordingly. Not sure what else could be causing this, any other things I should double check?

  • Spear Frenzy
    • Events
      • Unit - A unit Begins channeling an ability
      • Unit - A unit Begins casting an ability
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Spear Frenzy
    • Actions
      • Set LocCaster = (Position of (Casting unit))
      • Unit - Create 1 Dummy Unit for (Owner of (Casting unit)) at (LocCaster offset by (20.00, 0.00)) facing Default building facing degrees
      • Unit - Add Spear Frenzy 1 (DUMMY) to (Last created unit)
      • Unit - Set level of Spear Frenzy 1 (DUMMY) for (Last created unit) to 2
      • Unit - Order (Last created unit) to Human Peasant - Repair (Casting unit)
      • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation(udg_LocCaster)
How do I get nicer looking image of the actual trigger in my post?
 
Last edited:
Level 6
Joined
Jul 25, 2005
Messages
221
A great way of testing this, by yourself, is making the dummy unit like a normal unit. That way you can see what goes wrong, like, the spell costs mana, short of range, anything that might be simple mistakes. If it all checks out, then try playing with different order strings.

Oh, if you want to make it in trigger code, just add these [ trigger ] [ /trigger ] (without spaces)
 
Level 2
Joined
Sep 19, 2008
Messages
25
Well, I just gave the dummy unholy frenzy and made that the order string as well for the custom ability. He casts both abilities fine when i order him myself, but he ever casts unholy frenzy through the triggers. So I think I've narrowed it down to something being messed up with the order strings somehow.
 
Level 9
Joined
Oct 17, 2007
Messages
547
Make sure the mana is 0, the cool down is 0 and check the target types again make sure its possible to cast it on your own units. I would just use the orginal order string of the spell since the dummy unit will only know 1 ability anyways.
 
Level 2
Joined
Sep 19, 2008
Messages
25
Well I've tried everything! I'll have to come back to it tomorrow. I made Unholy Frenzy and the custom spell nearly identical, but nothing works. Not sure what else I can do. :(

Well, I can't use the original order string because it isn't in the list of order types in the trigger. The normal unholy frenzy works fine, but as closely as I have replicated it, it just won't seem to work. I'll try putting a test map together tomorrow and maybe see if its something with the map.

Well, I made a test map and still nothing. I'll let anyone that wants to putz around with it to do so.

http://files.filefront.com/Dummy+Unit+Problem+Mapw3x/;13686944;/fileinfo.html
 
Last edited by a moderator:
Level 6
Joined
Sep 13, 2008
Messages
261
Get rid of these three events
  • Unit - A unit Begins channeling an ability
  • Unit - A unit Begins casting an ability
  • Unit - A unit Starts the effect of an ability
just use
  • Unit - A unit Starts the effect of an ability
I'm not downloading your map because you used filefront. You can attach a map to your post here.

And use trigger tags it will improve your chances of a good response. Just post back if this doesn't fix it. With map attached.
 
Level 2
Joined
Sep 19, 2008
Messages
25
Alright, here is the trigger with tags:
  • Spear Frenzy
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Spear Frenzy
    • Actions
      • Set LocCaster = (Position of (Casting unit))
      • Unit - Create 1 Dummy Unit for (Owner of (Casting unit)) at (LocCaster offset by (150.00, 150.00)) facing Default building facing degrees
      • Unit - Add Spear Frenzy (DUMMY) to (Last created unit)
      • Unit - Set level of Spear Frenzy (DUMMY) for (Last created unit) to 1
      • Unit - Order (Last created unit) to Undead Necromancer - Unholy Frenzy (Casting unit)
      • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation(udg_LocCaster)
And the map is also attached. Thanks for the tips Howl2000 :)
 

Attachments

  • Dummy Unit Problem Map.w3x
    41 KB · Views: 34
Level 6
Joined
Jul 25, 2005
Messages
221
Hm, what dummy unit are you using, because some units have a longer "casting" animation, you can set the casting animation delay to 0, its under the unit tab. Other than that, try to increase the expiration timer's time. What else...? eh... Try a simple trigger where after a certain amount of elapsed time it will be ordered to cast the spell. Might have to do with how you refer to you dummy target.

Edit: Aha, ok, so apparently, even though you change the order string, it remains as the base order string, very odd, maybe has to do with NewGen? Can anyone confirm this pls, or explain why it isn't working with: changing base order string

I don't know, anyway, here is a working spell for you.

And, if you dont wanna open it, here's a sneakpeak

  • DummySpell
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Spear Frenzy
    • Actions
      • Set pCaster = (Position of (Triggering unit))
      • Set uCaster = (Triggering unit)
      • Unit - Create 1 Dummy {Caster} for (Owner of uCaster) at pCaster facing (Position of uCaster)
      • Set uDummy = (Last created unit)
      • Unit - Add Dummy Spell [A001] to uDummy
      • Unit - Set level of Dummy Spell [A001] for uDummy to (Level of Spear Frenzy for uCaster)
      • Unit - Order uDummy to Undead Necromancer - Cripple uCaster
      • Unit - Remove uDummy from the game
      • Custom script: call RemoveLocation(udg_pCaster)
What makes you able to remove the unit directly after ordering it to cast? Easy: Art - Animation - Cast Backswing = 0!
This makes the unit ignore the spell animation and casts it directly, perfect for a dummy!

I based the dummy caster's spell on Undead Cripple, and used Channel as base spell for the hero,
the reason why I didn't use Channel for the dummy is because, well, I don't know how to apply a buff to it. EVEN IF I apply a buff to it, it doesn't appear. Anyone want to explain this phenomena, or should I just search forum/google? XD
 

Attachments

  • Spear Frenzy.w3x
    18.9 KB · Views: 45
Last edited:
Level 2
Joined
Sep 19, 2008
Messages
25
Still nothing. Tried animation time, removed the generic expiration, and also tried waiting two seconds and then having it cast (making sure to assign last created unit to a variable since there is a wait period). Wow this is getting really hectic! I had a whole line of spells to start working on, but I don't want to get to far in until I can get my dummy successfully working.

I still think it is order string related seeing as how the original spell that the string is associated with, works fine when substituted in for the custom spell.

PS: Haha, I just figured out what a double post is! This whole time I thought a double post meant when you have two posts of the exact same message, like you see sometimes with weird connections. Sorry about that, I'll make sure that never happens again :)

ShadowMan: so that means I will be limited to the effects that are changeable in that base spell? I did find something weird where a rifleman couldn't case unholy frenzy, however, a necromancer or a spellbreaker could :S Is NewGen just acting weird?
 
Last edited:
Level 6
Joined
Jul 25, 2005
Messages
221
As far as I know, the NewGen messes with everything, so this might be one of those things. I haven't tested in the normal WE though, so I can't be sure, and I can't be arsed to take a look either... :p

But, for now, just copy and paste a different spell each time you need a new one for a new unit.
 
Level 2
Joined
Sep 19, 2008
Messages
25
Well, I'll look into some alternatives when I have some free time. I got the idea of maybe giving the dummy an item that has an ability, and doing it that way. Maybe put the ability in the item and use "Hero - Use item on a Unit", not sure if it would work or not.

NewGen does let you set an abilities code tag like A001, but not the extension (A001:acri). I guess the only obstacle I'm facing right now is possibly not being able to find a spell in that list that will do what I need, but I think they should work. I'll look further into that item spell idea and see if that turns up anything useful.
 
Level 6
Joined
Sep 13, 2008
Messages
261
I tested it only changed a few things and it worked fine. I use newgen with all the features on. I turned up the cripple speed so i could see easier.

  • DummySpell
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to (==) Spear Frenzy
    • Actions
      • Set pCaster = (Position of (Casting unit))
      • Set uCaster = (Casting unit)
      • Unit - Create 1 Dummy {Caster for (Owner of uCaster) at pCaster facing (Position of uCaster)
      • Set uDummy = (Last created unit)
      • Unit - Add a 5.00 second Generic expiration timer to uDummy
      • Unit - Add Dummy Spell [A001] to uDummy
      • Unit - Set level of Dummy Spell [A001] for uDummy to (Level of Spear Frenzy for uCaster)
      • Unit - Order uDummy to Undead Necromancer - Cripple uCaster
      • Custom script: call RemoveLocation(udg_pCaster)
gave it a exp timer with plenty of time. and changed it from triggering unit to casting unit.
 
Last edited:
Level 2
Joined
Sep 19, 2008
Messages
25
Thanks everyone! I think you've found the solution. I'm just curious though, are other people able to assign order strings to their dummy spell, even if they aren't using the respective base spell? Just asking because it seems like most tutorials on creating dummy units and spells, don't really make note of this.

  • Special Effect - Create a special effect attached to the weapon left of uCaster using Abilities\Weapons\LordofFlameMissile\LordofFlameMissile.mdl
  • Set eAttachment1 = (Last created special effect)
  • Special Effect - Create a special effect attached to the weapon right of uCaster using Abilities\Weapons\LordofFlameMissile\LordofFlameMissile.mdl
  • Set eAttachment2 = (Last created special effect)
  • Wait 6.00 seconds
  • Special Effect - Destroy eAttachment1
  • Special Effect - Destroy eAttachment2
I was doing this exact same thing through the buff, but it won't allow me successfully attach to those points, even though it works perfect through triggers. I was just wondering if this was the only way or if there is a better way of doing this. Thanks :)
 
Last edited:
Level 6
Joined
Sep 13, 2008
Messages
261
I do believe you can change the ability order string on channel to whatever you want. On the rest of the abilities im not so sure.


If you want to attach things to a unit modify the ability "sphere". It lets you attach things to the chosen locations. If you use search I'm sure there's a guide to this.
 
Level 6
Joined
Jul 25, 2005
Messages
221
I tested it only changed a few things and it worked fine. I use newgen with all the features on. I turned up the cripple speed so i could see easier.

  • DummySpell
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to (==) Spear Frenzy
    • Actions
      • Set pCaster = (Position of (Casting unit))
      • Set uCaster = (Casting unit)
      • Unit - Create 1 Dummy {Caster for (Owner of uCaster) at pCaster facing (Position of uCaster)
      • Set uDummy = (Last created unit)
      • Unit - Add a 5.00 second Generic expiration timer to uDummy
      • Unit - Add Dummy Spell [A001] to uDummy
      • Unit - Set level of Dummy Spell [A001] for uDummy to (Level of Spear Frenzy for uCaster)
      • Unit - Order uDummy to Undead Necromancer - Cripple uCaster
      • Custom script: call RemoveLocation(udg_pCaster)
gave it a exp timer with plenty of time. and changed it from triggering unit to casting unit.

Actually, this code is bad. Casting Unit = Triggering Unit, thus triggering unit is a faster way to refer to the caster, and an expiration timer isn't needed when your dummy target has 0 cast animation delay. The code you supplied works, but is not as efficient as the first one.
 
Level 2
Joined
Sep 19, 2008
Messages
25
Well, I found the culprit! I guess using the alternate model of a unit only allows you to use overhead and origin points when using attachment points. I really liked the headhunter's alternate model, but I'm fine with the normal one. Thanks again Howl2000 :)
 
Level 6
Joined
Jul 25, 2005
Messages
221
Eh, to use the headhunter's alternate model, make sure you change the field that says:
Art - Model File - Extra Versions, in the unit tab, and check the "frozen throne" box. This allows you to use that model, instead of the RoC one. You don't need a sphere for that? I don't quite follow your reasoning here... :p
But yes, sphere is a good way to attach cool effects without triggering.
 
Level 2
Joined
Sep 19, 2008
Messages
25
I managed to figure it out! I needed to put alternate into all the other "Art - Required" fields. Oh, for attachments that only last as long as the spell, I just used a buff on the dummy spell so there is no need for triggers at all! Everything is working perfectly now! Thanks again for everyones help! Let me know if I forgot to add rep for anyone :)
 
Status
Not open for further replies.
Top