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

[Spell] First Success+Questions

Status
Not open for further replies.
Level 2
Joined
Jun 8, 2018
Messages
13
Hello.
First, I want to thank all of you again.
For the warm welcome, and all the help so far.

And I want to not only share the problems (and the suffering ;D ),
but also the joy. The joy in learning thins, and stuff working out.

For most of you it might be quite trivial, but for me it was a success :)
I´ve created my first properly working spell using GUI, using a lot of information from this tutorial:
"Basics of Trigger Enhancing Spells" - great stuff


I got inspired by the concept that you create dummy units anyway, and made a visible dummy for my buff.
The basic idea: My hero (SuperGrunt) uses his ChooBL! spell to creata a visible priest behind him that applies a "inner Fire" buff.


Code:
Spell Blessing
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to ChoooBL! 
    Actions
        Unit - Create 1 BlessingPriest for (Owner of (Triggering unit)) at ((Position of (Triggering unit)) offset by 400.00 towards ((Facing of (Triggering unit)) + 180.00) degrees) facing (Position - Z of (Casting unit)) degrees
        Unit - Make (Last created unit) Invulnerable
        Unit - Add BlessingInnerFire (Neutral Hostile) to (Last created unit)
        Unit - Set level of BlessingInnerFire (Neutral Hostile) for (Last created unit) to (Level of ChoooBL!  for (Triggering unit))
        Unit - Order (Last created unit) to Human Priest - Inner Fire (Triggering unit)
        Wait 2.00 seconds
        Unit - Remove (Last created unit) from the game
        -------- "SuperGrunt" is the Hero; "ChooooBL!!" is the spell; "BlessingPriest" is kind of a dummy Unit that has the custom spell"Blessing" --------

Excuse the dull names, just doing a map where I am testing a ton of stuff :)

I am very proud that i managed to figure out how to ensure the priest is always spawning behind the hero ^^


First question:
I do know about the function giving the Unit an expiration timer. The Problam witht that is that the priest dies (death animation and sound) after the expiration timer, and i dont want that. So i solved it with the remove from the game.
Is this a good solution, or can i somehow get rid of death animation and sound? And why is the expiration timer the way to go usually (tutorial said so)?

Second Question:
I made the unit invulnerable, because as it is a visible unit, i dont want it to interact with other units (absorbing attacks etc.) Is this a good idea? And isn´t that also a concern for normal dummy units? Cantg they get killed by a AOE spell?

Third Question:
I would like the Priest(and in future some otehr units that i want to applie buffs the same way) to appear as a Ghost/Spirit kind of thing. see Model file: Antonidas; Khel Thuzad(Ghost); Ghost (Keeper ghost frome nelf campaign units).
Is there a way, to applie this ghostly form to any unit? Or is it just another model file?
Else maybe etheral form would do a sufficient job, i hope i find a trigger for it, didn´t check on that yet though.

Fourth Question: (for another spell- Bash applying a thunderclap slow)
In the tutorial I learned that for passive, you can use as a dummySpell a passive that does nothing, and trigger the chance of the event and all the effects.
I guess there would be a way, so I can use the normal bash, and just add the slow via trigger.
Would this be better (in the sense of less triggers/code is generally better)? And can it be done (checking somehow when bash is hitting)



Thanks in advance,
best regards,
Cookie
 
Level 9
Joined
Apr 23, 2011
Messages
527
1. Removing the unit is good enough. Expiration timers are used to give the dummy more than enough time to do its work. Usually used in spells with loops. Since you use a wait before removing the unit, I would recommend using an expiration timer and use another trigger that removes units of type BlessingPriest instantly on death.

2. Dummy units usually have the Locust and Invulnerable abilities, meaning they can't be interacted with, at all, in-game.

3. Use the Animation - Set Unit Color Vertex (something along those words) action and change the transparency of the unit.

4. That method works with a damage detection system, but seeing as the effect is triggered on-attack, I would use the Orb of Lightning ability and change its Data - Ability to Thunderclap, so I don't need triggers.

Use [trigger][/trigger] for GUI code.

