Yet another MUI problem

bessomi

New Member
Reaction score
9
Hello.

I am so sorry for double posting like this but i really need help.

I have a spell which uses 3 triggers, and i figured out a way to make it an MUI spell. It is not using any waits so this should be quite easy i thought.
WRONG
After i tried making it an MUI spell, the whole spell failed.
But the good news is that i know what the problem is, i think.
And i don't know how to solve it.

First trigger
Code:
Hells Judgement
    Events
        Unit - A unit Begins casting an ability
    Conditions
        (Ability being cast) Equal to Hells judjement 
        (Percentage life of (Target unit of ability being cast)) Greater than or equal to 90.00
        (Percentage life of (Casting unit)) Greater than or equal to 90.00
    Actions
        Set IntegerA = (IntegerA + 1)
        Set Hell_Boolean[IntegerA] = True
        Set Unit_Victim[IntegerA] = (Target unit of ability being cast)
        Set Unit_Caster[IntegerA] = (Casting unit)
        Set Point1[IntegerA] = (Position of (Casting unit))
        Set Point2[IntegerA] = (Position of Unit_Victim[IntegerA])
        Set Integer[IntegerA] = (Random integer number between 1 and 15)
        Unit - Pause Unit_Caster[IntegerA]
        Unit - Pause Unit_Victim[IntegerA]
        Unit - Add Crow Form to Unit_Caster[IntegerA]
        Unit - Remove Crow Form from Unit_Caster[IntegerA]
        Unit - Add Crow Form to Unit_Victim[IntegerA]
        Unit - Remove Crow Form from Unit_Victim[IntegerA]
        Animation - Change Unit_Caster[IntegerA] flying height to 300.00 at 300.00
        Animation - Change Unit_Victim[IntegerA] flying height to 300.00 at 300.00
        Special Effect - Create a special effect at Point1[IntegerA] using Doodads\Cinematic\TownBurningFireEmitter\TownBurningFireEmitter.mdl
        Set Special_Effect[IntegerA] = (Last created special effect)
        Special Effect - Create a special effect at Point2[IntegerA] using Doodads\Cinematic\TownBurningFireEmitter\TownBurningFireEmitter.mdl
        Set Special_Effect_2[IntegerA] = (Last created special effect)
        Floating Text - Create floating text that reads String[IntegerA] above Unit_Victim[IntegerA] with Z offset 0.00, using font size 10.00, color (50.00%, 50.00%, 50.00%), and 0.00% transparency
        Set Floating_Text[IntegerA] = (Last created floating text)
        Trigger - Turn on Hells Judgement damage <gen>
        Custom script:   call RemoveLocation (udg_Point1[udg_IntegerA])
        Custom script:   call RemoveLocation (udg_Point2[udg_IntegerA])
        Countdown Timer - Start Timer[IntegerA] as a One-shot timer that will expire in (Real(Integer[IntegerA])) seconds
        Countdown Timer - Create a timer window for Timer[IntegerA] with title Hells Judgement
        Trigger - Add to Timer Expires <gen> the event (Time - Timer[IntegerA] expires)
        Set Timer_Window[IntegerA] = (Last created timer window)
Second trigger
Code:
Hells Judgement damage
    Events
        Time - Every 0.10 seconds of game time
    Conditions
    Actions
        Set String[IntegerA] = ((String((Percentage life of Unit_Victim[IntegerA]))) + %)
        Floating Text - Change text of Floating_Text[IntegerA] to String[IntegerA] using font size 10.00
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Hell_Boolean[IntegerA] Equal to True
            Then - Actions
                Unit - Cause Unit_Caster[IntegerA] to damage Unit_Victim[IntegerA], dealing ((Max life of Unit_Victim[IntegerA]) x 0.01) damage of attack type Chaos and damage type Fire
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Level of Hells judjement  for Unit_Caster[IntegerA]) Equal to 1
                    Then - Actions
                        If ((Percentage life of Unit_Victim[IntegerA]) Less than or equal to 70.00) then do (Set Hell_Boolean[IntegerA] = False) else do (Do nothing)
                    Else - Actions
                        Do nothing
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Level of Hells judjement  for Unit_Caster[IntegerA]) Equal to 2
                    Then - Actions
                        If ((Percentage life of Unit_Victim[IntegerA]) Less than or equal to 60.00) then do (Set Hell_Boolean[IntegerA] = False) else do (Do nothing)
                    Else - Actions
                        Do nothing
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Level of Hells judjement  for Unit_Caster[IntegerA]) Equal to 3
                    Then - Actions
                        If ((Percentage life of Unit_Victim[IntegerA]) Less than or equal to 50.00) then do (Set Hell_Boolean[IntegerA] = False) else do (Do nothing)
                    Else - Actions
                        Do nothing
            Else - Actions
                Unit - Set life of Unit_Victim[IntegerA] to (((Max life of Unit_Victim[IntegerA]) x 0.01) + (Life of Unit_Victim[IntegerA]))
        If ((Life of Unit_Victim[IntegerA]) Equal to 100.00) then do (Set Hell_Boolean[IntegerA] = True) else do (Do nothing)
