Ability suddenly decides to stop working.

Zealot

Member
Reaction score
11
The ability works as intended but only the first time, the second time only the SFX appears. I've no idea what could cause this.
Another inconvenience is 2 random SFX do not disappear when the others do, but they seem to always be the same 2.
The ability makes a SFX in the target area, and after all the SFX are created units that are not at full mana regenerate it and those at full mana gain maximum mana until the end. At the end of the ability the SFX are supposed to disappear in the order they appeared.

Trigger:
  • Mystical Field Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Mystical Field
    • Actions
      • Set Mystical_Field_Affected = Mystical_Field_Affected
      • Set Mystical_Field_Caster = (Casting unit)
      • Set Mystical_Field_Check = 2
      • Set Mystical_Field_Angle = 0
      • Set Mystical_Field_Continue = (Random angle)
      • Set Mystical_Field_Point = (Target point of ability being cast)
      • Set Mystical_Field_Total = 0
      • Special Effect - Create a special effect at Mystical_Field_Point using HolyBlessing.mdx
      • Set Mystical_Field_SFX[1] = (Last created special effect)
      • Countdown Timer - Start Mystical_Field_Timer as a One-shot timer that will expire in 0.50 seconds
      • Countdown Timer - Start Mystical_Field_Timer_Replenish as a One-shot timer that will expire in 0.60 seconds


Trigger:
  • Mystical Field SFX
    • Events
      • Time - Mystical_Field_Timer expires
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Mystical_Field_Angle Equal to 0
        • Then - Actions
          • For each (Integer A) from Mystical_Field_Check to Mystical_Field_Check, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • And - All (Conditions) are true
                    • Conditions
                      • Mystical_Field_Check Greater than or equal to 2
                      • Mystical_Field_Check Less than or equal to 10
                • Then - Actions
                  • Set Mystical_Field_SFX_Point = (Mystical_Field_Point offset by 100.00 towards ((Mystical_Field_Continue + 480.00) - ((Real((Integer A))) x 40.00)) degrees)
                  • Set Mystical_Field_Check = (Mystical_Field_Check + 1)
                  • Special Effect - Create a special effect at Mystical_Field_SFX_Point using WaterAurora.mdx
                  • Set Mystical_Field_SFX[(Integer A)] = (Last created special effect)
                  • Countdown Timer - Start Mystical_Field_Timer as a One-shot timer that will expire in 0.10 seconds
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • And - All (Conditions) are true
                    • Conditions
                      • Mystical_Field_Check Greater than or equal to 11
                      • Mystical_Field_Check Less than or equal to 29
                • Then - Actions
                  • Set Mystical_Field_SFX_Point = (Mystical_Field_Point offset by 200.00 towards ((Mystical_Field_Continue + 580.00) - ((Real((Integer A))) x 20.00)) degrees)
                  • Set Mystical_Field_Check = (Mystical_Field_Check + 1)
                  • Special Effect - Create a special effect at Mystical_Field_SFX_Point using WaterAurora.mdx
                  • Set Mystical_Field_SFX[(Integer A)] = (Last created special effect)
                  • Countdown Timer - Start Mystical_Field_Timer as a One-shot timer that will expire in 0.05 seconds
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • And - All (Conditions) are true
                    • Conditions
                      • Mystical_Field_Check Greater than or equal to 30
                      • Mystical_Field_Check Less than or equal to 68
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Mystical_Field_Check Greater than 67
                    • Then - Actions
                    • Else - Actions
                      • Set Mystical_Field_Check = (Mystical_Field_Check + 1)
                      • Special Effect - Create a special effect at Mystical_Field_SFX_Point using WaterAurora.mdx
                      • Set Mystical_Field_SFX[(Integer A)] = (Last created special effect)
                      • Set Mystical_Field_SFX_Point = (Mystical_Field_Point offset by 300.00 towards ((Mystical_Field_Continue + 660.00) - ((Real((Integer A))) x 10.00)) degrees)
                      • Countdown Timer - Start Mystical_Field_Timer as a One-shot timer that will expire in 0.02 seconds
                • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Mystical_Field_Angle Equal to 1
        • Then - Actions
          • For each (Integer A) from Mystical_Field_Check to Mystical_Field_Check, do (Actions)
            • Loop - Actions
              • Special Effect - Destroy Mystical_Field_SFX[(Integer A)]
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Mystical_Field_Check Greater than 0
                • Then - Actions
                  • Set Mystical_Field_Check = (Mystical_Field_Check - 1)
                  • Countdown Timer - Start Mystical_Field_Timer as a One-shot timer that will expire in 0.05 seconds
                • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Mystical_Field_Check Equal to 68
        • Then - Actions
          • Countdown Timer - Start Mystical_Field_Timer_End as a One-shot timer that will expire in (10.00 + (1.50 x (Real((Level of Mystical Field for (Casting unit)))))) seconds
        • Else - Actions

