I assume by cooldown you mean the recharge time and not the weapon cooldown.
With every shot made you reset the recharge timer on the charges. The recharge timer on the weapon restores all 12 charges. As a result it will be able to fire 12 times rapidly but then must wait the full recharge time of the weapon all charges to be refunded. This also has the benefit that if the unit only partly depletes its weapon charges and then leaves combat for the recharge period it will enter combat again with full weapon charge.
If it cannot be done with a modify unit effect or buff of sorts then it can certainly be done with triggers. The triggered solution would be that every time the weapon fires it sets the unit's weapon charge link recharge time back to initial recharge time.
Ok I figured out that Charge - TimeUse is how long it takes to add a charge.(thank you Wiki :D and ImperialGood for pointing me in the right direction)
I now have it so it swift bursts through 12 shots then slowly regains 1 shot every second.
The problem is that the unit continues to attack while it is "recharging" each shot, which basically just results in a new attack rate of 1 shot per second. Is there some way to prevent the unit from attacking once the charge count hits 0? And then allowing the unit to attack again once it hits max?
---Result 2 - 6: Cooldown - TimeUse again has no noticeable affect, but unlike without e_chargeFlagRestoreAllChargesOnCooldown the weapon never enters a slower rate of fire. It appears that e_chargeFlagRestoreAllChargesOnCooldown simply restores all charges at the end of a (Basic) Stats: Period cycle/ Stat: Reload Duration cycle. It does not appear to be tied to the Cooldown - TimeUse setting.
I also did not see any noticable difference when using Cooldown - TimeStart.
Im going to try something involving a Behavior that disables/endables the weapon and a chain of Validators that check the Weapons charges.
Im not sure if charges will recharge while the weapon is disabled, but the only other way I can think of is disabling Attack which I'd rather not do.
Thank you DrSuperEvil, e_chargeFlagRestoreAllChargesOnCooldown was the solution but not in combination with any of the Cooldown settings weirdly.
I just set Charge - TimeUse to be longer than the total time to drain the weapon of all shots.
The weapon now drains all its shots, waits for a single Charge - TimeUse and thanks to e_chargeFlagRestoreAllChargesOnCooldown fully recharges the charges.
If you look in the editor they are not with the other cost fields for some reason being classified as (None): so could you please move those fields back to where they were. Also I was hoping you could fill in the function/hints part more so it is clearer how to make a charge based reloading weapon.
Ill move them back if you want, but they are grouped with Cost in my editor:
Are there different versions of the editor?
EDIT:
I made changes to the parts I know of/ were relevant to my testing.
(I removed the (Unknown) tags so you know which ones I changed)
As for how to do burst reloading, its all about simple math.
Charge - Count Max * (Stats: Period or Stats: Reload Duration) = Charge - TimeUse
Set e_chargeFlagRestoreAllChargesOnCooldown to true, and everything else to default and thats about it.
For example, if you want a weapon with a Charge - Count Max of 50 and a Stats: Period / Stats: Reload Duration of 1 second then you would set Charge - TimeUse to be Greater Than 50.
Each second after 50 you set Charge - TimeUse to would be how long it takes to reload the burst.
Another example:
A weapon with a Charge - Count Max of 48 and a Stats: Period / Stats: Reload Duration of 0.05 seconds requires a Charge - TimeUse of at least 2.4
If you set Charge - TimeUse to 16, then the weapon will fire its burst for 2.4 seconds, and then have a reload time 13.6 seconds.
If you are sure about what it does remove the unknown tags, if you are unsure leave them and add a question mark ad then end of what you think it does.
Rollback Post to RevisionRollBack
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
I feel like Im missing something simple here.
Ive added a "charge" cost to my unit's weapon, so that it fires 12 times then goes on cooldown.
That part appears to work fine. Except it never seems to come off cooldown, or the charge is never restored?
These are the values Ive modified:
Charge -
Count Max = 12
Count Start = 12
Count Use = 1
Link = Clip
Location = Unit
Cooldown -
Link = The Weapon
Location = Unit
Ive tried messing with the Time values but it either has no affect, or starts the cooldown between each shot rather at the end of the burst.
How do I tell it to:
1. start cooldown after the burst?
2. reload the charge after the cooldown?
I assume by cooldown you mean the recharge time and not the weapon cooldown.
With every shot made you reset the recharge timer on the charges. The recharge timer on the weapon restores all 12 charges. As a result it will be able to fire 12 times rapidly but then must wait the full recharge time of the weapon all charges to be refunded. This also has the benefit that if the unit only partly depletes its weapon charges and then leaves combat for the recharge period it will enter combat again with full weapon charge.
If it cannot be done with a modify unit effect or buff of sorts then it can certainly be done with triggers. The triggered solution would be that every time the weapon fires it sets the unit's weapon charge link recharge time back to initial recharge time.
Is "TimeStart" in the Charge section where I set the duration of the recharge timer?
Or is that set somewhere else?
EDIT: It would also be helpful if I could display the charge count on the unit somehow.
Ok I figured out that Charge - TimeUse is how long it takes to add a charge.(thank you Wiki :D and ImperialGood for pointing me in the right direction)
I now have it so it swift bursts through 12 shots then slowly regains 1 shot every second.
The problem is that the unit continues to attack while it is "recharging" each shot, which basically just results in a new attack rate of 1 shot per second. Is there some way to prevent the unit from attacking once the charge count hits 0? And then allowing the unit to attack again once it hits max?
There is a flag called e_chargeFlagRestoreAllChargesOnCooldown under the (None): Cost - Charge - Enable Charge Time Queueing field. Try that?
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
The wiki says that Cooldown - StartTime is time before first use, and Cooldown - TimeUse is, similar to charge, between each shot.
But it doesn't say anything about either "None" tab.
I am assuming you are suggesting that flag will change how one of those Cooldown variables works in someway?
The results of my testing for cooldown:
e_chargeFlagRestoreAllChargesOnCooldown set to false, and Cooldown - TimeUse set to 1:
-Test 1: Cooldown - None - Operation = Add If Not On Cooldown
---Result 1: Cooldown occurs after each shot
-Test 2 - 6: Cooldown - None - Operation = Add, Max, Min, Multiply, Set
---Result 2 - 6: no noticeable difference from Cooldown - TimeUse = 0
e_chargeFlagRestoreAllChargesOnCooldown set to true, and Cooldown - TimeUse set to 1:
-Test 1: Cooldown - None - Operation = Add If Not On Cooldown
---Result 1: Cooldown occurs after each shot
-Test 2 - 6: Cooldown - None - Operation = Add, Max, Min, Multiply, Set
---Result 2 - 6: Cooldown - TimeUse again has no noticeable affect, but unlike without e_chargeFlagRestoreAllChargesOnCooldown the weapon never enters a slower rate of fire. It appears that e_chargeFlagRestoreAllChargesOnCooldown simply restores all charges at the end of a (Basic) Stats: Period cycle/ Stat: Reload Duration cycle. It does not appear to be tied to the Cooldown - TimeUse setting.
I also did not see any noticable difference when using Cooldown - TimeStart.
Im going to try something involving a Behavior that disables/endables the weapon and a chain of Validators that check the Weapons charges.
Im not sure if charges will recharge while the weapon is disabled, but the only other way I can think of is disabling Attack which I'd rather not do.
EDIT:
!!!!!
NEVERMIND!
Found it!
It was so obvious after testing.
Thank you DrSuperEvil, e_chargeFlagRestoreAllChargesOnCooldown was the solution but not in combination with any of the Cooldown settings weirdly.
I just set Charge - TimeUse to be longer than the total time to drain the weapon of all shots.
The weapon now drains all its shots, waits for a single Charge - TimeUse and thanks to e_chargeFlagRestoreAllChargesOnCooldown fully recharges the charges.
Thanks again for helping me find the answer.
Maybe add your findings to the wiki?
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
Is that done via "View Source" at the top of the Wiki page?
Log into the wiki using your Sc2mapster account and then hit the edit button near the top right.
This is the relevant page?
http://wiki.sc2mapster.com/Data/Weapons/Legacy
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
Sorry for the delayed response.
Yes that was the relevant page, I see you added the info in already.
Just to familiarize myself with editing, I moved them down to the other Cost related entries and touched up their sub headings a bit.
Let me know if the headings don't match standards.
If you look in the editor they are not with the other cost fields for some reason being classified as (None): so could you please move those fields back to where they were. Also I was hoping you could fill in the function/hints part more so it is clearer how to make a charge based reloading weapon.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
Ill move them back if you want, but they are grouped with Cost in my editor:
Are there different versions of the editor?
EDIT:
I made changes to the parts I know of/ were relevant to my testing.
(I removed the (Unknown) tags so you know which ones I changed)
As for how to do burst reloading, its all about simple math.
Charge - Count Max * (Stats: Period or Stats: Reload Duration) = Charge - TimeUse
Set e_chargeFlagRestoreAllChargesOnCooldown to true, and everything else to default and thats about it.
For example, if you want a weapon with a Charge - Count Max of 50 and a Stats: Period / Stats: Reload Duration of 1 second then you would set Charge - TimeUse to be Greater Than 50.
Each second after 50 you set Charge - TimeUse to would be how long it takes to reload the burst.
Another example:
A weapon with a Charge - Count Max of 48 and a Stats: Period / Stats: Reload Duration of 0.05 seconds requires a Charge - TimeUse of at least 2.4
If you set Charge - TimeUse to 16, then the weapon will fire its burst for 2.4 seconds, and then have a reload time 13.6 seconds.
For the wiki we use the data editor settings listed here:
http://wiki.sc2mapster.com/Data_Types
If you are sure about what it does remove the unknown tags, if you are unsure leave them and add a question mark ad then end of what you think it does.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
Very well. Ive moved them back.
I don't use the editor with those settings tho.
Ill try to remember to use them for future edits.
Everyone uses what they find convenient. Those settings are just to make sure everything has the same format.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg