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

Problem With My Ability

Status
Not open for further replies.
Level 14
Joined
Dec 29, 2009
Messages
931
  • DS InitRun
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Doomed Salvation
    • Actions
      • Set DS_Caster = (Triggering unit)
      • Unit - Pause DS_Caster
      • Set DS_TempLoc00 = (Position of (Triggering unit))
      • Set DS_DummyHeight00 = 700.00
      • For each (Integer A) from 1 to 15, do (Actions)
        • Loop - Actions
          • Unit - Create 1 DoomedSalvation DUMMY for (Owner of (Triggering unit)) at DS_TempLoc00 facing 0.00 degrees
          • Animation - Change (Last created unit) flying height to (DS_DummyHeight00 + 50.00) at 0.00
          • Animation - Change (Last created unit) flying height to 0.00 at 2000.00
          • Unit - Add a 0.90 second Generic expiration timer to (Last created unit)
      • Set DS_DummyHeight00 = 0.00
      • Special Effect - Create a special effect at (Position of (Triggering unit)) using Objects\Spawnmodels\Undead\UDeathMedium\UDeath.mdl
      • Special Effect - Destroy (Last created special effect)
      • Custom script: call RemoveLocation(udg_DS_TempLoc00)
That was the first trigger, here is the second trigger.

  • DS Run
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to DoomedSalvation DUMMY
    • Actions
      • Set DS_TempLoc00 = (Position of (Triggering unit))
      • Unit Group - Pick every unit in (Units within (((Real((Level of Doomed Salvation for DS_Caster))) x 30.00) + 200.00) of (Center of (Playable map area)) matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)) and do (Actions)
        • Loop - Actions
          • Unit - Pause (Picked unit)
          • Special Effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
          • Special Effect - Destroy (Last created special effect)
          • Special Effect - Create a special effect at (Position of (Picked unit)) using Objects\Spawnmodels\Undead\UDeathSmall\UDeathSmall.mdl
          • Special Effect - Destroy (Last created special effect)
          • Unit - Cause (Triggering unit) to damage (Picked unit), dealing (((Real((Strength of DS_Caster (Include bonuses)))) x 3.00) + (((Real((Agility of DS_Caster (Include bonuses)))) x 3.00) + ((Real((Intelligence of DS_Caster (Include bonuses)))) x 3.00))) damage of attack type Spells and damage type Normal
          • Unit - Unpause DS_Caster
          • Unit - Unpause (Picked unit)
The problem is... I can't get the second trigger to run. What am I doing wrong?

EDIT: Nevermind. I had the affected area set to the center of the map.

WHILE it's up there... are there any leaks or problems I need to fix?
 
Yes, you have many leaks.
1)
  • Special Effect - Create a special effect at (Position of (Triggering unit)) using Objects\Spawnmodels\Undead\UDeathMedium\UDeath.mdl
(Position of (Triggering unit)) leaks.

2)
  • Unit Group - Pick every unit in (Units within (((Real((Level of Doomed Salvation for DS_Caster))) x 30.00) + 200.00) of (Center of (Playable map area)) matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True))
Should be:
  • Set Point1 = (Center of (Playable map area))
  • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (Units within (((Real((Level of Doomed Salvation for DS_Caster))) x 30.00) + 200.00) of Point1) matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)) and do (Actions)
      • Loop - Actions
    • Custom script: call RemoveLocation (udg_Point1)
3)
  • Special Effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
    • Special Effect - Create a special effect at (Position of (Picked unit)) using Objects\Spawnmodels\Undead\UDeathSmall\UDeathSmall.mdl
Position of (Picked unit) leaks.

4) Set DS_TempLoc00 = (Position of (Triggering unit))

You did not remove the location afterwards:
  • Custom script: call RemoveLocation (udg_DS_TempLoc00)
 
Level 14
Joined
Dec 29, 2009
Messages
931
1.) Fixed.

