spell doesn't end slow

Ryuu

I am back with Chocolate (:
Reaction score
64
Hey all ! I have this spell.
This trigger initializes the spell:

Trigger:
  • hitsugaya shikai
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Shikai (Hitsugaya)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • hitsu_shikai_caster_count Equal to 8000
        • Then - Actions
          • Set hitsu_shikai_caster_count = 1
        • Else - Actions
          • Set hitsu_shikai_caster_count = (hitsu_shikai_caster_count + 1)
      • Set hitsu_shikai_boolean[hitsu_shikai_caster_count] = True
      • Set hitsu_shikai_caster[hitsu_shikai_caster_count] = (Triggering unit)
      • Unit - Add Summon Dragon to (Triggering unit)


This trigger slows the attacked unit:

Trigger:
  • hitsugaya shikai hit
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Hitsugaya Toshiro
    • Actions
      • For each (Integer A) from 1 to hitsu_shikai_caster_count, 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
                  • (Attacking unit) Equal to hitsu_shikai_caster[(Integer A)]
                  • hitsu_shikai_boolean[(Integer A)] Equal to True
            • Then - Actions
              • Unit - Set (Attacked unit) movement speed to ((Current movement speed of (Attacked unit)) / 2.00)
              • Animation - Change (Attacked unit)'s vertex coloring to (0.00%, 75.00%, 0.00%) with 0.00% transparency
              • Set hitsu_shikai_waitlist[(Integer A)] = True
              • Set hitsu_shikai_slowed_unit[(Integer A)] = (Attacked unit)
            • Else - Actions


This trigger is SUPPOSED to end the slow:

Trigger:
  • hitsugaya shikai slow end
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to hitsu_shikai_caster_count, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • hitsu_shikai_waitlist[(Integer A)] Equal to True
            • Then - Actions
              • Set hitsu_shikai_slow_timer[(Integer A)] = (hitsu_shikai_slow_timer[(Integer A)] + 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • hitsu_shikai_slow_timer[(Integer A)] Equal to 12000
                • Then - Actions
                  • Set hitsu_shikai_slow_timer[(Integer A)] = 0
                  • Unit - Set hitsu_shikai_slowed_unit[(Integer A)] movement speed to (Current movement speed of hitsu_shikai_slowed_unit[(Integer A)])
                  • Animation - Change hitsu_shikai_slowed_unit[(Integer A)]'s vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
                • Else - Actions
            • Else - Actions


But, the slow duration doesn't end. The unit seems to be slowed forever.
Is there a way to make it so that the slow ends?
 

azareus

And you know it.
Reaction score
63
Post GUI in GUI tags.(Noone would have firgured:p)
Very hard to read else.
 

Ryuu

I am back with Chocolate (:
Reaction score
64
It should work by slowing the unit for 2 seconds. But it doesnt. It slows FOREVER.
 

kaboo

New Member
Reaction score
45
ok ive gone through the code for five times and i think im starting to understand it a little,

now to your problem, there are two possibilities that should be checked:
  1. -Set hitsu_shikai_slow_timer[(Integer A)] = (hitsu_shikai_slow_timer[(Integer A)] + 1)
    -this timer is not reseted to 0 when the spell is casted again
  2. -Unit - Set hitsu_shikai_slowed_unit[(Integer A)] movement speed to (Current movement speed of hitsu_shikai_slowed_unit[(Integer A)])
    -you dont do anything with the move speed (its like: set 1 = 1)
 

Ryuu

I am back with Chocolate (:
Reaction score
64
Alright, I don't really get your no. 1, but I did change no. 2.
Though, still no difference.

Last trigger update:

Trigger:
  • hitsugaya shikai slow end
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to hitsu_shikai_caster_count, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • hitsu_shikai_waitlist[(Integer A)] Equal to True
            • Then - Actions
              • Set hitsu_shikai_slow_timer[(Integer A)] = (hitsu_shikai_slow_timer[(Integer A)] + 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • hitsu_shikai_slow_timer[(Integer A)] Equal to 12000
                • Then - Actions
                  • Set hitsu_shikai_slow_timer[(Integer A)] = 0
                  • Unit - Set hitsu_shikai_slowed_unit[(Integer A)] movement speed to ((Current movement speed of hitsu_shikai_slowed_unit[(Integer A)]) x 2.00)
                  • Animation - Change hitsu_shikai_slowed_unit[(Integer A)]'s vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
                • Else - Actions
            • Else - Actions
 

Moridin

Snow Leopard
Reaction score
144
The error is in:

-Unit - Set hitsu_shikai_slowed_unit[(Integer A)] movement speed to (Current movement speed of hitsu_shikai_slowed_unit[(Integer A)])

Though kaboo is right. There are other errors in your code as well.

1)
Set hitsu_shikai_slow_timer[(Integer A)] = (hitsu_shikai_slow_timer[(Integer A)] + 1)
-this timer is not reseted to 0 when the spell is casted again

2) In hitsugaya shikai hit:

For each (Integer A) from 1 to hitsu_shikai_caster_count, do (Actions)

* Loop - Actions
o If (All Conditions are True) then do (Then Actions) else do (Else Actions)

The loop should be from 1 to 8000, according to your MUI attempt, not to the counter variable...else when the counter gets reset in the beginning no other unit will get affected.
 

Ryuu

I am back with Chocolate (:
Reaction score
64
1. I still don't get it. The variable 'hitsu_shikai_slow_timer' is an array variable. This variable is unique for every time the spell is casted. Why do I need to set it to 0 when I no longer use the variable anymore?

2. Done. Nope, no change.

Updated 'hitsugaya shikai hit':

Trigger:
  • hitsugaya shikai hit
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Hitsugaya Toshiro
    • Actions
      • For each (Integer A) from 1 to 8000, 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
                  • (Attacking unit) Equal to hitsu_shikai_caster[(Integer A)]
                  • hitsu_shikai_boolean[(Integer A)] Equal to True
            • Then - Actions
              • Unit - Set (Attacked unit) movement speed to ((Current movement speed of (Attacked unit)) / 2.00)
              • Animation - Change (Attacked unit)'s vertex coloring to (0.00%, 100.00%, 0.00%) with 0.00% transparency
              • Set hitsu_shikai_waitlist[(Integer A)] = True
              • Set hitsu_shikai_slowed_unit[(Integer A)] = (Attacked unit)
            • Else - Actions
 

kaboo

New Member
Reaction score
45
1. just try it


and
do i understand it correctly when i say that the spell is only like self buff and after its casting the caster will slow units that he attacks for 2 seconds?
 

Ryuu

I am back with Chocolate (:
Reaction score
64
Alright. Erm, so what I need to do now is to place

Trigger:
  • For each (Integer A) from 1 to hitsu_shikai_caster_count, do (Actions)
    • Loop - Actions
      • Set hitsu_shikai_slow_timer[(Integer A)] = 0


at the top of the Actions of the trigger 'hitsugaya shikai'?

kaboo said:
do i understand it correctly when i say that the spell is only like self buff and after its casting the caster will slow units that he attacks for 2 seconds?

Yup, kaboo, you're right.
 

Moridin

Snow Leopard
Reaction score
144
Array variable it might be, but it isn't being reset every time it's used.

Ex: Integer A = 1 to 10
Array variable is default 1
Gets incremented to 10

Spell is used again
Integer A = 1 to 10
Array variable is 10 (from last time)
Gets incremented to 20.

You see? You're not resetting it along with Integer A. It's independent.
 

Ryuu

I am back with Chocolate (:
Reaction score
64
Alright, but is this the right way of doing it?

Trigger:
  • For each (Integer A) from 1 to hitsu_shikai_caster_count, do (Actions)
    • Loop - Actions
      • Set hitsu_shikai_slow_timer[(Integer A)] = 0


at the top of the Actions of the trigger 'hitsugaya shikai'?
 

kaboo

New Member
Reaction score
45
Alright. Erm, so what I need to do now is to place

Trigger:
  • For each (Integer A) from 1 to hitsu_shikai_caster_count, do (Actions)
    • Loop - Actions
      • Set hitsu_shikai_slow_timer[(Integer A)] = 0


at the top of the Actions of the trigger 'hitsugaya shikai'?
try adding it to the end of second trigger
Code:
# Set hitsu_shikai_waitlist[(Integer A)] = True
# Set hitsu_shikai_slow_timer[(Integer A)] = 0
# Set hitsu_shikai_slowed_unit[(Integer A)] = (Attacked unit)


Yup, kaboo, you're right.
though so, then there are more problems with it
  1. when he casts the spell, he will have the buff forever, or at least until 8000 more other units cast the spell
  2. when he cast the spell twice, for example, he will be caster 4 and 7, the attacked unit will get movement speed slow twice too, that means movement speed/2 and then slowed movement speed/2; and when he casts it again and again the slow will stack
 

Ryuu

I am back with Chocolate (:
Reaction score
64
Yeah, i added it already.
No difference at all!

Anyway,

kaboo said:
when he casts the spell, he will have the buff forever, or at least until 8000 more other units cast the spell

Well, the attacked unit is supposed to be slowed for only 2 seconds.

kaboo said:
when he cast the spell twice, for example, he will be caster 4 and 7, the attacked unit will get movement speed slow twice too, that means movement speed/2 and then slowed movement speed/2; and when he casts it again and again the slow will stack

Nope, it won't. The caster's attacks are slow. It won't stack.
 

N(O.O)B

New Member
Reaction score
27
Yeah, i added it already.
No difference at all!

Anyway,



Well, the attacked unit is supposed to be slowed for only 2 seconds.



Nope, it won't. The caster's attacks are slow. It won't stack.

Why not just create a dummy unit that casts "Slow" on the target it's attacking that lasts for 2 seconds? That'd probably lag a LOT less than checking if there's something that has to be removed every 0.01 seconds
 

Ryuu

I am back with Chocolate (:
Reaction score
64
alright, thanks for the tip.
Yup, I should have guessed that all along..

Anyways, I have encountered a new problem.
There is now only two triggers:

Trigger:
  • hitsu shikai
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Shikai (Hitsugaya)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • hitsu_shikai_caster_count Equal to 8000
        • Then - Actions
          • Set hitsu_shikai_caster_count = 1
        • Else - Actions
          • Set hitsu_shikai_caster_count = (hitsu_shikai_caster_count + 1)
      • Unit - Pause (Triggering unit)
      • Sound - Play SotenNisaseHyorinmaru <gen>
      • Set hitsu_shikai_check[hitsu_shikai_caster_count] = True
      • Animation - Play (Triggering unit)'s stand ready animation
      • Special Effect - Create a special effect attached to the origin of (Triggering unit) using ChillingAura.MDX
      • Set hitsu_shikai_sfx[hitsu_shikai_caster_count] = (Last created special effect)
      • Set hitsu_shikai_caster[hitsu_shikai_caster_count] = (Triggering unit)
      • Unit - Unpause (Triggering unit)


and

Trigger:
  • hitsu shikai attack
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • For each (Integer A) from 1 to hitsu_shikai_caster_count, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • hitsu_shikai_caster[(Integer A)] Equal to (Attacking unit)
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • hitsu_shikai_check[(Integer A)] Equal to True
                • Then - Actions
                  • Set hitsu_shikai_target_loc = (Position of (Attacked unit))
                  • Unit - Create 1 hitsu_shikai_slow_dummy for (Owner of (Attacking unit)) at hitsu_shikai_target_loc facing Default building facing degrees
                  • Custom script: call RemoveLocation(udg_hitsu_shikai_target_loc)
                  • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
                  • Unit - Order (Last created unit) to Human Sorceress - Slow (Attacked unit)
                • Else - Actions
            • Else - Actions


The slow and everything works perfectly fine.
However, the spell seems to be casted thrice even though I only cast it once.
Can anyone find the problem?

- How I realised this was because my spell only costs 100 mana, but when I cast it, it costs 300 mana. And, I gave my dummy unit a model, and found that when I cast my spell, 3 of it were spawned.

Why is this so?
 

Summoned

New Member
Reaction score
51
If it was based on Channel, that sometimes happens when you have an ability with 0 second cooldown.

As for why there are 3 dummies, it's because the spell was cast three times, your caster is then set to hitsu_shikai_caster[1], hitsu_shikai_caster[2], and hitsu_shikai_caster[3]. So the second trigger casts the slow 3 times.


I have a question though. Why not base the ability on a self-buff like Roar, then use a trigger like this:
Trigger:
  • randomtriggername
    • Events
      • A Unit is attacked
    • Conditions
      • (Attacking Unit) has buff CustomRoarBuff equal to True
    • Actions
      • Create dummy, cast slow, etc.
 

Ryuu

I am back with Chocolate (:
Reaction score
64
> As for why there are 3 dummies, it's because the spell was cast three times, your caster is then set to hitsu_shikai_caster[1], hitsu_shikai_caster[2], and hitsu_shikai_caster[3]. So the second trigger casts the slow 3 times.

Yeap, I know. But why is it cast 3 times? I've checked over and over. I only clicked on the skill ONCE. And it runs the trigger as thought I've clicked THRICE.

> Why not base the ability on a self-buff like Roar

Nope, Roar does not work in my situation.
My spell is actually intended to 'activate' a form, allowing the caster to slow every enemy it hits. It is not an aura or a spell like Roar.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • 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
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top