• 🏆 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!

Need help with a spell

Status
Not open for further replies.
Level 3
Joined
Jul 23, 2020
Messages
39
Hi, I hope my question is at the right place and don't belong to the trigger discussion since I simply wanted to modify a spell to summon a unit. The point is the unit should be there for only one minute (typical for most summoned units, except Archimondes portal), But it should spawn at a point of my choice (similar to Archimondes portal) and the unit should automatically be attacked by surrounding units, while itself being not able to cause damage (like the mirror spell). And the region where I want the unit to appear has to be discovered first (similar to blink-spell of Maiev). Is that possible or do I need to develope such a spell myself? I'm sorry, but so far I just modified what the object editor allows me to do and I have no experience with more complicated programming. So if you have an idea could you please tell me keeping that in mind? Thanks in advance!
 
Level 12
Joined
Feb 5, 2018
Messages
521
For the summoned unit you summon, just adjust stats: can flee: false and attacks enabled: none. Or if you want the unit to attack you can just change its damage to 1.

IF you want to avoid triggers completely, you can add taunt to the summoned and manually order it to cast it.
 
Level 24
Joined
Feb 9, 2009
Messages
1,787
  • Example Summon
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • ((Target point of ability being cast) is visible to (Triggering player)) Equal to True
      • (Ability being cast) Equal to Your Spell
    • Actions
      • Set Point[0] = (Target point of ability being cast)
      • Unit - Create 1 Footman for (Triggering player) at Point[0] facing (Facing of (Triggering unit)) degrees
      • Unit - Add classification of Summoned to (Last created unit)
      • Unit - Add a 60.00 second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation(udg_Point[0])
Note the classification is necessary if you want dispel, purge, and control summon to have their interactions with summons.

And as @DoomBlade mentioned you can modify the stats of the chosen unit, however, if you have your preferences in the editor set to allow for negative values you can hold (Shift) and modify the unit's base damage to be -1 (along with number of sides & dice being "1") to effectively have 0 damage.

