• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Solved] Creating a summoner map with many different summons

Status
Not open for further replies.
Level 2
Joined
Mar 6, 2020
Messages
14
Hello guys,
this is my first post here in this forum and I hope you can help me with my problem.
I just started creating my own map using the GUI so far.

My Goal / Vision:
This will be a one vs one map. Each player owns a summoner that allows him to summon units. The summoned units then will fight against each other.
Before the battle starts, each player will be able to "purchase" summon abilities that are than learned by the summoner. I plan to have like 40 different summon abilities and each player can choose 8 different abilities.

Okay so this was just some background information for you, maybe this will help you. Now lets come to my approach. Please note again that I am a beginner.

My Approach:
So I started copying the "Inferno" ability of the undead hero 4 times (because it is the coolest summon in my opinion haha) and modified it so that it summons different units. That was easy, just change the summoned unit to something else.
Then, I gave those 4 abilities to a test summoner. I quickly noticed a problem there: Whatever ability you order the test summoner to cast, it will always cast the first inferno ability.
I quickly googled this problem and found out that this has something to do with "order string"? I did not exactly understand the problem...

1. Question: Can someone explain this problem to me?

Nevertheless, I was able to solve this problem in the following way:
I copied the ability blizzard, removed basically anything damage / status / buff related in the editor and renamed it Summon Inferno. I did the same to the ability flamestrike and renamed it Summon Golem.
I gave those two new abilities to the test summoner.
I also created two dummy units "DummyGolemCaster" and "DummyInfernoCaster" and gave them my modified inferno abilities "Golem" and "Inferno", respectively.
Then I created 2 triggers:
Code:
SummonGolem
    Events
        Unit - Summoner 0000 <gen> Begins casting an ability
    Conditions
        (Ability being cast) Equal to Summon Golem
    Actions
        Game - Display to (All players) the text: Casting summon golem
        Unit - Create 1 DummyGolemCaster for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing degrees
        Unit - Order (Last created unit) to Undead Dreadlord - Inferno (Target point of ability being cast)

What happens now is basically:
- I select the test summoner and cast "Summon Golem"
- Then a Dummy Unit is created
- The Dummy unit casts "Golem" (my modified version of the undead Inferno spell)
This basically solves the problem I mentioned above.

2. Question: Well I am actually happy with the solution, however, is there a better way to solve the problem?
3. Question: I have read that there might be problems with variables like "Last created unit" when multiple players play the game. So lets say in the worst case both the red and blue player cast Summon Golem at the same time, will this still work or will one dummy unit "survive"? And if there is a problem, how do i solve it?
4. Question: Speaking of multiple players, how do you test your map with 2 or more players?

My Doubts / Problem:
As I explained, I modified the human abilities blizzard and flamestrike so that they in the end summon a golem or inferno. I choose blizzard and flamestrike because they have this nice Area of Effect circle target selection (i hope you know what i mean, this blue UI thing^^) and I really really want this for ALL summon abilities. I mentioned in the beginning that I plan to have like 40 different spells. But i am not sure if there are enough abilities like blizzard and flamestrike in the game. And if i just make 2 copies of blizzard, I end up with the same problem as before with the 4 infernos and "order string".

5. Question: How can I make sure that I have enough AoE spells (with this nice target selection) to modify (40+)? Or is there a way to create new AoE Spells? Or is there a way to just modify another spell to have this AoE target selection?

I attached a demo map with the mentioned test summoner, dummy units and abilities. Maybe this will be helpful to you.

I know this is a long post with many questions, but you would really help me a lot answering my questions :D
Thank you so much in advance!
 

Attachments

  • demosummoner.w3m
    14.3 KB · Views: 36
Level 6
Joined
Dec 31, 2017
Messages
138
1. Because these 4 abilities share order strings. In terms of orders they are indistinguishable.

2. I suggest using Channel ability that has changable order string and targeting.
And your trigger leaks location.

3. You can use CreateUnit() function and put it's return value in a local variable via Custom script.
Function CreateUnit
 
Level 39
Joined
Feb 27, 2007
Messages
5,012
Learn how to use the Channel ability + dummy-casting the real ability you want to cast and you will never run into order problems or lack of spells to use for targeting, etc.

Triggers execute effectively instantly and no 2 triggers can run “at the same time”. A trigger can interrupt/pause another trigger if the first one does something that causes the second to fire. When the second is finished (or hits a wait action) the original trigger will be resumed. You probably don’t need to save a created unit in a local variable like Deserted suggested.

This thread explains which event responses will have problems being used after a wait: Event Response Myths
 
Level 2
Joined
Mar 6, 2020
Messages
14
Code:
SummonArchers
    Events
        Unit - A unit Begins casting an ability
    Conditions
        Or - Any (Conditions) are true
            Conditions
                (Ability being cast) Equal to 002 Summon Archers 
                (Ability being cast) Equal to 202 Summon Archers 
    Actions
        Game - Display to (All players) the text: Casting summon arch...
        Set VariableSet loc = (Position of (Triggering unit))
        Unit - Create 1 DummyArcherCaster for (Owner of (Triggering unit)) at loc facing Default building facing degrees
        Custom script:   call RemoveLocation(udg_loc)
        Set VariableSet loc = (Target point of ability being cast)
        Unit - Order (Last created unit) to Orc Shadow Hunter - Serpent Ward loc
        Custom script:   call RemoveLocation(udg_loc)

so now it does not leak?
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,537
Correct, that no longer leaks. And I'd recommend using "A unit starts the effect of an ability" as the Event. Test this to see for yourself, begins casting can be abused by the player by issuing the order to cast the ability and then immediately pressing Stop. The Archers will be summoned but the ability won't go on cooldown/spend mana.

If you wish for your summoning unit to cast the spell faster (without the cast animation delay), you can change it's Art - Animation - Cast Backswing and Art - Animation - Cast Point to 0 in the Object Editor. This will make a unit skip animations and cast the spell as fast as possible. This same system is used in attacks as well (Attack backswing).
 
Last edited:
Status
Not open for further replies.
Top