• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Spell] Hero Contest 7 Spell Help

Status
Not open for further replies.
Right, I've made these two triggers very quickly and would like to make sure they're 1) MUI and 2) Efficient and leak free. Both of these are very unlikely at the moment so rather than put the effort in myself I would like your guy's advice/Expertise.

The Spell does this: Creates a banner at a location (based off of Healing Ward), the banner gives off an aura that decreases nearby units attack damage and every 8 seconds deals 50 damage to units around it. To do the 50 damage I made a stomp spell with 8 second cooldown and 50 damage. I've given it to a dummy unit which these triggers create, remove and order to cast.

[Trigger=Standard of the Alliance]Standard of the Alliance
Events
Unit - A unit Finishes casting an ability
Conditions
(Ability being cast) Equal to Banner of the Alliance
Actions
Unit - Create 1 Dummy for (Owner of (Casting unit)) at (Target point of ability being cast) facing Default building facing degrees
Wait 32.00 seconds
Unit - Remove (Last created unit) from the game
[/trigger]
[Trigger=Stomp Cast]Stomp Cast
Events
Time - Every 0.03 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in (Units of type Dummy) and do (Actions)
Loop - Actions
Unit - Order (Picked unit) to Orc Tauren Chieftain - War Stomp
[/Trigger]
 
Level 26
Joined
Sep 26, 2009
Messages
2,427
It ain't MUI and it leaks like crazy.

(Last created unit) is like a standard global variable - it holds the last created unit in the entire game, no matter how the unit was created. So when you create banner, that banner is last created unit, but after 32 seconds it is very likely that some other unit has been created. So you may actually remove completely different unit.

I think there is no (Target point of ability being cast) in "Unit finished casting" event, but only "Unit begins casting/starts the effect of an ability" events. Also, if you don't put the location into variable and don't destroy it via custom script, it will leak location.

The second trigger:
A very inefficient way if you ask me, because you will fire this trigger about 265 times just so it casts Stomp the 265th time it runs, making the trigger run 264 times for no reason.
Also, the unit group action "Pick every unit in (units of type)" permanently leaks. You need to use different type of unit group action.

You should put more effort into making something tho, we're not your personal army to do your biddings.
 
You should put more effort into making something tho, we're not your personal army to do your biddings.

Yeah, I've just never had the need to trigger spells before but I do appreciate the help.

Also, no other units will be created in the 32 seconds so I knew that wouldn't be an issue but, if you were to make the triggers how would you make them?

deathismyfriend said:
Also if you can't be bothered to try it to check if they are MUI then you shouldn't make spells.

I don't plan on making any more spells than the two necessary for the Hero contest but I'll take a look at your tutorial, I've seen it before but never had a need to read until now, so I'll take a look at it for future reference.

EDIT: Ok, the first trigger now looks like this:
[trigger=Standard of the Alliance]Standard of the Allianxe
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Banner of the Alliance
Actions
Set Temp_Point = (Target point of ability being cast)
Unit - Create 1 Dummy for (Owner of (Casting unit)) at (Target point of ability being cast) facing Default building facing degrees
Set Dummy = (Last created unit)
Wait 32.00 seconds
Unit - Remove Dummy from the game
Custom script: call RemoveLocation (udg_Temp_Point)
[/Trigger]

Right I've also changed the wait and remove to an expiration timer.
 
Level 26
Joined
Sep 26, 2009
Messages
2,427
Also, no other units will be created in the 32 seconds so I knew that wouldn't be an issue
It actually is an issue, as that makes the spell non-MUI. In this case, MUI would mean that at least 2 banners are in game at the same time, your trigger, however, would remove only one of those banners.

The trigger you posted still isn't MUI. For MUI, everything that needs to be saved for any period of time needs to be indexed and put into array. Also, TempLocation can leak, since you remove it after 32 seconds. Look at your trigger and think about those two banners again. When unit A cast the spell, the Banner will be saved into "Dummy" variable. When unit B casts the spell for example 2 seconds laster, its Banner will be saved into "Dummy" variable, replacing the 1st banner that was there. After another 30 seconds the first banner should be removed, since it is in game for 32 seconds, however that is not the case, since you remove what is saved in Dummy variable, which is the 2nd banner.

