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.

      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