Tutorial Casting Speed

A

acuben

Guest
Setting Casting Speed for a spell(s)
Difficulty: easy
Tools required: none, only use of triggers.
What does this do: Instead of having a fixed casting time. You can increase casting speed with buffs/items/auras/etc.




First of all. It's not really a smooth, bug-proof trigger so if you find any problems, feel free to post it. Besides, I don think I know much about these map editting much anyways...

If someone have a better version, oh well :>


Variables
CSTriggerIsOn (array) - default: false (Boolean variable)
Caster (array) (unit variable)
PlayerNumb (Integer variable)

Event:
Unit - A unit begins channeling an Ability // i guess you can try "Begin casting an ability" also, but that might not work, dunno why. It's worth a try tho

Condition:
( Ability being cast ) = Fireball //not required if you want to apply casting speed for every spell.
CSTriggerIsOn[Player number] = Equal to false

Action:
Set CSTriggerIsOn[Player number] = true // Or u can move this trigger down and use...
// Set CSTriggerIsOn[Variable(PlayerNumb)] = true.
//This Trigger is to prevent trigger being run again before it ends. I think there may be more efficient way to do this... iono, lemme know.


Set PlayerNumb = Player number //This trigger is to remember the owner of the casting unit. Reason why this is useful is when other player with same unit cast something, there won't be collision. It's not required if this trigger only applies to one player

Set Caster[Player number] or Set Caster[Variable(PlayerNumb)]
//This trigger is to remember whatever the casting unit is

//now to pause the caster.
unit- pause Caster[Player Number]

Wait - 5 seconds // Right here is fixed time, but you can make Item/buff comparison and use some math to subtract the time using If/then/Multiple action Trigger

Unit - unpause Caster[variable(PlayNumb)] // really I was hoping this trigger didn't cause any problem by unpausing every "Caster" Variable for every player. I guess time will tell.

Set Variable - Set CSTriggerIsOn = false // required to run this trigger again.


For Casting Speed (I don' think most of you need this party anyways)
set variable: CastingSpd (Array) (integer) (Default: 100)
and if there is an item that provides 20% casting speed. Add 20 to CastingSpd variable. If it's dropped, subtract 20.

If a spell requires 5 seconds to cast (for simplicity)
Casting Time can be... (and let's assume you have a buff that increase the casting speed by 30% and it's called Haste)
5 * 100 / [ CastingSpd(player1) + (If there is Haste buff, add 30, else do nothing)]

And that number can be substituted for "5 seconds" in the trigger above

***
And Finally, if you want to add casting speed "interference". I guess you can make another trigger to order a casting unit to stop (or chance to stop) when attacked while CSTriggerIsOn variable is true while unpausing that unit. Another trigger to do the same when the player types "s" for stop... meh >_>



TroubleShoot:
If your unit is paused and never unpaused (if that happens, please let me know).
Try increasing Casting speed in Object editor and before pausing in triggers
For e.g. in Object editor
Make Firebolt cast time to 0.20 sec
And in Trigger, try "Wait - 0.10 sec" Trigger after setting the variables.



Current Limitation:
1. 1 per player, unless other triggers are used to modify it. Quiet annoying, but shouldn't be impossible.
edit: ...actually right now, I don't think it even supports more than 2 players. I would have to modify it a bit... later. Do tell me if it works :D.

Unit - unpause Caster[variable(PlayNumb)] // really I was hoping this trigger didn't cause any problem by unpausing every "Caster" Variable for every player. I guess time will tell.
If I change this part to "Unit - unpause Caster[Player number of (triggering player)]" would it work? Normally it seems like WE forget what the "triggering player" is after using "wait" action...

2. It can be abused, buggy if the timing isn't right. If you cancel spell right after you are unpaused. Well you canceled it. If you cast the spell right after, you can cast the spell "instantly" this time.



other notes: don't expect too much from me, i'm newb

i made this for myself mainly. It seemed like Buffer/Debuffer mage classes in my rpg had no use of magic power bonus from magic weapons (staff, rod, etc). Well, now they do ;p

comment? suggestion(plz!)? criticism?
 

gref

New Member
Reaction score
33
Couple of points:
A) it pauses the caster so you can't cancel casting a spell. If you are making a custom system you really should make it so that spells can be aborted before they are cast.
B) Tidy it up a bit 00.
 
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