Also for more advanced take you can try this, but this requires knowledge of dummy units, to which this tutorial I'd highly recommend.
  • Illusions
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • ((Target point of ability being cast) is visible to (Triggering player)) Equal to True
      • (Ability being cast) Equal to Your targeted spell
    • Actions
      • Set Point[0] = (Target point of ability being cast)
      • Set Unit[0] = (Triggering unit)
      • Set Point[1] = (Position of Unit[0])
      • Unit - Create 1 Caster Dummy Unit for (Triggering player) at Point[0] facing (Facing of (Triggering unit)) degrees
      • Set Unit[1] = (Last created unit)
      • Unit - Add item illusions to (Last created unit)
      • Ability - Set Ability: (Unit: Unit[1]'s Ability with Ability Code: item illusions )'s Real Level Field: Area of Effect ('aare') of Level: 0 to (Distance between Point[0] and Point[1])
      • Custom script: call IssueTargetOrderById( udg_Unit[1] , 852274 , udg_Unit[0] )
      • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation(udg_Point[0])
      • Custom script: call RemoveLocation(udg_Point[1])
 
Last edited:
Level 19
Joined
Feb 27, 2019
Messages
589
Youll need to know how to use a Dummy Spell/Dummy Ability.

Perheaps Blink as you mentioned will be good to use for that Dummy Ability since it naturally cant target undiscovered areas. Remove Art - Area Effect and Art - Special, Set Maximum Range to 1.000, Set Minimum Range to 0 and Cast Range as far as it can be cast.

If you use Blink as the Dummy Ability the first condition in Devaults first trigger is not required.
 
Level 3
Joined
Jul 23, 2020
Messages
39
Wow, thanks to all of you for your advice! My best result was to modify Rokhans Greater Serpent Totem,
but I could still target undiscovered area. So now I have good ideas for the triggers and will try them out.
Will post my result later...
Thanks again!
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,534
A neat idea that comes to mind is to use Warden's Blink as the base ability, this way you get the "Must target an Explored area" error message when targeting the fog of war.

Then interrupt the spell cast by pausing/unpausing the caster, preventing it from teleporting to the targeted point.

The trigger would look like this:
  • Example
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • Ability being cast Equal to YourBlinkAbility
    • Actions
      • Set VariableSet Point = (Target point of ability being cast)
      • Unit - Create 1 SummonUnit for (Triggering player) at Point facing Default building facing degrees
      • Custom script: call RemoveLocation (udg_Point)
      • Unit - Add a 60.00 second Generic expiration timer to (Last created unit)
      • Unit - Order (Last created unit) to Night Elf Mountain Giant - Taunt.
      • Unit - Pause (Triggering unit)
      • Unit - Unpause (Triggering unit)
And you can order your summoned unit to cast Taunt to aggro the nearby enemies, just make sure it actually has the ability in the first place. Or use the "Pick every unit" function to get nearby enemy units and order them to attack it.
 

Attachments

  • Blink Summon Example.w3m
    16.5 KB · Views: 18
Level 3
Joined
Jul 23, 2020
Messages
39
After some tries some more questions: The triggers work fine, but I have to make my own ability. Now I already uses up
the silence ability to create an alternative spell which works fine for me, so I want to leave it untouched. Using "blink"
however makes my hero jump to the target and I don't know how to inactivate the original ability...
If these abilities can't be inactivated, any idea which basic spell is the best to modify if I want to target a point/area?
Also my trigger works now only in discovered area and I generated floating text in case the area is undiscovered that
this has to be done first. However, the spell costs mana (100) and I thought in this case I should give the mana back
to the triggering unit. However, using arithmetic I can only
>Set mana of "triggering unit" to ((Percentage mana of ("triggering unit)) + 100)<
which somehow does not work. How can I change "percentage mana" to the current mana of my triggering unit?
Or did I miss the possibility to simply "add 100 mana" somewhere? Sorry for asking such probably easy questions,
but I have not so much experience with triggers and have to figure many things out...
 
Level 3
Joined
Jul 23, 2020
Messages
39
Oh, I just realized that meanwhile there was another help advice from Uncle. I will try this now!
But I still could need some advice how to pay 100 Mana back...
 
Level 12
Joined
Feb 5, 2018
Messages
521
This is how you can set mana:

  • Unit - Set mana of (Triggering unit) to ((Mana of (Triggering unit)) + 100.00)
Best skill to modify is channel. It does absolutely nothing without triggers, except for effects. You can make it point target. == For your future mapping :)

In all honesty, trying to make anything or near anything without triggers is just impossible.
 
Level 3
Joined
Jul 23, 2020
Messages
39
Update: well, my triggering unit stopped teleporting - Thanks Uncle!
Unfortunately I can't load your map because of "Level-Info-Data missing or invalid"
So I have discovered another issue with blink, which does not allow me to extend the
range of my spell to infinity (even when setting the spell rage to 99999, which worked fine
with Rokhans Greater Serpent Totem which I replaces with my unit. Works actually best so far
with the exception that I can target undiscovered regions...
 
Level 3
Joined
Jul 23, 2020
Messages
39
To DoomBlade: Actually you are right with the triggers. Those of Devalut are a good example. Just you
need to know where to find it... So I still don't know how you made your trigger:
Unit offers two choices: Set mana to value or percentage. I guess it is "value" we need
Now I have to convert 0.00 into a function and now I'm lost: I find only: "Unit - Percentage Mana"
and stucked there before, even when using "arithmetic", because I don't know how to change the first "1.0"
You see, it is easy if you know how to handel the triggers, but for me it is still challeging (but willing to learn
of course). So PLEASE tell me your trick and where to find the correct expression...
 
Level 12
Joined
Feb 5, 2018
Messages
521
To DoomBlade: Actually you are right with the triggers. Those of Devalut are a good example. Just you
need to know where to find it... So I still don't know how you made your trigger:
Unit offers two choices: Set mana to value or percentage. I guess it is "value" we need
Now I have to convert 0.00 into a function and now I'm lost: I find only: "Unit - Percentage Mana"
and stucked there before, even when using "arithmetic", because I don't know how to change the first "1.0"
You see, it is easy if you know how to handel the triggers, but for me it is still challeging (but willing to learn
of course). So PLEASE tell me your trick and where to find the correct expression...

Alright so:
1) In your trigger new action
2) Use the search to find unit mana
3) How to create the trigger

You pick the set mana of unit (not the percentage one)
Then you create it set mana of (your unit) to value arithmetic.

Click the 1.0 and change it to unit - property mana of unit
Click the second 1.0 and change it to 100

You always have to plus the mana of unit with mana of unit + value, or it will simply set it's mana to incorrect value.

Hope this helps! :)
 