By the way, your point (Position of (Triggering unit)) leaks. Use a variable beforehand and use a custom script to remove it. See tutorials on Memory Leaks to know what they are and why they are necessary to be removed.

  • Spell Blessing
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to ChoooBL!
    • Actions
      • Set loc = (Position of (Triggering unit))
      • Set loc2 = (loc offset by 400.00 towards ((Facing of (Triggering unit)) + 180.00) degrees
      • Unit - Create 1 BlessingPriest for (Owner of (Triggering unit)) at loc2 facing Default building facing degrees
      • Unit - Make (Last created unit) Invulnerable
      • Unit - Add BlessingInnerFire (Neutral Hostile) to (Last created unit)
      • Unit - Set level of BlessingInnerFire (Neutral Hostile) for (Last created unit) to (Level of ChoooBL! for (Triggering unit))
      • Unit - Order (Last created unit) to Human Priest - Inner Fire (Triggering unit)
      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation(udg_loc)
      • Custom script: call RemoveLocation(udg_loc2)
 
Level 2
Joined
Jun 8, 2018
Messages
13
Thanks a lot man,
you are a great guy.


"By the way, your point (Position of (Triggering unit)) leaks. Use a variable beforehand and use a custom script to remove it. See tutorials on Memory Leaks to know what they are and why they are necessary to be removed."

Thanks, I did already read about it. Does (Position of (Triggering unit)) always leaks, or just the way I used it?
Maybe you can check my new code, if it is fine now?

  • Spell Blessing
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to ChoooBL!
    • Actions
      • Set loc1 = (Position of (Triggering unit))
      • Set loc2 = (loc1 offset by 400.00 towards ((Facing of (Triggering unit)) + 180.00) degrees)
      • Unit - Create 1 BlessingPriest for (Triggering player) at loc2 facing loc1
      • Animation - Change (Last created unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 70.00% transparency
      • Unit - Add BlessingInnerFire (Neutral Hostile) to (Last created unit)
      • Unit - Set level of BlessingInnerFire (Neutral Hostile) for (Last created unit) to (Level of ChoooBL! for (Triggering unit))
      • Unit - Order (Last created unit) to Human Priest - Inner Fire (Triggering unit)
      • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation(udg_loc1)
      • Custom script: call RemoveLocation(udg_loc2)
      • -------- "SuperGrunt" is the Hero; "ChooooBL!!" is the spell; "BlessingPriest" is kind of a dummy Unit that has the custom spell"Blessing" --------
Thanks for all the answers, nearly everything worked out fine. :D
But not the last (nr.4) one :(

Played around with it for quite some time now. This is my conclusion.
I got a ton of problems at first, but I could solve most of them.

1) What I could not make work, was that not all "Data - Ability" Abilitys work:
Working- all single target spells (slow, finger of pain, cyclone...); and "point and click cone aoe" (shockwave, carrion swarm, breath of fire)
Not Working- all AoE that is self activate (war stomp, thunder clap...) and aoe target (blizzard, flamestrike...)


Base Spells (for the orb ability) I could use now: (Plan was: x% on attack deal x bonus dmg and apply a slow fo x sec)

Slow: Pro: Able to change the Sow duration + Slow amount!!!
Con: No bonus dmg on attack possible, would have to do flat bonus dmg with the orb effect

Frost Nova: Pro: Flexible dmg bonus for single target + AoE Slow and Dmg possible
Con: Slow amount is in the Gamplay Constants (Spells - Frost Attack Speed Reduction 0.25 , Spells - Frost Attack Speed Reduction 0.5), so i dont want to change it.

2) Using the Orb of Lightning ability creates another Problem:
The Ability Icon used in the Research menu is the one from the Orb Ability, but the Ability that is showed in the normal Hero comand menu is the Icon of the "Data - Ability" Ability. Sure I can change it to be the same, but it is always greyed out, like an Ability that cannot be used (even for passives), although they work properly. Can I get rid of that?

And I guess the the Spell level is not applied to the Data- Ability, is there a way to do it, or do I just have to create 3 different abilitys for that?


Thanks in advance,
best regards
Cookie
 
Level 17
Joined
Mar 21, 2011
Messages
1,611
Removing Unit after x seconds vs expiration timer:

Very simple, you can get rid of your wait action, which is always good.

The orb of lightning has some downsides. As you mentioned, the icon is greyed out. Another problem is that it ONLY triggers if you gave your unit an attack order. If your unit automatically attacks a target cause of aggro range, it wont fire.

I'd suggest you to look at Bribe's Damage Engine in the spell section, it is very simple to use and gives you several solutions for your problem
 
Status
Not open for further replies.
Top