Gadget: player has taken the lead with xxx kills
Moderator: Moderators
Gadget: player has taken the lead with xxx kills
In OTA there was a message when a player had taken the lead with anumber of kills. Any way to make a similar functionality here? Is this information stored globally?
It was a fun info, because it reminds you to be offensive (most kills wins) and it gives a good picture of what's happening in the game.
Edit: link to gadget
It was a fun info, because it reminds you to be offensive (most kills wins) and it gives a good picture of what's happening in the game.
Edit: link to gadget
- Attachments
-
- ding.zip
- A ding sound.
- (281.54 KiB) Downloaded 32 times
-
- gui_announce_kills.lua
- The lua gadget
- (1.97 KiB) Downloaded 121 times
Last edited by Jools on 11 Jul 2011, 16:04, edited 3 times in total.
Re: Widget request: player has taken the lead with xxx kills
hi jools,
there is an option in iceui, where u have this player bar (with ressurces,...), there is a tab where u could see the kills and losses. so i assume it should be really easy to generate a message for it
there is an option in iceui, where u have this player bar (with ressurces,...), there is a tab where u could see the kills and losses. so i assume it should be really easy to generate a message for it
Re: Widget request: player has taken the lead with xxx kills
Haha, I just remembered this!
Personally I would love to see an actual textual announcement every time a player takes the lead, with a 5sec or so spam guard. These little touches are what make a game look polished.
Personally I would love to see an actual textual announcement every time a player takes the lead, with a 5sec or so spam guard. These little touches are what make a game look polished.
Re: Widget request: player has taken the lead with xxx kills
Spring.GetTeamUnitStats
( number teamID ) ->
nil | number killed,
number died,
number capturedBy,
number capturedFrom,
number received,
number sent
( number teamID ) ->
nil | number killed,
number died,
number capturedBy,
number capturedFrom,
number received,
number sent
Re: Widget request: player has taken the lead with xxx kills
Here, whoever wants can include it in his mod or map. It only needs a global variable called leader, and it should be called from unitDestroyed function.
http://pastebin.com/4pvRDrdv
http://pastebin.com/4pvRDrdv
Re: Widget request: player has taken the lead with xxx kills
It doesnt have a spamguard yet, because I dont remember it to have been spammy in ota, since it only announces when leader changes, not on every kill. Of course in a long standoff it may be spammy.
Re: Widget request: player has taken the lead with xxx kills
This is very wrong:
It should just be:
Because in for i,v in pairs(...)
i is the key and v is the value
So you don't Spring.GetTeamList()[v] but Spring.GetTeamList()
Except Spring.GetTeamList() is already stored in v, so simply use v
Also, table returned by the engine often gets an extra field .n that store their size,
So better use ipairs, which only loops through field indexed by 1 to n, instead of pairs, which would loops through all field and would catch that weird n field.
Anyway, since you also had trouble getting the player names, I retyped the whole gadget (faster than explaining, but less helpful.)
Code: Select all
for i,v in pairs(Spring.GetTeamList()) do
tID = Spring.GetTeamList()[v]
if v > 0 then -- a check because for some reason when i = 1, then v = 0 and teamID = nil
Code: Select all
for _,tID in ipairs(Spring.GetTeamList()) do
i is the key and v is the value
So you don't Spring.GetTeamList()[v] but Spring.GetTeamList()
Except Spring.GetTeamList() is already stored in v, so simply use v
Also, table returned by the engine often gets an extra field .n that store their size,
So better use ipairs, which only loops through field indexed by 1 to n, instead of pairs, which would loops through all field and would catch that weird n field.
Anyway, since you also had trouble getting the player names, I retyped the whole gadget (faster than explaining, but less helpful.)
- Attachments
-
- taken_the_lead.lua
- It's a gadget! It must be included in a mod!
- (1.42 KiB) Downloaded 186 times
Re: Widget request: player has taken the lead with xxx kills
I have an improvement request!
Player has taken the lead messages should also play a random sound file from Quake!
DOMINATING!
WICKED SICK!
Player has taken the lead messages should also play a random sound file from Quake!
DOMINATING!
WICKED SICK!
Re: Widget request: player has taken the lead with xxx kills
There's nothing wrong with zwzsg's version, but I wanted it to be exactly like in ota, and I added a sound too, so here's a little bit more refined version.
- Attachments
-
- gui_announce_kills.lua
- It's a gadget and not a widget.
- (1.83 KiB) Downloaded 130 times
Re: Widget request: player has taken the lead with xxx kills
that's a gadget
and we can't turn it off
and you want to put it in maps?! D:
and we can't turn it off
and you want to put it in maps?! D:
Re: Widget request: player has taken the lead with xxx kills
why not as widget?
Re: Widget request: player has taken the lead with xxx kills
Because widgets can not know when units die out of player's view.
Re: Widget request: player has taken the lead with xxx kills
MidKnight wrote:I have an improvement request!
Player has taken the lead messages should also play a random sound file from Quake!
DOMINATING!
WICKED SICK!
"TROLLING ACTION!"
"M-M-M-MEGA TROLL!"
"C-C-C-OMBO BREAK!"
That one should better on the current spring players...
Re: Widget request: player has taken the lead with xxx kills
I'll consider adding it to gundam jools.
Re: Widget request: player has taken the lead with xxx kills
I have not had the chance to look at your code but I can look into adding a type of unit breakdown for the list if you would like :)
Re: Widget request: player has taken the lead with xxx kills
o_Osmoth wrote:a type of unit breakdown
It just count kills, dude, rambling about unit breakdown list is irrelevant.
Re: Widget request: player has taken the lead with xxx kills
Why not? People love pictures and numbers.
It opens up things like end of game stuff like ZAKU BUTCHER as an award kids love shit like that. My college buddies used to lol about the bs stats and awards at the end of smash brothers matches. So why not!?!
It opens up things like end of game stuff like ZAKU BUTCHER as an award kids love shit like that. My college buddies used to lol about the bs stats and awards at the end of smash brothers matches. So why not!?!
Re: Widget request: player has taken the lead with xxx kills
Only the imagination is the limit of what we can achieve.
My next step would be to make a rank list, like when you pressed F4 in OTA. The counts are already there, all that's needed is a GUI. Someone requested this also.
My next step would be to make a rank list, like when you pressed F4 in OTA. The counts are already there, all that's needed is a GUI. Someone requested this also.
Re: Widget request: player has taken the lead with xxx kills
That will be easy. (no worries I am a huge fan of the kill board as well mang :)