Level 3
Joined
Jul 23, 2020
Messages
39
Property! That's it! And it helped a lot! Thanks DoomBlade! Already learned a lot today. Hopefully there will be some comments how to inactivate the original function of spells as well. I'd like to know if it is possible to set the summoned unit # to zero, so I can use triggers instead. I start to love triggers!!!
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,534
Update: well, my triggering unit stopped teleporting - Thanks Uncle!
Unfortunately I can't load your map because of "Level-Info-Data missing or invalid"
So I have discovered another issue with blink, which does not allow me to extend the
range of my spell to infinity (even when setting the spell rage to 99999, which worked fine
with Rokhans Greater Serpent Totem which I replaces with my unit. Works actually best so far
with the exception that I can target undiscovered regions...
Did you adjust the maximum range field? See the attached picture.

Also, if you hold shift while clicking (opening) a value you can edit it beyond the normal limitations. This also allows for negative values, such as giving Devotion Aura a negative armor bonus so it reduces armor instead of adding it (useful for negative enemy auras). Make sure that these settings are enabled, see my "settings" picture.
 

Attachments

  • ex.png
    ex.png
    533.1 KB · Views: 27
  • settings.png
    settings.png
    2.2 MB · Views: 26
Last edited:
Level 3
Joined
Jul 23, 2020
Messages
39
Hi Uncle, help again needed. I managed to extend the range of my spell (based on blink) as
[db]east suggested and now suddenly my trigger is triggered so often, that there
are hundreds of my unit. I could stop this by setting the duration of Hero and normal
to zero, but then my casting unit is suddenly located at the map center! I guess there
must be simply some time passing by so the pause / unpause triggers of uncle can work.
Also the trigger of DoomBlade to add 100 Mana does not work (either with "triggering unit"
or "casting unit"). But when I trigger "remove casting unit", it works...
 
Level 12
Joined
Feb 5, 2018
Messages
521
Can you paste your triggers here? In the trigger editor right click the trigger name. Choose "copy as text"

Then write [.Trigger] Paste text here [/.Trigger] Without the dots.
 
Level 3
Joined
Jul 23, 2020
Messages
39
Hi Uncle, well it is not completely sam as your, but have a look:
upload_2020-8-27_18-50-44.png

I don't need Taunt anymore since I add that to my unit a standard ability and the computer happily attacks it...
The sounds I often use a control for me (and for fun) and it is played twice when all the units appear...
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,534
Hi Uncle, well it is not completely sam as your, but have a look:View attachment 362844
I don't need Taunt anymore since I add that to my unit a standard ability and the computer happily attacks it...
The sounds I often use a control for me (and for fun) and it is played twice when all the units appear...
Try doing exactly what I did. The Blink ability makes the If Then Else unneeded, since it handles the visibility stuff on it's own. That's the whole point of using it :p

Of course you can add your Sound and remove the Taunt stuff as well.

  • Example
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Blink
    • Actions
      • Sound - Play YourSound
      • Set Variable TempPoint = (Target point of ability being cast)
      • Unit - Create 1 SummonUnit for (Triggering player) at TempPoint facing Default building facing degrees
      • Custom script: call RemoveLocation (udg_TempPoint)
      • Unit - Add a 60.00 second Generic expiration timer to (Last created unit)
      • Unit - Pause (Triggering unit)
      • Unit - Unpause (Triggering unit)
TempPoint is a Point variable, make sure to create it in the Variable Editor (Control + B).
 

Attachments

  • ex.png
    ex.png
    513.4 KB · Views: 27
Last edited:
Level 3
Joined
Jul 23, 2020
Messages
39
I tried to follod DoomBlades advice, but in my editor version 1.27 (6059) - there is no "copy as text"
I can convert into text, but a screen capture is probably better. Also you see it is in German, sorry for that...
 
Level 3
Joined
Jul 23, 2020
Messages
39
Ok Uncle, I did it this way, because "custom skript" did not work (somethins like name expected error) I had to skip that part

upload_2020-8-27_19-12-20.png

This did not help, again hundreds of units appearing. A little tiresome. Also is there really need to use a variable if I can select "target point if ability being cast" directly?
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,534
Ok Uncle, I did it this way, because "custom skript" did not work (somethins like name expected error) I had to skip that part

View attachment 362846
This did not help, again hundreds of units appearing. A little tiresome.

Also is there really need to use a variable if I can select "target point if ability being cast" directly?
Is your Event the same? I'm using "Starts the effect of an ability". I think you're using "Begins casting an ability" which is much different!

Also, the Custom Script is case sensitive and references the name of the variable you created. I named my Point variable "TempPoint" so I had to reference it as "udg_TempPoint" in the Custom Script.

When I say do exactly what I did, I really mean EXACTLY :p So if your variable is called "point", you need to reference "point" in the Custom script.
  • Custom script: call RemoveLocation (udg_point)
Note that "udg_" is a prefix that you need to type before referencing a global variable in Custom script.

The Point variable prevents a Memory Leak, so it's good practice in doing so. Warcraft 3 triggering is plagued by these leaks, but it's not too difficult to clean them up. See -> Things That Leak
 
Last edited:
Level 3
Joined
Jul 23, 2020
Messages
39
You have a good eye Uncle! I managed to finish my first "Custom script" but doubt I would ever get such an idea...
So now it is:
upload_2020-8-27_19-30-17.png

And there is only one unit now. But my casting unit is now moved to the center of my map again :-(
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,534
So the Pause/Unpause actions should prevent the unit from moving, at least it does in my map, but maybe it works differently in version 1.27.

Hmm, it's hard for me to test it because I don't have that version. Maybe try ordering the Triggering unit to Stop as well.
  • Example
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Blink
    • Actions
      • Set Variable TempPoint = (Target point of ability being cast)
      • Unit - Create 1 Footman for (Triggering player) at TempPoint facing Default building facing degrees
      • Custom script: call RemoveLocation (udg_TempPoint)
      • Unit - Add a 60.00 second Generic expiration timer to (Last created unit)
      • Unit - Order (Triggering unit) to Stop.
      • Unit - Pause (Triggering unit)
      • Unit - Unpause (Triggering unit)
If it still moves to the center of the map then I guess it's just a version difference and there's not much you can do about it besides updating your version or using DoomBlade's suggestion :/

It's weird that it would work differently...
 
Level 3
Joined
Jul 23, 2020
Messages
39
Oh I guess the problem is of different kind. I already have some more grey hair because I had lots of troubles with using the game cache. And I believe every time something is not correct warcraft use the map center as a default to move the unit there. Your idea pausing the unit worked, but since I set the maximum range to the limit this happens - independently if I set the duration (normal) to zero or use the default in the object editor...
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,534
Oh I guess the problem is of different kind. I already have some more grey hair because I had lots of troubles with using the game cache. And I believe every time something is not correct warcraft use the map center as a default to move the unit there. Your idea pausing the unit worked, but since I set the maximum range to the limit this happens - independently if I set the duration (normal) to zero or use the default in the object editor...
Yeah, if it can't find the Point it can default to the center of the map. Anyway, see the picture I attached, this is what my Blink looks like which works.

Did you try it with the "Stop" order as well (see my above trigger)? I think that may fix it.

Edit:
After testing it some more, it seems like it works MOST of the time, but sometimes it teleports back to the center. I guess it's not a flawless solution. This game can be quite annoying sometimes.
 

Attachments

  • ex.png
    ex.png
    1 MB · Views: 29
Level 3
Joined
Jul 23, 2020
Messages
39
The "Stop" did not help. Also not "turn off this trigger" after "unpause unit". If your caster also teleports to the center I feel at least not that stupid. Another thing I realized and want to ask is about your screenshot of the object editor: Yours is soooo much smaller compared to the "thousands" of settings I see in my modified blink spell. Is this because you modify the original spell? I copied the spell and then modify it, because I have another hero still using blink as normal ability. But everytime I copy a spell to modify it I get so many options, it is confusing and time-consuming to scroll to the correct place...
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,534
The "Stop" did not help. Also not "turn off this trigger" after "unpause unit". If your caster also teleports to the center I feel at least not that stupid. Another thing I realized and want to ask is about your screenshot of the object editor: Yours is soooo much smaller compared to the "thousands" of settings I see in my modified blink spell. Is this because you modify the original spell? I copied the spell and then modify it, because I have another hero still using blink as normal ability. But everytime I copy a spell to modify it I get so many options, it is confusing and time-consuming to scroll to the correct place...
The copied abilities should be the same as the original abilities. Maybe send me a picture.

Also, you can try pressing Control + D, this will toggle between normal and raw data view. Maybe you're viewing the Raw Data which is causing it to look weird.

And I found an alternate solution to the Blink spell but it will only work on patch 1.31+.
 
Last edited:
Level 3
Joined
Jul 23, 2020
Messages
39
"Dear Uncle" thanks for helping me so much! Actually I don't really want to upgrade, because now I am quite satisfied.
The raw data view is even more confusing than my long long list of options, which I will also attach.
But first: It is almost solved:
upload_2020-8-27_21-28-17.png

Only drawback: I have to manually withdraw the mana costs (stange, this works now...)
And there is no cooldown for the spell anymore (can I trigger this as well?)
Anyway, why should I worry about cooldown. There will be nobody complaining about this ;-)
Now about my view on the custom spell based on "blink" (just 3 screen capures)
Top
upload_2020-8-27_21-33-45.png

Somewhere in the middle
upload_2020-8-27_21-35-16.png

at the end
upload_2020-8-27_21-36-8.png

There are really may options to change...
 
Level 3
Joined
Jul 23, 2020
Messages
39
Yes, that might me. It took me some time to find "maximum range" (but now I figured out its alphabetically sorted)
But even fields would not be duplicated, the options are far more than in the original spell. Well, I have to live with that...
Now it's time to sleep... Thanks again to all you guys!
 
Status
Not open for further replies.
Top