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

[Trigger] Set Casting Time of ability not working

Level 4
Joined
Jan 31, 2019
Messages
16
Hello everyone

As the title says, i'm using the function Ability - Set Ability Real Level Field trying to customize the casting time of abilities, but is not working and i dont know why.

  • Untitled Trigger 001
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
    • Actions
      • Ability - Set Ability: (Unit: (Triggering unit)'s Ability with Ability Code: (Ability being cast))'s Real Level Field: Casting Time ('acas') of Level: ((Level of (Ability being cast) for (Triggering unit)) - 1) to 3.00
      • Game - Display to (All players) the text: (String((Ability: (Unit: (Triggering unit)'s Ability with Ability Code: (Ability being cast))'s Real Level Field Casting Time ('acas'), of Level: ((Level of (Ability being cast) for (Triggering unit)) - 1))))
This is not the exact trigger that i am using but i try it many ways and it just dosn't work. As you can see in this trigger i even put a display of this value to verify if is changing, and actually it shows that value does change but it seems like it has not real effect in the actual game because in testing it just dosn't change anything.
 
Level 20
Joined
Aug 29, 2012
Messages
832
Have you tried modifying it in another trigger (i.e. before the spell is actually cast)? Doesn't it work for subsequent casts?

Also, I'm a bit puzzled about the level of the ability - 1 and then the display text for the level of the ability, where does that -1 come from?
 
Level 39
Joined
Feb 27, 2007
Messages
5,023
Also, I'm a bit puzzled about the level of the ability - 1 and then the display text for the level of the ability, where does that -1 come from?
Many (but not all) of the level-fields are 0-indexed rather than 1-indexed.

I agree with Chaosium's suggestion that the modification is probably happening too late to affect the cast that runs the trigger; this thread suggests Begins Channeling should happen before Begins Casting and Starts the Effect but it's still the first thing I'd check on. Unless you truly want the cast time to be dynamically determined right before the cast goes off, there are a variety of other events you could use to instead modify the cast time well before it's actually cast.

Second, many of the ability fields don't use their updated level values until their level is changed and the data is forcibly loaded. This just means set it to any other level and then set it back to whatever it already was. You could do a +1 -1, but that won't work if the ability is at max level; and -1 +1 will similarly fail at minimum level, so you'll need a small amount of logic.
  • Set LVL = (Level of (Ability being cast) for (Triggering Unit))
  • If (All conditions are true) then do (Then actions) else do (Else actions)
    • If - Conditions
      • LVL greater than 1
      • Then - Actions
        • Set TGT = (LVL - 1)
      • Else - Actions
        • Set TGT = (LVL + 1)
  • Unit - Set level of (Ability being cast) for (Triggering Unit) to TGT
  • Unit - Set level of (Ability being cast) for (Triggering Unit) to LVL
 
Last edited:
Level 4
Joined
Jan 31, 2019
Messages
16
I did try to modify it before with others events, even just to see if the funciton actually works, and it didn't work neither.

But i haven't try changing the level, let me see if that works.

EDIT: I tried it... and it didn't work :cry:
 
Last edited:
Level 4
Joined
Jan 31, 2019
Messages
16
Funny, i discoverded that even if you change the casting time per level of an ability, it actually DOES NOT change when you levelup the ability.

1713306667541.png


This is Thunder clap, i tested it, and the Casting Time was 3 seconds for all three levels of the ability, even when i have it like this in the Object editor.
 
Level 20
Joined
Feb 27, 2019
Messages
593
Seems fucked. Engineering upgrade = no. Tried some other things but no. It seems broken on a deep level, even if the value on the ability is technically correct. Id say work around it.
 
Level 4
Joined
Jan 31, 2019
Messages
16
Have you tried "refreshing" the ability? That's sometimes necessary:
  • Ability - Set Ability Field...
  • Unit - Increase level of ability
  • Unit - Decrease level of ability
I recall Casting Time being modifiable.
Tried it, didn't work.

I think there is something just broken. Not that surprising at this point tbh...
 
Level 20
Joined
Feb 27, 2019
Messages
593
i'm using the function Ability - Set Ability Real Level Field trying to customize the casting time of abilities
How were you thinking of allowing the players to adjust the casting time of their abilities? F.e. an item that decreases casting time by 10% or Level 1 has 1 second, 2 0.5 and 3. 0 or many different ways? Aka what are you trying to achieve?
 
Last edited:
Level 4
Joined
Jan 31, 2019
Messages
16
How were you thinking of allowing the players to adjust the casting time of their abilities? F.e. an item that decreases casting time by 10% or Level 1 has 1 second, 2 0.5 and 3. 0 or many different ways? Aka what are you trying to achieve?
A lot of my spells have Casting Time, so i was trying to do a system that could modify this value, so for example i can create a spell that reduces the Casting Time of a unit 20% for a given time, making that this unit cast his spells faster, it also could be made with, for instance, a item, or an aura, etc. Basicaly a buff.
Yeah, I tested it a bunch and it doesn't work. I think I was using Channel's Follow Through Time instead.
The "Casting system" that i'm using is something very similar to Progress Casting Bar MUI GUI. And i don't know if there is other way of doing something like this without the Casting Time value that abilities have. I don't what does that thing that you mentioned.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,565
A lot of my spells have Casting Time, so i was trying to do a system that could modify this value, so for example i can create a spell that reduces the Casting Time of a unit 20% for a given time, making that this unit cast his spells faster, it also could be made with, for instance, a item, or an aura, etc. Basicaly a buff.

The "Casting system" that i'm using is something very similar to Progress Casting Bar MUI GUI. And i don't know if there is other way of doing something like this without the Casting Time value that abilities have. I don't what does that thing that you mentioned.
Channel is an ability meant to be used with triggers. It has a Follow Through Time field which determines how long you can channel it.

Unfortunately, this would only be useful to your Progress Bar system if you had triggered all of your spells, which I assume you did not.
 
Level 4
Joined
Jan 31, 2019
Messages
16
Channel is an ability meant to be used with triggers. It has a Follow Through Time field which determines how long you can channel it.

Unfortunately, this would only be useful to your Progress Bar system if you had triggered all of your spells, which I assume you did not.
Actually a lot of my spells are made with triggers, also i don't have that many right now, so changing them might be pretty easy. I'm curious though, if i can utilize that Follow Through Time field to make a Casting system including the Progress Bar
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,565
Actually a lot of my spells are made with triggers, also i don't have that many right now, so changing them might be pretty easy. I'm curious though, if i can utilize that Follow Through Time field to make a Casting system including the Progress Bar
Yes, you could do that. Just first confirm that Follow Through Time can be modified via triggers, which last I remember it can.
 
Level 4
Joined
Jan 31, 2019
Messages
16
Yes, you could do that. Just first confirm that Follow Through Time can be modified via triggers, which last I remember it can.
Yeah i already did it, it can be modify. And chaning the system was really easy too hehe. Not so sure why i was using that value in first place...

Well, thanks you a lot man.
 
Top