Staredit Network > Forums > SC2 Assistance > Topic: [Solved] Independently Recharging Charges
[Solved] Independently Recharging Charges
Dec 6 2010, 7:30 pm
By: ImagoDeo  

Dec 6 2010, 7:30 pm ImagoDeo Post #1



Does anyone have any idea how to do this? I can't find any already-scripted method, so it would have to be some rigged system with behaviors or something. But I can't figure out how to prevent casting an ability until a behavior is detected on the unit. Besides that, I can accomplish everything that I need to rig something with behaviors, but this is defeating me.

Or is there some easier way to do it that I'm blind to?

Post has been edited 1 time(s), last time on Dec 9 2010, 4:53 am by ImagoDeo.



None.

Dec 6 2010, 8:53 pm Temp Post #2



Setting Time Start under where you set the costs for charges will make it regen 1 at a time every X seconds that you specified there.

Time Use will do the same thing but will only start once they use a charge.



None.

Dec 6 2010, 8:56 pm NicholasBeige Post #3



I've never played with charges, but I can suggest this:

Use a Behaviour on the unit which enables or disables an upgrade - and this upgrade effects whether or not the ability in question can be used. Then you put a validator (somewhere, I havn't used these either), that checks if charges remaining are >= 1, if they are, remove the behaviour, if they arn't add the behaviour. Should work, in theory?



None.

Dec 6 2010, 9:08 pm ImagoDeo Post #4



Quote from Temp
Setting Time Start under where you set the costs for charges will make it regen 1 at a time every X seconds that you specified there.

Time Use will do the same thing but will only start once they use a charge.

Erm, no. I tried that already, and all it gave me was some kind of stacking cooldown on the ability rather than independantly recharging charges.

@Cardinal - That might work, but it still doesn't solve the problem of the independant 30-second cooldown per charge that I'm going for.

What I'm currently doing is using a requirement system to prevent the ability from being used unless the unit has a specific behavior. The behavior, when removed, applies a timer behavior that expires after 30 seconds and reapplies the first behavior. It works fine, except that I can't figure out how to remove the first behavior when the ability is used. If I could figure that out, the system would work perfectly.

No doubt I could do it with triggers, but this is for the SEN Arena, and the less triggers imo the better. (Also I'm a newb at SC2 triggers.)



None.

Dec 6 2010, 9:18 pm Temp Post #5



It does work, I tried it before posting. Forgot to mention that the timer seems to reset when a charge is used though. You seem to be talking about time use, which does stack the cooldown for each charge used but still adds more charges.

There is a remove behaviour effect which does what you want. Also the unit compare behaviour count validator does exactly what you want with no requirements. Just put it on the effect of the ability instead of the ability itself.



None.

Dec 6 2010, 11:11 pm ImagoDeo Post #6



Quote from Temp
It does work, I tried it before posting. Forgot to mention that the timer seems to reset when a charge is used though. You seem to be talking about time use, which does stack the cooldown for each charge used but still adds more charges.

There is a remove behaviour effect which does what you want. Also the unit compare behaviour count validator does exactly what you want with no requirements. Just put it on the effect of the ability instead of the ability itself.

You're sure it works? And it's independant? I don't have time to test it myself at the moment, but I will if you don't get back to me before I can.

I know about the remove behavior effect. In fact, that's what I'm using to remove it. But how can I hook up that particular effect to the ability so that it fires simultaneously with the teleport effect?

I know about validators, too, and I would have used one except I didn't know for certain whether or not it would prevent the ability from being used. You're sure it would?



None.

Dec 7 2010, 12:07 am Temp Post #7



I've tested it. Every X seconds it will add a charge up to the max amount. Using a charge will reset the counter. Having 0 charges and using it will show a cooldown.

Validators on effects prevent the effect from firing. The set effect will allow you to have multiple effects from a single ability.



None.

Dec 7 2010, 4:14 am ImagoDeo Post #8



Quote from Temp
I've tested it. Every X seconds it will add a charge up to the max amount. Using a charge will reset the counter. Having 0 charges and using it will show a cooldown.

Validators on effects prevent the effect from firing. The set effect will allow you to have multiple effects from a single ability.

All right, I'll check that out. Thanks.

I know what validators do. And the Set effect didn't work, because it screwed with targeting. The teleport spell target is an arbitrary point, whereas the remove behavior effect target is the caster, so with a set effect the remove behavior effect took precedence and the spell could only be cast on the caster, which negated the teleport completely.



None.

Dec 7 2010, 4:19 am NicholasBeige Post #9



How (exactly) were you using the Set effect?

A Set is just a group of other effects which can be triggered simultaneously.



None.

Dec 7 2010, 7:25 am Temp Post #10



You would just use a set effect targeting a point. Put both the remove behaviour and the teleport in there. On the remove behaviour change the Unit - Unit value to Caster.



None.

Dec 8 2010, 1:37 am ImagoDeo Post #11



Yeah, I didn't mess around with it too much after the first failure. Don't worry, I'll keep looking at it.



None.

Dec 8 2010, 4:48 am ImagoDeo Post #12



Ok, worked. You can mark this as Solved. Thanks.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[02:33 am]
lil-Inferno -- if you beg enough you get given veteran
[11:36 pm]
Roy -- Dem0n
Dem0n shouted: Roy how tf am I not a veteran
Due to the faking of your death back in 2012, the Staff is still tied up in ongoing discussions on what else you could have been lying about in regards to your interactions within the community. Until this internal quarrel is resolved, no progress can be made on the consideration of your promotion.
[11:00 pm]
Ultraviolet -- Dem0n
Dem0n shouted: Roy how tf am I not a veteran
you're not alone little Dem0n, rough down here in po' regular town
[09:19 pm]
NudeRaider -- either that, or the mods just don't like you :P
[08:32 pm]
Vrael -- and are no longer defined based on any active criteria
[08:32 pm]
Vrael -- Dem0n
Dem0n shouted: Roy how tf am I not a veteran
because all rank decisions were made years ago and have calcified into an immutable state
[07:52 pm]
Dem0n -- Roy
Roy shouted: Anyone else having issues viewing the veteran forums? They disappeared from the forum index a while ago. I can still navigate to them directly like http://www.staredit.net/forum/43/, but I only see topics from several months ago there.
how tf am I not a veteran
[07:26 pm]
Andrea Rosa -- :wob:
[2022-11-26. : 9:47 pm]
Ultraviolet -- buncha convict descendants :P
[2022-11-26. : 5:40 pm]
Oh_Man -- then how come AUS doesnt do it
Please log in to shout.


Members Online: Roy