Part 2 in next post.
 

Accname

2D-Graphics enthusiast
Reaction score
1,463
it seems you didnt copy those triggers correctly. As they are right now I personally cant read it.
But this:
Trigger:
  • Set Mystical_Field_Affected = Mystical_Field_Affected
can definitely not be good.
 

Zealot

Member
Reaction score
11
Trigger:
  • Mystical Field Replenish
    • Events
      • Time - Mystical_Field_Timer_Replenish expires
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Mystical_Field_Angle Equal to 0
        • Then - Actions
          • Countdown Timer - Start Mystical_Field_Timer_Replenish as a One-shot timer that will expire in 0.10 seconds
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Mystical_Field_Check Equal to 68
            • Then - Actions
              • Set Mystical_Field_Group = (Units within 300.00 of Mystical_Field_Point matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is hidden) Equal to False) and (((Matching unit) is in Mystical_Field_Affected) Equ
              • Unit Group - Pick every unit in Mystical_Field_Group and do (Actions)
                • Loop - Actions
                  • For each (Integer B) from 1 to (Mystical_Field_Total + 1), do (Actions)
                    • Loop - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Picked unit) Not equal to (Load (Integer B) of 1 in Mystical_Field_Table)
                        • Then - Actions
                          • Hashtable - Save Handle Of(Picked unit) as (Mystical_Field_Total + 1) of 1 in Mystical_Field_Table
                          • Hashtable - Save 0 as (Mystical_Field_Total + 1) of 2 in Mystical_Field_Table
                          • Set Mystical_Field_Total = (Mystical_Field_Total + 1)
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • ((Picked unit) is in Mystical_Field_Affected) Equal to False
                            • Then - Actions
                              • Unit Group - Add (Picked unit) to Mystical_Field_Affected
                            • Else - Actions
                          • Custom script: exitwhen true
                        • Else - Actions
              • Custom script: call DestroyGroup (udg_Mystical_Field_Group)
              • Unit Group - Pick every unit in Mystical_Field_Affected and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • And - All (Conditions) are true
                        • Conditions
                          • (Distance between (Position of (Picked unit)) and Mystical_Field_Point) Less than or equal to 300.00
                          • (Mana of (Picked unit)) Equal to (Max mana of (Picked unit))
                    • Then - Actions
                      • For each (Integer B) from 1 to Mystical_Field_Total, do (Actions)
                        • Loop - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Picked unit) Equal to (Load (Integer B) of 1 in Mystical_Field_Table)
                            • Then - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Real((Load (Integer B) of 2 from Mystical_Field_Table))) Less than (Max((50.00 x (Real((Level of Mystical Field for Mystical_Field_Caster)))), (3.00 x (Real((Intelligence of (Picked unit) (Include bonuses)))))))
                                • Then - Actions
                                  • Hashtable - Save ((Load (Integer B) of 2 from Mystical_Field_Table) + 1) as (Integer B) of 2 in Mystical_Field_Table
                                  • Unit - Add Mystical Field Mana to (Picked unit)
                                  • Unit - Increase level of Mystical Field Mana for (Picked unit)
                                  • Unit - Remove Mystical Field Mana from (Picked unit)
                                • Else - Actions
                            • Else - Actions
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Distance between (Position of (Picked unit)) and Mystical_Field_Point) Less than or equal to 300.00
                        • Then - Actions
                          • Unit - Set mana of (Picked unit) to ((Mana of (Picked unit)) + ((Max mana of (Picked unit)) x (0.01 x 0.40)))
                        • Else - Actions
            • Else - Actions
        • Else - Actions


Trigger:
  • Mystical Field CheckUp
    • Events
      • Time - Mystical_Field_Timer_End expires
    • Conditions
    • Actions
      • Set Mystical_Field_Angle = 1
      • Countdown Timer - Start Mystical_Field_Timer as a One-shot timer that will expire in 0.00 seconds
      • For each (Integer A) from 1 to Mystical_Field_Total, do (Actions)
        • Loop - Actions
          • For each (Integer B) from 1 to (Load (Integer A) of 2 from Mystical_Field_Table), do (Actions)
            • Loop - Actions
              • Unit - Add Mystical Field Mana Remove to (Load (Integer A) of 1 in Mystical_Field_Table)
              • Unit - Increase level of Mystical Field Mana Remove for (Load (Integer A) of 1 in Mystical_Field_Table)
              • Unit - Remove Mystical Field Mana Remove from (Load (Integer A) of 1 in Mystical_Field_Table)
      • Custom script: call DestroyGroup (udg_Mystical_Field_Affected)
      • Hashtable - Clear Mystical_Field_Table
 

