Hey all. Does anyone know if there is a way to add a cool down timer to an item on use, so it cannot be used frequently, kind of similar to the timers barbarian rage has?
Cool Downs on Item Use
Débuté par
Lucrane
, nov. 03 2010 07:32
#1
Posté 03 novembre 2010 - 07:32
#2
Guest_Chaos Wielder_*
Posté 03 novembre 2010 - 07:40
Guest_Chaos Wielder_*
Do you have scripting knowledge? If so, you could put a local int on the item to limit uses.
#3
Posté 03 novembre 2010 - 10:11
I'm aware of how to link item on use to scripts and have done it for several actions, but I am not sure where or how to implement a cool down on an item
**Edit, I don't want limited uses, that can be done on an item anyway. What I am looking for is after you use an item, like the rage ability, there is a cool down from which it cannot be used again, i.e. used item, then on cool down for about 30 secs.
**Edit, I don't want limited uses, that can be done on an item anyway. What I am looking for is after you use an item, like the rage ability, there is a cool down from which it cannot be used again, i.e. used item, then on cool down for about 30 secs.
Modifié par Lucrane, 03 novembre 2010 - 10:12 .
#4
Posté 03 novembre 2010 - 10:37
Its easy enough to restrict that use of the item to every 30 seconds or whatever, but putting a "fill up the icon, when full ready to use again" type thing - no idea if that's even possible.
#5
Guest_Chaos Wielder_*
Posté 03 novembre 2010 - 11:17
Guest_Chaos Wielder_*
Yeah, if you want the icon for the item to light up or darken based on if it can be used or not, I don't think that's possible.
#6
Posté 03 novembre 2010 - 11:19
what Knightmare said is right on point, that's exactly what I am after a restriction on item use for a specified time or so. Not sure how to do that with the script and on unique power use self, etc. How can use be restricted by time?
#7
Guest_Chaos Wielder_*
Posté 03 novembre 2010 - 11:22
Guest_Chaos Wielder_*
Set a local int on an item and then have a delay command of 30 seconds to delete that int. The int prevents the item from activating.
#8
Posté 04 novembre 2010 - 05:19
Yes, and if it is a weapon you can build the cool down limitation into an "_hc" script that stores the re-activate time stamp as a local variable. The On-hit effect then only goes off if the current time is past the stored time. &c.
It might be possible to do some sort of charge-up effect with a unique power: when you activate the power, it adds in a couple of charges after some delay interval. This allows one of the charge-based powers in the object to be used. (If you start with an odd number of charges and the powers always use an even number, the object won't disappear when the allowed charges are used up. E.g. allow up to three charges in the item, with two charges per power use.)
It might be possible to do some sort of charge-up effect with a unique power: when you activate the power, it adds in a couple of charges after some delay interval. This allows one of the charge-based powers in the object to be used. (If you start with an odd number of charges and the powers always use an even number, the object won't disappear when the allowed charges are used up. E.g. allow up to three charges in the item, with two charges per power use.)
Modifié par rjshae, 04 novembre 2010 - 05:25 .
#9
Posté 04 novembre 2010 - 09:11
You should try one of the solutions rjshae suggested. The first one is also possible for spell-like powers, just check at the beginning of the _ac script if the cooldown time has passed. If not, just return.
The second should have the advantage that the icon is greyed out during the cooldown. However, if the player saves the game during the cooldown, and reloads, the delayed command is lost, thus the item never recharges. ChaosWielder's approach has the same problem.
The second should have the advantage that the icon is greyed out during the cooldown. However, if the player saves the game during the cooldown, and reloads, the delayed command is lost, thus the item never recharges. ChaosWielder's approach has the same problem.
#10
Posté 04 novembre 2010 - 09:54
diophant wrote...
The second should have the advantage that the icon is greyed out during the cooldown. However, if the player saves the game during the cooldown, and reloads, the delayed command is lost, thus the item never recharges. ChaosWielder's approach has the same problem.
You can just allow them to hit the recharge unique power at any time. If a recharge is in progress, it can just be ignored by the activate script. Otherwise it will re-initiate the charge-up that you lost because of, say, a save/exit. (Floaty strings for feedback when the recharge is starting and when it's complete would probably be a nice touch.)
Modifié par rjshae, 04 novembre 2010 - 09:56 .
#11
Posté 08 novembre 2010 - 08:56
I like Rjshae's idea I will try and implement that. It's not a weapon though it's an item like a relic. I never thought of the charge up before that could be interesting to do.
Right now though I should work on getting an on item activate script going that sets the local int for the item and then removes it after x time to get a cool down effect, correct?
I've never store a local int before, outside of setlocalint, and delaycommand, I am not sure what else I should do.
Also, the template for on item use/activate scripts is still i_<itemtag>_ac, correct?
Right now though I should work on getting an on item activate script going that sets the local int for the item and then removes it after x time to get a cool down effect, correct?
I've never store a local int before, outside of setlocalint, and delaycommand, I am not sure what else I should do.
Also, the template for on item use/activate scripts is still i_<itemtag>_ac, correct?
#12
Posté 09 novembre 2010 - 10:18
Got it working in a way. What I have is its restricted use for 30 secs, if the item is attempted to be used in 30 secs a floating text appears saying that it can't be.
After 30s it resumes use as normal. Each use creates an item in the inventory, that when 10 are present in the inventory and the item is used again, something different happens now.
What I am lacking is the icon for the item "graying" out, which I don't think is possible, and having an actual countdown over the item, which I am not sure is possible either. These last things are just cosmetic, but other than that it works just fine. Thanks all.
After 30s it resumes use as normal. Each use creates an item in the inventory, that when 10 are present in the inventory and the item is used again, something different happens now.
What I am lacking is the icon for the item "graying" out, which I don't think is possible, and having an actual countdown over the item, which I am not sure is possible either. These last things are just cosmetic, but other than that it works just fine. Thanks all.
#13
Posté 09 novembre 2010 - 11:58
It seems to me (and I am quite ignorant of how it all works as a unit) that the "charging" effect of when you are allowed to attack in combat, either with a melee or ranged weapon would be applicable here and I don't see why the graying timer effect on those icons should be only on those icon effects. Of course, please re-read my whole, "I am quite ignorant of how it all works as a unit," comment if I am completely talking out my backside.
Logically, though, the combat icon has a grey sliding sheet effect that acts as a timer for the weapon selected during combat (and it's just a timer that tells you when you can strike again, but you don't automatically strike again when it's 'ready') and this timer effect, it strikes me, as reasonable that it could be applied to any other icon that can be displayed in some manner. Of course, this could be one of those things that are stuck under the hardcoded hood.
I say this all as only a way to sort of get you looking at other possibilities for the timer effect. I don't know if it'd work, though I don't recollect anyone ever telling how they tried and failed to make that work for them, either.
dunniteowl
Logically, though, the combat icon has a grey sliding sheet effect that acts as a timer for the weapon selected during combat (and it's just a timer that tells you when you can strike again, but you don't automatically strike again when it's 'ready') and this timer effect, it strikes me, as reasonable that it could be applied to any other icon that can be displayed in some manner. Of course, this could be one of those things that are stuck under the hardcoded hood.
I say this all as only a way to sort of get you looking at other possibilities for the timer effect. I don't know if it'd work, though I don't recollect anyone ever telling how they tried and failed to make that work for them, either.
dunniteowl





Retour en haut