2.) I think it's fixed. What is the custom script: set bj_wantDestroyGroup = true??

3.) Fixed.

4.) Stupid me. Totally forgot that. FIXED.

  • DS Run
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to DoomedSalvation DUMMY
    • Actions
      • Set DS_TempLoc00 = (Position of (Triggering unit))
      • Unit Group - Pick every unit in (Units within (((Real((Level of Doomed Salvation for DS_Caster))) x 30.00) + 200.00) of (Position of DS_Caster) matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
            • Then - Actions
              • Set DS_TempLoc01 = (Position of (Picked unit))
              • Unit - Pause (Picked unit)
              • Special Effect - Create a special effect at DS_TempLoc01 using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
              • Special Effect - Destroy (Last created special effect)
              • Special Effect - Create a special effect at DS_TempLoc01 using Objects\Spawnmodels\Undead\UDeathSmall\UDeathSmall.mdl
              • Special Effect - Destroy (Last created special effect)
              • Unit - Cause (Triggering unit) to damage (Picked unit), dealing (((Real((Strength of DS_Caster (Include bonuses)))) x 3.00) + (((Real((Agility of DS_Caster (Include bonuses)))) x 3.00) + ((Real((Intelligence of DS_Caster (Include bonuses)))) x 3.00))) damage of attack type Spells and damage type Normal
              • Unit - Unpause DS_Caster
              • Unit - Unpause (Picked unit)
              • Custom script: call RemoveLocation(udg_DS_TempLoc01)
            • Else - Actions
      • Custom script: call RemoveLocation(udg_DS_TempLoc00)
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Custom script: set bj_wantDestroyGroup(udg_var) is a command used in Custom script action for cleaning leaks of Unit Group
It destroys the Group right after the usage of it
It's not wise to use this command if you're using the Group for Damages Per Second spell or something like that because it will create a bug due to destroy of the Group earlier after the first use
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
You still have a position leak in the unit group pick.
The caster should be unpaused after the loop, not inside the loop.
I'd do the damage calculations outside the loop.
It's not MUI. You could link the dummy and the caster together with indexing or hashtables.
Add
  • Custom script: set bj_wantDestroyGroup = true
before the unit group pick.
 
Level 14
Joined
Dec 29, 2009
Messages
931
~You still have a position leak in the unit group pick. What position leak?

~The caster should be unpaused after the loop, not inside the loop. Okay.

~I'd do the damage calculations outside the loop. The spell damages the picked unit.

~It's not MUI. You could link the dummy and the caster together with indexing for hashtables. I don't really understand MUI, and I have no knowledge of Indexing or Hashtables.

The custom script has been added.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Position of DS_Caster leaks in unit group pick.

Damage:
  • Actions
    • Set DS_TempLoc00 = (Position of (Triggering unit))
    • set r1 = Real((Strength of DS_Caster (Include bonuses)))) x 3.00) + (((Real((Agility of DS_Caster (Include bonuses)))) x 3.00) + ((Real((Intelligence of DS_Caster (Include bonuses)))) x 3.00
    • Unit Group - Pick every unit in (Units within (((Real((Level of Doomed Salvation for DS_Caster))) x 30.00) + 200.00) of (Position of DS_Caster) matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)) and do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
          • Then - Actions
            • Unit - Cause (Triggering unit) to damage (Picked unit), dealing r1 damage of attack type Spells and damage type Normal
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
-------------------------------------------------------------------------------------

  • Set DS_TempLoc00 = (Position of (Triggering unit))
This is what Maker told you about Position/Location leak

To clean it, add this:

  • Custom script: call RemoveLocation(udg_DS_TempLoc00)
To clean the leak.

-------------------------------------------------------------------------------------

MUI means, Multi-Unit Instanceable
Meaning, if the spell/trigger is a non-MUI, it cannot be casted more than 1 unit at a time, it causes bugs

-------------------------------------------------------------------------------------
 
-------------------------------------------------------------------------------------

  • Set DS_TempLoc00 = (Position of (Triggering unit))
This is what Maker told you about Position/Location leak

To clean it, add this:

  • Custom script: call RemoveLocation(udg_DS_TempLoc00)
To clean the leak.

-------------------------------------------------------------------------------------

MUI means, Multi-Unit Instanceable
Meaning, if the spell/trigger is a non-MUI, it cannot be casted more than 1 unit at a time, it causes bugs

-------------------------------------------------------------------------------------

uhmmm... I think its the one on this line (Position of DS_Caster)
  • Unit Group - Pick every unit in (Units within (((Real((Level of Doomed Salvation for DS_Caster))) x 30.00) + 200.00) of (Position of DS_Caster) matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)) and do (Actions)