Zealot

Member
Reaction score
11
it seems you didnt copy those triggers correctly. As they are right now I personally cant read it.
But this:
Trigger:
  • Set Mystical_Field_Affected = Mystical_Field_Affected
can definitely not be good.

The Group is destroyed at the end of the effect.
 

Accname

2D-Graphics enthusiast
Reaction score
1,463
But this does not create a new group.
What you do is:
null = null
which is equal to:
nothing

If you want to create a new unit group, but you want to do it with GUI only, then do something nonsensical like:
Trigger:
  • Set Mystical_Field_Affected =Units in Map of type (SOME_UNIT_TYPE_THAT_IS_NEVER_USED_IN_THE_MAP)

This, for example, will set the unit group to a new, empty unit group.
Other ways are possible too.
 

Zealot

Member
Reaction score
11
But this does not create a new group.
What you do is:
null = null
which is equal to:
nothing

If you want to create a new unit group, but you want to do it with GUI only, then do something nonsensical like:
Trigger:
  • Set Mystical_Field_Affected =Units in Map of type (SOME_UNIT_TYPE_THAT_IS_NEVER_USED_IN_THE_MAP)

This, for example, will set the unit group to a new, empty unit group.
Other ways are possible too.

Trigger:
  • Set Mystical_Field_Affected = (Units in (Playable map area) matching (((Matching unit) is loaded into (Matching unit)) Equal to True))

Is this okay or is too nonsensical? Bad part is this doesn't seem to be what's causing the weird issue.
 

Solu9

You can change this now in User CP.
Reaction score
216
You set Mystical_Field_Affected to be equal to itself in the very beginning. That makes no sense.

Also there are quite a few oddities in your trigger.

For each (Integer A) from Mystical_Field_Check to Mystical_Field_Check, do (Actions)
  • Loop - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • And - All (Conditions) are true
          • Conditions
            • Mystical_Field_Check Greater than or equal to 2
            • Mystical_Field_Check Less than or equal to 10
      • Then - Actions
        • Set Mystical_Field_SFX_Point = (Mystical_Field_Point offset by 100.00 towards ((Mystical_Field_Continue + 480.00) - ((Real((Integer A))) x 40.00)) degrees)

From what I can read.
For each (integer A) from 2 to 2, do (Actions) = it will loop only once.
And for the SFX part.
First of all it leaks. You set a point OFFSET by another point. You need to create 2 point variables. 1 for the target of the ability being cast and 1 that is offset by 100 towards xxxx.

