Power Bar
Moderator: Moderators
Power Bar
I'd like to have a "power bar", that only allows a given Weapon to be used when the bar fills up again. Basically, just a visual representation of the reload speed, for special weapons in my game. Should be really easy to code, any pointers?
Oh, terribly sorry, I don't mean Energy requirements (although that might be nice, too). I mean just a simple, visual representation of the reload time. Reason why I want this, is for weapons with a very long reload (20 seconds or more) that are very powerful, commandfire weapons- the player needs to manually use them, and they need a visual cue as to when they're reloaded.
Code: Select all
Spring.GetUnitWeaponState(unitID, weaponNum) -> nil |
boolean angleGood,
boolean ready,
number reloadReadyFrame,
number salvoLeft,
number numStockpiled
It makes absolutely no sense as a gadget. Something which is purely UI should be a widget. It doesn't need to be synced and whether it is shown should be user choice. It's also applicable to every mod.Argh wrote:I think it'll probably be a Gadget, with a config, because you're not going to want it on every Unit, but conversion to a more general-purpose Widget is probably painless. I certainly don't have anything working yet, I'm working on models right now, no time for code.
Not really- the way I was intending to use it, some Units would have this enabled, some won't. It doesn't make sense, at least to me, to have this for a PeeWee- that seems like a huge waste of CPU and graphical resources. However, you might very well want it for a MRPC, LRPC, Nuke, etc. In my game, I have a Unit with a 10-second firing delay, and I will probably have another one (speculative, don't even have a model yet) with an even longer delay, and I think players will want to know, down to the half-second, when it's going to reload, for pinpoint aiming at moving targets.It's also applicable to every mod.
So, I kind've envision this as a selective UI tool, not a blanket tool. However, if a blanket Widget gets written before I get to this issue, and people really like it, I will re-evaluate my opinion- we don't have it yet, so I'm mainly speculating on the probable best use of this concept.[/quote]
I disagree, it should be a (free for any mod to use) gadget. If you want to play Baranced Annihilation (or any other mod, that pun was just the best) bug the mod dev to implement the gadget. Anyone who can fiddle with numbers can add unitnames to a config file. Having it apply to all units with x reload time isn't ideal, since there are sometimes units with longer reload times like that which are really irrelevent to the player.
For example, SWS has anti-air infantry with shoulder-mounted rockets with a reload time of 8, but this reload value isn't important to the player. And there's no way we can police or maintain widgets like this which become annoying in that situation.
There's a point where some things just need to be decided by the mod creator. This is one of them. Health, build progress, and paralyzation are certainly universal, but reload time is something that should always be defined by the mod, not by the user.
For example, SWS has anti-air infantry with shoulder-mounted rockets with a reload time of 8, but this reload value isn't important to the player. And there's no way we can police or maintain widgets like this which become annoying in that situation.
There's a point where some things just need to be decided by the mod creator. This is one of them. Health, build progress, and paralyzation are certainly universal, but reload time is something that should always be defined by the mod, not by the user.
Ok, so I have a a new player in SWS. He's playing the game and posts feedback saying it would be nice to have a reload bar for x unit with a long reload time.
So we direct him to this lua widget and tell him it'll put in reload time bars. He downloads it. He has no clue what to do with this lua file since he is new and posts again for help.
We explain to him that you just put the lua file in the LuaUI/Widgets directory. Then you load up a game, press F11, search the list for the widget, and enable it. He does this.
Worst case scenario: the widget conflicts with some other widget he found in the process and installed at the same time and crashes luaui entirely, creating an entirely seperate troubleshooting problem.
Somewhat less worse scenario: he then has to open the lua file, muck around in the code, find the configuration line, and define which units should have the reload bar. And let's pray to god he only plays SWS, otherwise he might very well have to dick with the config for every mod.
Best case scenario: the widget works, and is set to automatically display on reload times of x seconds. However, this timer includes the aforementioned rocket troopers. He doesn't need or what a reload bar on them. He asks how to remove it on them. Best scenario: he can by raising the defined time threshold (again dicking with the lua code). Worst scenario: he can't, because the reload time of x unit(s) he wants is still shorter than the unit(s) he doesn't want.
Repeat this dozens and dozens of times because no new player uses the search function or even reads topics a quarter of the way down the page in a forum. And no doubt there'd be those who don't use the forum and instead go through the process on IRC or in lobby chat instead.
All of this, or the reload bar could be a gadget with pre-defined units by the modder. The user might have to request the bar be added to another unit in the next version, and then wait for it. The system works from the beginning with no configuration on the user's part or conflicts with other things packaged in the mod.
Long story short: Lua widgets are a nightmare for us, we can't predict what a user is using or how he's going to do it or how things are going to react/conflict with each other, and NO widget of this nature can be predefined to work with every mod's balance.
It should be a gadget.
So we direct him to this lua widget and tell him it'll put in reload time bars. He downloads it. He has no clue what to do with this lua file since he is new and posts again for help.
We explain to him that you just put the lua file in the LuaUI/Widgets directory. Then you load up a game, press F11, search the list for the widget, and enable it. He does this.
Worst case scenario: the widget conflicts with some other widget he found in the process and installed at the same time and crashes luaui entirely, creating an entirely seperate troubleshooting problem.
Somewhat less worse scenario: he then has to open the lua file, muck around in the code, find the configuration line, and define which units should have the reload bar. And let's pray to god he only plays SWS, otherwise he might very well have to dick with the config for every mod.
Best case scenario: the widget works, and is set to automatically display on reload times of x seconds. However, this timer includes the aforementioned rocket troopers. He doesn't need or what a reload bar on them. He asks how to remove it on them. Best scenario: he can by raising the defined time threshold (again dicking with the lua code). Worst scenario: he can't, because the reload time of x unit(s) he wants is still shorter than the unit(s) he doesn't want.
Repeat this dozens and dozens of times because no new player uses the search function or even reads topics a quarter of the way down the page in a forum. And no doubt there'd be those who don't use the forum and instead go through the process on IRC or in lobby chat instead.
All of this, or the reload bar could be a gadget with pre-defined units by the modder. The user might have to request the bar be added to another unit in the next version, and then wait for it. The system works from the beginning with no configuration on the user's part or conflicts with other things packaged in the mod.
Long story short: Lua widgets are a nightmare for us, we can't predict what a user is using or how he's going to do it or how things are going to react/conflict with each other, and NO widget of this nature can be predefined to work with every mod's balance.
It should be a gadget.
- BrainDamage
- Lobby Developer
- Posts: 1164
- Joined: 25 Sep 2006, 13:56
widgets can be included in the mod package and be auto activated, but they can still be turned off by the user in the widget selector menu
gadgets no, since they are synced, they need to have the same state for everyone
i guess everybody here is saying the same thing, but there is a lil misunderstanding
gadgets no, since they are synced, they need to have the same state for everyone
i guess everybody here is saying the same thing, but there is a lil misunderstanding
Oh, so Widgets aren't synched? That's fairly decisive, then, I'm in favor of that.
However, there probably needs to be a UI presented, where users select the reload times, in float--->seconds, so that people can adjust all the way down to PeeWees, if they just really like the power bar effect... or just things that fire extremely slowly. As Gnome rightly pointed out, this won't make everybody everywhere happy all the time, but it's better than having yet-another chunk of sync code, especially for something that's fairly trivial.
However, there probably needs to be a UI presented, where users select the reload times, in float--->seconds, so that people can adjust all the way down to PeeWees, if they just really like the power bar effect... or just things that fire extremely slowly. As Gnome rightly pointed out, this won't make everybody everywhere happy all the time, but it's better than having yet-another chunk of sync code, especially for something that's fairly trivial.