Third and final trigger
Code:
Timer Expires
    Events
    Conditions
    Actions
        Countdown Timer - Destroy Timer_Window[IntegerA]
        Animation - Change Unit_Caster[IntegerA] flying height to 0.00 at 300.00
        Animation - Change Unit_Victim[IntegerA] flying height to 0.00 at 300.00
        Unit - Unpause Unit_Caster[IntegerA]
        Unit - Unpause Unit_Victim[IntegerA]
        Special Effect - Destroy Special_Effect[1]
        Special Effect - Destroy Special_Effect[2]
        Trigger - Turn off Hells Judgement damage <gen>
        Unit - Set life of Unit_Caster[IntegerA] to (Percentage life of Unit_Victim[IntegerA])

As you can see, i made all the variables to arrays and then i set the arrays to
IntegerA. Then i had IntegerA be a new number when the spell is cast. By doing that i thought that the variables would refresh themselves each time the spell is cast, as if they where brand new.
WRONG AGAIN
This is what i think is the problem.
If the spell is cast twice then the first time will use the same variables as the second one.
What this spell does is that it lifts the enemy and the caster into the air.
Then it makes the life of the "Victim" go up and down between 70% and 100%
The problem is that it stops at 100% whenever. it does not matter if i cast the spell twice with 2 different heroes, The life of "Victim" will still stop when it reaches 100%

Tell me if you need to see the map yourselves.

Thanks in return
 

Exide

I am amazingly focused right now!
Reaction score
448
I think your IntegerA variable is the problem.
But I'm not sure why. :p

Also, your conditions in the first trigger might prevent your spell from working correctly?

In the second trigger, you should try to use a loop.. -You want the trigger to run for all targets at the same time.
Also, remove every 'Do Nothing' from the second trigger, they're worthless anyway. :p
 

Flare

Stops copies me!
Reaction score
662
As it is, you are far from MUI... everytime a new instance occurs, you are only keeping track of the latest values (yes, you have all the other array values defined, but you aren't using them). You need to loop through all array values

Code:
        Trigger - Turn on Hells Judgement damage <gen>
Code:
        Trigger - Turn off Hells Judgement damage <gen>

You've ruined any chance of MUI-ness right there. Don't turn off triggers if they are available for use by separate units (or anything else for that matter).
Me said:
-THIS PART IS IMPORTANT!
---Also, you must NEVER EVER EVER turn off periodic event triggers if you plan to make MUI spells unless you intend to completely prevent everyone from using the ability. Turning off the trigger (obviously) prevents units from utilizing the effects of the periodic trigger (if a unit is sliding, and are paused for example, turning off the trigger may prevent you from unpausing the unit which can be terrible).
 

bessomi

New Member
Reaction score
9
I am glad you helped me figgure out the problem.

Any chance of helping me fix it?

Thanks in return:thup:
 

Grymlax

Probably not around
Reaction score
138
This is not something that would make your spell mui but it makes the trigger shorter.

This part of your code:
Code:
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Level of Hells judjement  for Unit_Caster[IntegerA]) Equal to 1
                    Then - Actions
                        If ((Percentage life of Unit_Victim[IntegerA]) Less than or equal to 70.00) then do (Set Hell_Boolean[IntegerA] = False) else do (Do nothing)
                    Else - Actions
                        Do nothing
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Level of Hells judjement  for Unit_Caster[IntegerA]) Equal to 2
                    Then - Actions
                        If ((Percentage life of Unit_Victim[IntegerA]) Less than or equal to 60.00) then do (Set Hell_Boolean[IntegerA] = False) else do (Do nothing)
                    Else - Actions
                        Do nothing
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Level of Hells judjement  for Unit_Caster[IntegerA]) Equal to 3
                    Then - Actions
                        If ((Percentage life of Unit_Victim[IntegerA]) Less than or equal to 50.00) then do (Set Hell_Boolean[IntegerA] = False) else do (Do nothing)
                    Else - Actions
                        Do nothing

Can be simplified into this code:
Code:
If ((Percentage life of Unit_Victim[IntegerA]) Less than or equal to (80.00 - (10.00 x (Real((Level of Hells judjement for Unit_Victim[IntegerA])))))) then do (Set Hell_Boolean[(Integer A)] = False) else do (Do nothing)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top