Then onto the angle.
((Mystical_Field_Continue + 480) - ((Real(Integer A))) x 40.00)) degrees)
((((random 1 to 360) + 480) - ((2) x 40.00) degrees)

This means the angle will always be at least 400, no?
 

Accname

2D-Graphics enthusiast
Reaction score
1,463
Thats quite nonsensical, but a bad kind of it.
First of all its leaking a point right there, and second, this might be quite a bit more costly to check then picking all units of certain type, depending on how wc3's interna are implemented.

What you could also do is just clear the unit group at the end of your triggers instead of destroying them. If you clear a unit group it will also be emptied, but you can still add units to it.
 

Zealot

Member
Reaction score
11
You set Mystical_Field_Affected to be equal to itself in the very beginning. That makes no sense.

Also there are quite a few oddities in your trigger.

For each (Integer A) from Mystical_Field_Check to Mystical_Field_Check, do (Actions)
  • Loop - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • And - All (Conditions) are true
          • Conditions
            • Mystical_Field_Check Greater than or equal to 2
            • Mystical_Field_Check Less than or equal to 10
      • Then - Actions
        • Set Mystical_Field_SFX_Point = (Mystical_Field_Point offset by 100.00 towards ((Mystical_Field_Continue + 480.00) - ((Real((Integer A))) x 40.00)) degrees)
From what I can read.
For each (integer A) from 2 to 2, do (Actions) = it will loop only once.
And for the SFX part.
First of all it leaks. You set a point OFFSET by another point. You need to create 2 point variables. 1 for the target of the ability being cast and 1 that is offset by 100 towards xxxx.

Then onto the angle.
((Mystical_Field_Continue + 480) - ((Real(Integer A))) x 40.00)) degrees)
((((random 1 to 360) + 480) - ((2) x 40.00) degrees)

This means the angle will always be at least 400, no?

It is meant to loop once, because it creates one SFX and then it waits for the timer to make the new one.
Trigger:
  • Set Mystical_Field_Check = (Mystical_Field_Check + 1)

Trigger:
  • Countdown Timer - Start Mystical_Field_Timer as a One-shot timer that will expire in 0.10 seconds

I use it like this to use Interger A to save the Special Effect to an array.

I know it leaks but I'm first trying to make it functional before removing leaks.

The angle works perfectly though, because integer A constantly grows each time an SFX is spawned due to:
Trigger:
  • Set Mystical_Field_Check = (Mystical_Field_Check + 1)
 

Zealot

Member
Reaction score
11
Thats quite nonsensical, but a bad kind of it.
First of all its leaking a point right there, and second, this might be quite a bit more costly to check then picking all units of certain type, depending on how wc3's interna are implemented.

What you could also do is just clear the unit group at the end of your triggers instead of destroying them. If you clear a unit group it will also be emptied, but you can still add units to it.

So empty unit groups don't leak I take it?
 

Accname

2D-Graphics enthusiast
Reaction score
1,463
A leak is only when you can no longer access a variable.
Any unit group, which is NOT accessible by a variable, is a leak.
If you have a variable, and that variable is pointing to a unit group, no matter whether its empty or full, or nonexistant, or anything, is not considered a memory leak.
 

Zealot

Member
Reaction score
11
No. Because you use the same group over and over. You are not creating a new one.
A leak is only when you can no longer access a variable.
Any unit group, which is NOT accessible by a variable, is a leak.
If you have a variable, and that variable is pointing to a unit group, no matter whether its empty or full, or nonexistant, or anything, is not considered a memory leak.

Alright I'll empty it instead of destroying it, maybe this fixes something.
 

Zealot

Member
Reaction score
11
Ok, the unit group is now emptied at the end of the trigger.
Trigger:
  • Unit Group - Remove all units from Mystical_Field_Affected


And I've found out something new. The trigger works the second time, but only a part of it. Units that do not have maximum mana regain mana until they are at maximum, but maximum mana will not increase like the first time the spell is cast.
The issue about the 2 random SFX remain.
 

Solu9

You can change this now in User CP.
Reaction score
216
Are you using a spell that works on units with full mana?
 

Zealot

Member
Reaction score
11
Are you using a spell that works on units with full mana?
No need for that.
The units are picked by:
Trigger:
  • Set Mystical_Field_Group = (Units within 300.00 of Mystical_Field_Point matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is hidden) Equal to False) and (((Matching unit) is in Mystical_Field_Affected) Equ


Then they are placed in the hashtable:
Trigger:
  • Hashtable - Save Handle Of(Picked unit) as (Mystical_Field_Total + 1) of 1 in Mystical_Field_Table


And lastly added to a new unit group so they won't be picked again in the first group.
Trigger:
  • Unit Group - Add (Picked unit) to Mystical_Field_Affected


Effect.jpgBug.jpg

Also here are two screenshots showcasing the SFX bug.
 

Zealot

Member
Reaction score
11
Ok, I've narrowed the ability not working the second time to this part, or so I believe.
Trigger:
  • Unit Group - Pick every unit in Mystical_Field_Affected and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • (Distance between (Position of (Picked unit)) and Mystical_Field_Point) Less than or equal to 300.00
              • (Mana of (Picked unit)) Equal to (Max mana of (Picked unit))
        • Then - Actions
          • For each (Integer B) from 1 to Mystical_Field_Total, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Picked unit) Equal to (Load (Integer B) of 1 in Mystical_Field_Table)
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Real((Load (Integer B) of 2 from Mystical_Field_Table))) Less than (Max((50.00 x (Real((Level of Mystical Field for Mystical_Field_Caster)))), (3.00 x (Real((Intelligence of (Picked unit) (Include bonuses)))))))
                    • Then - Actions
                      • Hashtable - Save ((Load (Integer B) of 2 from Mystical_Field_Table) + 1) as (Integer B) of 2 in Mystical_Field_Table
                      • Unit - Add Mystical Field Mana to (Picked unit)
                      • Unit - Increase level of Mystical Field Mana for (Picked unit)
                      • Unit - Remove Mystical Field Mana from (Picked unit)
                    • Else - Actions
                • Else - Actions
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Distance between (Position of (Picked unit)) and Mystical_Field_Point) Less than or equal to 300.00
            • Then - Actions
              • Unit - Set mana of (Picked unit) to ((Mana of (Picked unit)) + ((Max mana of (Picked unit)) x (0.01 x 0.40)))
            • Else - Actions
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though

      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