Also, you should avoid waits in MUI systems. I think this applies for most contests as well.

if you were to make the triggers how would you make them?
I can't really post that, now can I? You want to create spell for contest but you also want people to show you how to do that spell? Doesn't make sense :D
 
You actually have to have knowledge of spells making before participating to a contest lel

Not really, the conetest only requires two spells to be code/trigger enhanced so that means I'm trying to do the bare minimum of the spells as triggers. Since, I can do triggers but not spell triggers I thought now would be a good time to get a bit of experience.
 
I can't really post that, now can I? You want to create spell for contest but you also want people to show you how to do that spell? Doesn't make sense :D

I don't see why not, I don't believe there's anything against it or anything wrong with it but it's up to you and I appreciate the help you've given already.
 
Level 25
Joined
May 11, 2007
Messages
4,651
Create a spell based off command aura with negative damage. (shift click it), set the targets allowed to enemy units.
Give the spell to the banner unit.

Create a spell based off permanent immolitation, give it a cooldown of 8 seconds. Set the damage to 50 and the effects to what you want.
Give this spell to the banner unit.

Create a spell based of healing ward. Replace the ward with your banner unit.
Voilá! No triggering needed, no leaks.
 
Create a spell based off command aura with negative damage. (shift click it), set the targets allowed to enemy units.
Give the spell to the banner unit.

Create a spell based off permanent immolitation, give it a cooldown of 8 seconds. Set the damage to 50 and the effects to what you want.
Give this spell to the banner unit.

Create a spell based of healing ward. Replace the ward with your banner unit.
Voilá! No triggering needed, no leaks.

I did the Command Aura and Healing Ward part but wanted to trigger the 50 damage part so that it fit in with the rules. Now I just need to trigger one more spell.
 
Unit Casts Spell

Set Point = Target point of ability
Create Unit for Triggering Player at Point
call RemoveLocation(udg_Point)

I still don't know what you're talking about, if you're talking about changing owner of casting unit to triggering unit then I've already done that.
 
The Healing Ward spell creates the unit. Anyway, I'm done with that spell I'm moving onto a close range Storm Bolt that reduces armour for a time after it's cast. It'll be the last spell and with the stuff I've learnt making this one it should be easy enough. I'll post the triggers once I'm done anyway just to be safe.

EDIT: Here we go.
[trigger=Power Strike]Power Strike
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Power Strike
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Power Strike for (Triggering unit)) Equal to 1
Then - Actions
Set Temp_Point = (Position of (Target unit of ability being cast))
Unit - Create 1 Dummy (Armour Reduction 2) for (Owner of (Triggering unit)) at Temp_Point facing Default building facing degrees
Set Temp_Unit = (Last created unit)
Unit - Add a 2.00 second Generic expiration timer to Dummy
Unit - Order Temp_Unit to Neutral Alchemist - Acid Bomb (Target unit of ability being cast)
Custom script: call RemoveLocation (udg_Temp_Point)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Power Strike for (Triggering unit)) Equal to 2
Then - Actions
Set Temp_Point = (Position of (Target unit of ability being cast))
Unit - Create 1 Dummy (Armour Reduction 4) for (Owner of (Triggering unit)) at Temp_Point facing Default building facing degrees
Set Temp_Unit = (Last created unit)
Unit - Add a 2.00 second Generic expiration timer to Dummy
Unit - Order Temp_Unit to Neutral Alchemist - Acid Bomb (Target unit of ability being cast)
Custom script: call RemoveLocation (udg_Temp_Point)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Power Strike for (Triggering unit)) Equal to 3
Then - Actions
Set Temp_Point = (Position of (Target unit of ability being cast))
Unit - Create 1 Dummy (Armour Reduction 6) for (Owner of (Triggering unit)) at Temp_Point facing Default building facing degrees
Set Temp_Unit = (Last created unit)
Unit - Add a 2.00 second Generic expiration timer to Dummy
Unit - Order Temp_Unit to Neutral Alchemist - Acid Bomb (Target unit of ability being cast)
Custom script: call RemoveLocation (udg_Temp_Point)
Else - Actions
[/trigger]
 
Status
Not open for further replies.
Top