do this...
  • Set DS_TempLoc00 = (Position of (Triggering unit))
  • Set DS_TempLoc01 = Position of DS_Caster
  • set r1 = Real((Strength of DS_Caster (Include bonuses)))) x 3.00) + (((Real((Agility of DS_Caster (Include bonuses)))) x 3.00) + ((Real((Intelligence of DS_Caster (Include bonuses)))) x 3.00
  • Unit Group - Pick every unit in (Units within (((Real((Level of Doomed Salvation for DS_Caster))) x 30.00) + 200.00) of (DS_TempLoc01) matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)) and do (Actions)
  • Custom script: call RemoveLocation(udg_DS_TempLoc00)
  • Custom script: call RemoveLocation(udg_DS_TempLoc01)
 
Level 14
Joined
Dec 29, 2009
Messages
931
Ahh, I see. Fixed the location leak...

How can I make this MUI?

Here are the triggers if anyone needs them.

  • DS InitRun
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Doomed Salvation
    • Actions
      • Set DS_Caster = (Triggering unit)
      • Unit - Pause DS_Caster
      • Set DS_TempLoc00 = (Position of (Triggering unit))
      • Set DS_DummyHeight00 = 700.00
      • For each (Integer A) from 1 to 3, do (Actions)
        • Loop - Actions
          • Unit - Create 1 DoomedSalvation DUMMY for (Owner of (Triggering unit)) at DS_TempLoc00 facing 0.00 degrees
          • Animation - Change (Last created unit) flying height to (DS_DummyHeight00 + 50.00) at 0.00
          • Animation - Change (Last created unit) flying height to 0.00 at 2000.00
          • Unit - Add a 0.90 second Generic expiration timer to (Last created unit)
      • Set DS_DummyHeight00 = 0.00
      • Special Effect - Create a special effect at (Position of (Triggering unit)) using Objects\Spawnmodels\Undead\UDeathMedium\UDeath.mdl
      • Special Effect - Destroy (Last created special effect)
      • Custom script: call RemoveLocation(udg_DS_TempLoc00)
  • DS Run
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to DoomedSalvation DUMMY
    • Actions
      • Set DS_TempLoc02 = (Position of DS_Caster)
      • Set DS_TempLoc00 = (Position of (Triggering unit))
      • Unit Group - Pick every unit in (Units within (((Real((Level of Doomed Salvation for DS_Caster))) x 30.00) + 200.00) of DS_TempLoc02 matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
            • Then - Actions
              • Set DS_TempLoc01 = (Position of (Picked unit))
              • Unit - Pause (Picked unit)
              • Special Effect - Create a special effect at DS_TempLoc01 using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
              • Special Effect - Destroy (Last created special effect)
              • Special Effect - Create a special effect at DS_TempLoc01 using Objects\Spawnmodels\Undead\UDeathSmall\UDeathSmall.mdl
              • Special Effect - Destroy (Last created special effect)
              • Unit - Unpause (Picked unit)
              • Unit - Cause (Triggering unit) to damage (Picked unit), dealing (((Real((Strength of DS_Caster (Include bonuses)))) x 3.00) + (((Real((Agility of DS_Caster (Include bonuses)))) x 3.00) + ((Real((Intelligence of DS_Caster (Include bonuses)))) x 3.00))) damage of attack type Spells and damage type Normal
            • Else - Actions
      • Unit - Unpause DS_Caster
      • Custom script: call RemoveLocation(udg_DS_TempLoc01)
      • Custom script: call RemoveLocation(udg_DS_TempLoc00)
      • Custom script: call RemoveLocation(udg_DS_TempLoc02)
 
Last edited:
he pauses the caster, and then unpauses him when the unit dies... so if another unit casts it before the first summon dies, the first caster will remain paused...

basically its because DS_Caster is a global variable... and then there are a lot of usage of DS_caster on the dying trigger...

so as you can see, the spell isn't really instant effect...
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
A spell without Index or Hashtables is considered as... non-MUI spell ?
I want to know WHAT causes the spell to be non-MUI thanks ;D

If a spell works correctly when one unit casts it, but not when two or more unit cast it so that the durations overlap, it is considered non-MUI.

This is a MUI spell for example, no indexing or hashtable, and it even uses the dreaded wait. Triggering unit is a local variable, that's why you can use it with wait.

  • Untitled Trigger 003
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Blink
    • Actions
      • Wait 8.00 seconds
      • Unit - Set life of (Triggering unit) to 100.00%
 
So, Variable will cause to non-MUI trigger ?

it depends... if you understand what MUI means then it will be easy to see what is MUI and what is not...

for example:
his spell has two parts: casting and death of dummy
upon casting - he saved caster into DS_Caster, created dummy, did somethings to caster
delay between cast and death: .9 seconds
upon death - did somethings to DS_Caster

so if someone recasts the spell in between the .9 second delay, DS_Caster will get overwritten so he wont be able to pick the first caster anymore...

in that spell's case, it will make the first caster get paused forever... +other bugs...

+variables are also what you use to make it MUI (in case of indexing)...

USUALLY: [

triggers whose effects are happening over a time period or has a time delay would not be MUI unless you use indexing, hashtables etc...

instant triggers are MUI]
 
So, an arises of non-MUI is because the use of; Pause Action / Over-time trigger / Waits eh ?
Other than that (a straight-single-one-shot trigger), it works as MUI ?

most probably...

not pause action really... it does not cause non-mui...

you got it wrong... the problem in his spell is that he pauses the unit at cast and saves it in a variable and then unpauses it upon death of dummy... the problem is not the pause but the passing of the unit into the other trigger...
 
Level 14
Joined
Dec 29, 2009
Messages
931
Sorry for the long delay, but I think I finally fixed it..

Does this work?

Trigger One:
  • DS InitRun
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Doomed Salvation
    • Actions
      • Set DS_Caster[(Player number of (Owner of (Triggering unit)))] = (Triggering unit)
      • Unit - Pause DS_Caster[(Player number of (Owner of (Triggering unit)))]
      • Set DS_TempLoc00[(Player number of (Owner of (Triggering unit)))] = (Position of (Triggering unit))
      • Set DS_DummyHeight00[(Player number of (Owner of (Triggering unit)))] = 700.00
      • For each (Integer A) from 1 to 3, do (Actions)
        • Loop - Actions
          • Unit - Create 1 DoomedSalvation DUMMY for (Owner of (Triggering unit)) at DS_TempLoc00[(Player number of (Owner of (Triggering unit)))] facing 0.00 degrees
          • Animation - Change (Last created unit) flying height to (DS_DummyHeight00[(Player number of (Owner of (Triggering unit)))] + 50.00) at 0.00
          • Animation - Change (Last created unit) flying height to 0.00 at 2000.00
          • Unit - Add a 0.90 second Generic expiration timer to (Last created unit)
      • Set DS_DummyHeight00[(Player number of (Owner of (Triggering unit)))] = 0.00
      • Special Effect - Create a special effect at (Position of (Triggering unit)) using Objects\Spawnmodels\Undead\UDeathMedium\UDeath.mdl
      • Special Effect - Destroy (Last created special effect)
      • Custom script: call RemoveLocation(udg_DS_TempLoc00)
Trigger Two:
  • DS Run
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to DoomedSalvation DUMMY
    • Actions
      • Set DS_TempLoc02[(Player number of (Owner of (Triggering unit)))] = (Position of DS_Caster[(Player number of (Owner of (Triggering unit)))])
      • Set DS_TempLoc00[(Player number of (Owner of (Triggering unit)))] = (Position of (Triggering unit))
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within (Real((((Level of Doomed Salvation for DS_Caster[(Player number of (Owner of (Triggering unit)))]) x 30) + 200))) of (Center of (Playable map area)) matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Custom value of (Picked unit)) Greater than 0
            • Then - Actions
              • Set DS_TempLoc01[(Player number of (Owner of (Triggering unit)))] = (Position of (Picked unit))
              • Unit - Pause (Picked unit)
              • Special Effect - Create a special effect at DS_TempLoc01[(Player number of (Owner of (Triggering unit)))] using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
              • Special Effect - Destroy (Last created special effect)
              • Special Effect - Create a special effect at DS_TempLoc01[(Player number of (Owner of (Triggering unit)))] using Objects\Spawnmodels\Undead\UDeathSmall\UDeathSmall.mdl
              • Special Effect - Destroy (Last created special effect)
              • Unit - Unpause (Picked unit)
              • Unit - Cause (Triggering unit) to damage (Picked unit), dealing (((Real((Strength of DS_Caster[(Player number of (Owner of (Triggering unit)))] (Include bonuses)))) x 3.00) + (((Real((Agility of DS_Caster[(Player number of (Owner of (Triggering unit)))] (Include bonuses)))) x 3.00) + ((Real((Intelligence of DS_Caster[(Pla damage of attack type Spells and damage type Normal
            • Else - Actions
      • Unit - Unpause DS_Caster[(Player number of (Owner of (Triggering unit)))]
      • Custom script: call RemoveLocation(udg_DS_TempLoc00[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
      • Custom script: call RemoveLocation(udg_DS_TempLoc01[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
      • Custom script: call RemoveLocation(udg_DS_TempLoc02[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
I commented the code a bit.

  • DS InitRun
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Doomed Salvation
    • Actions
      • Set DS_Caster[(Player number of (Owner of (Triggering unit)))] = (Triggering unit) // Set the player number to a variable, and use the variable.
      • Unit - Pause DS_Caster[(Player number of (Owner of (Triggering unit)))]
      • Set DS_TempLoc00[(Player number of (Owner of (Triggering unit)))] = (Position of (Triggering unit)) // Make this a non-array variable
      • Set DS_DummyHeight00[(Player number of (Owner of (Triggering unit)))] = 700.00
      • For each (Integer A) from 1 to 3, do (Actions)
        • Loop - Actions
          • Unit - Create 1 DoomedSalvation DUMMY for (Owner of (Triggering unit)) at DS_TempLoc00[(Player number of (Owner of (Triggering unit)))] facing 0.00 degrees
          • Animation - Change (Last created unit) flying height to (DS_DummyHeight00[(Player number of (Owner of (Triggering unit)))] + 50.00) at 0.00
          • Animation - Change (Last created unit) flying height to 0.00 at 2000.00
          • Unit - Add a 0.90 second Generic expiration timer to (Last created unit)
      • Set DS_DummyHeight00[(Player number of (Owner of (Triggering unit)))] = 0.00 // You don't have to set this to null
      • Special Effect - Create a special effect at (Position of (Triggering unit)) using Objects\Spawnmodels\Undead\UDeathMedium\UDeath.mdl // Location leak
      • Special Effect - Destroy (Last created special effect)
      • Custom script: call RemoveLocation(udg_DS_TempLoc00) // This should be RemoveLocation(udg_DS_TempLoc00[(Player number of (Owner of (Triggering unit)))] , but you if you make it non-aray, then it is correct.
Trigger Two:
  • DS Run
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to DoomedSalvation DUMMY
    • Actions
      • Set DS_TempLoc02[(Player number of (Owner of (Triggering unit)))] = (Position of DS_Caster[(Player number of (Owner of (Triggering unit)))]) // make this non-array
      • Set DS_TempLoc00[(Player number of (Owner of (Triggering unit)))] = (Position of (Triggering unit)) // Doesn't need to be an array.
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within (Real((((Level of Doomed Salvation for DS_Caster[(Player number of (Owner of (Triggering unit)))]) x 30) + 200))) of (Center of (Playable map area)) matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Custom value of (Picked unit)) Greater than 0 // Avoid using custom values. But it works.
            • Then - Actions
              • Set DS_TempLoc01[(Player number of (Owner of (Triggering unit)))] = (Position of (Picked unit))
              • Unit - Pause (Picked unit)
              • Special Effect - Create a special effect at DS_TempLoc01[(Player number of (Owner of (Triggering unit)))] using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
              • Special Effect - Destroy (Last created special effect)
              • Special Effect - Create a special effect at DS_TempLoc01[(Player number of (Owner of (Triggering unit)))] using Objects\Spawnmodels\Undead\UDeathSmall\UDeathSmall.mdl
              • Special Effect - Destroy (Last created special effect)
              • Unit - Unpause (Picked unit)
              • Unit - Cause (Triggering unit) to damage (Picked unit), dealing (((Real((Strength of DS_Caster[(Player number of (Owner of (Triggering unit)))] (Include bonuses)))) x 3.00) + (((Real((Agility of DS_Caster[(Player number of (Owner of (Triggering unit)))] (Include bonuses)))) x 3.00) + ((Real((Intelligence of DS_Caster[(Pla damage of attack type Spells and damage type Normal
            • Else - Actions
      • Unit - Unpause DS_Caster[(Player number of (Owner of (Triggering unit)))]
      • Custom script: call RemoveLocation(udg_DS_TempLoc00[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
      • Custom script: call RemoveLocation(udg_DS_TempLoc01[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
      • Custom script: call RemoveLocation(udg_DS_TempLoc02[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])

There's a leak in the unit group pick. You should do the damage calculations outside the loop, and save the value to a variable.
 
Level 14
Joined
Dec 29, 2009
Messages
931
Alright, most of this I understand.

1.) Is it really necessary that I set the player number to a variable?

2.) Why would I make TempLoc00 a non-array variable? This is the position of the caster, so if two Dark Champions cast it at the same time, wouldn't the effect only spawn at one of them?

3.) TempLoc02 should be a variable for the same reason. ^

4.) The custom value works because of a different trigger I have, that has to do with my Creep Respawn system.

Thanks for the feedback. Is the spell MUI? :smile:
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
1.) Is it really necessary that I set the player number to a variable?

No, it's not necessary. It's easier, you don't have to click so many times to get Player number of (owner of (triggering unit)), you can use a variable.

Also Player number of is a function, Owner of is a function , Triggerin Unit is a function. You're calling three functions several times, when you could use a variable where the desired value is already stored.

2.) Why would I make TempLoc00 a non-array variable? This is the position of the caster, so if two Dark Champions cast it at the same time, wouldn't the effect only spawn at one of them?

The trigger can't be running for all casters at the same time. First it runs for the first caster, then for the next one. Arrays require a bit more memory, and are slower than non-array variables. You won't notice the difference though.

4.) The custom value works because of a different trigger I have, that has to do with my Creep Respawn system.

Custom values are "bad coding" since if people rely on that in their spells or systems, they can conflict. Custom value is not a unique value, used only for the spell.

The spell looks to be MUI.
 
Status
Not open for further replies.
Top