[INFO] Best way to implement spell cooldowns.

Post » Mon Jun 18, 2012 11:26 pm

SO I am ggoing to be doing spell cooldowns for some work I am on, and am thinking of having each spell call a "dummy magical effect" that doesnt show up in the spellbook etc. This effect will have a duration equivalent to teh cooldown time I want, and then upon the cast of each spell, I will perform a script check that will stop it casting if this dummy effect is still present on the actor.


IS there a more elegant/ efficient way of doing this?

Thanks!
User avatar
Juan Cerda
 
Posts: 3426
Joined: Thu Jul 12, 2007 8:49 pm

Post » Mon Jun 18, 2012 9:21 am

You do realize there is a text field exactly for this in the bottom right hand of your spell form?
Im at work, so I cannot point you to the exact area and its name... but it is in there. Something like "Recast Timer"
I dont remember it offhand.
User avatar
Tanya
 
Posts: 3358
Joined: Fri Feb 16, 2007 6:01 am

Post » Mon Jun 18, 2012 11:04 pm

Hmm I thought there would be, but I couldnt find it. Just charge time, spell cost and duration.

(charge time being the time it takes to cast the spell)
User avatar
Jynx Anthropic
 
Posts: 3352
Joined: Fri Sep 08, 2006 9:36 pm

Post » Mon Jun 18, 2012 2:35 pm

When I get home... Ill locate it for you.
User avatar
Marcus Jordan
 
Posts: 3474
Joined: Fri Jun 29, 2007 1:16 am

Post » Mon Jun 18, 2012 12:22 pm

Are you sure its a cooldown field and not a cast time field? I'm pretty sure its the latter.
User avatar
Rob Smith
 
Posts: 3424
Joined: Wed Oct 03, 2007 5:30 pm

Post » Mon Jun 18, 2012 11:15 am

Are you sure its a cooldown field and not a cast time field? I'm pretty sure its the latter.

Its possible I am remembering it wrong... yes...
Still gonna check when I get home :confused:
User avatar
Dagan Wilkin
 
Posts: 3352
Joined: Fri Apr 27, 2007 4:20 am

Post » Mon Jun 18, 2012 1:25 pm

hmm, well if you are wrong; I just tried my proposal and it is actualy pretty good to use a dummy cast on self effect. The best thing is, you can create one, and call it in many spells, essentialy giving a global cooldown, or create individual ones to give "spell specific" cooldowns.

Even better, with each spell, you can call this dummy effect with a different duration with each spell. overall, it is a pretty versatile system (and you can choose to show or hide the dummy effect for debug purposes).

Here is the check I am using in my sript
\!(selfRef.HasMagicEffect(DummySpellEffect))
User avatar
Zualett
 
Posts: 3567
Joined: Mon Aug 20, 2007 6:36 pm


Return to V - Skyrim