Gadget: player has taken the lead with xxx kills
Moderator: Moderators
Re: Gadget: player has taken the lead with xxx kills
You can count enemy unit death with metal wreckage. New wreck = new unit death, so filter wreck with 'allyID' to yield enemy unit death. Here's an implementation:
http://springfiles.com/spring/lua-scrip ... myallyself
For message broadcast (eg: "player A has taken lead!!") each widget could be modified to communicate with opposite team's widget to sync its value/correct-deviation... (much like how allyCursor widget communicate with each other). This ensure the value are same across player...
http://springfiles.com/spring/lua-scrip ... myallyself
For message broadcast (eg: "player A has taken lead!!") each widget could be modified to communicate with opposite team's widget to sync its value/correct-deviation... (much like how allyCursor widget communicate with each other). This ensure the value are same across player...
-
- Posts: 834
- Joined: 19 May 2009, 21:10
Re: Gadget: player has taken the lead with xxx kills
2 Problems:msafwan wrote:You can count enemy unit death with metal wreckage. New wreck = new unit death, so filter wreck with 'allyID' to yield enemy unit death.
Not all mods have visible wrecks. Wrecks can be made only visible if inside LOS.
Not all dead units leave a wreckage.
Re: Gadget: player has taken the lead with xxx kills
gadget to count the kills, widget for display.
i think everything else is just messing around...
i think everything else is just messing around...
Re: Gadget: player has taken the lead with xxx kills
Yes, the problem with a widget counting the kills is also that it gets reset when LuauI is reloaded, and some people do that sometimes.
Ofc there's also the spring internal method of getting kills/losses:
But I don't recommend using that method, it doesn't count all kills, it counts kills of cancelled and unfinished units and it counts it as a loss when you place a dragon teeth for instance.
So the gadget that counts kills works well, but the widget side needs to be adjusted. But how does a widget and gadget communicate with each other? They need to be in the same file?
Ofc there's also the spring internal method of getting kills/losses:
Code: Select all
Spring.GetTeamUnitStats(TeamID)
So the gadget that counts kills works well, but the widget side needs to be adjusted. But how does a widget and gadget communicate with each other? They need to be in the same file?
Last edited by Jools on 07 Sep 2011, 04:29, edited 1 time in total.
Re: Gadget: player has taken the lead with xxx kills
Interesting: so there is information in the wrecks about what player it belonged to?msafwan wrote:You can count enemy unit death with metal wreckage. New wreck = new unit death, so filter wreck with 'allyID' to yield enemy unit death.
This could still be interesting to my statistics widget. It is an widget so it doesnt have information on enemy deaths, but as you become spectator it fills up that information. Maybe using this widget could be more reliable that asking spring for a start value of a players deaths and kills (when you become spec or reload luaui).
Or even better, since the killcount isnt the best measure of efficiency, I'm trying to replace it with a killed-hp count, the maximum healt points of the units you have killed. Maybe this could come in handy there. killed-hp isnt a perfect measure either, but it's better than just kills or dealt damage imo.
Re: Gadget: player has taken the lead with xxx kills
Also wreck steps are skipped if the damage is high enough.
Re: Gadget: player has taken the lead with xxx kills
Spring.SendLuaUIMsgBut how does a widget and gadget communicate with each other?
this is about something else but same technic:
http://answers.springlobby.info/questio ... t-scorebox
Re: Gadget: player has taken the lead with xxx kills
There's another way to do this also: use the UnitLeftLOS/Radar callins. If the unit disappeared ( unit position is nil) but it didnt leave radar or los, then it died.
But using a gadget and UnitDestroyed is probably best way still. However, does it catch indirect kills? I mean if I have 50 crawling bombs and someone kills one of them so that the others explode too?
But using a gadget and UnitDestroyed is probably best way still. However, does it catch indirect kills? I mean if I have 50 crawling bombs and someone kills one of them so that the others explode too?
Re: Gadget: player has taken the lead with xxx kills
what happens on entering jammer, entering water, being transported, morphing?Jools wrote:There's another way to do this also: use the UnitLeftLOS/Radar callins. If the unit disappeared ( unit position is nil) but it didnt leave radar or los, then it died.
yup.But using a gadget and UnitDestroyed is probably best way still.
it gives you attackerID...However, does it catch indirect kills? I mean if I have 50 crawling bombs and someone kills one of them so that the others explode too?
But yea, needs filtering ie if the unit was complete or just a construction that got destroyed or canceled.
I think dragonteeth trigger UnitDestroyed too etc
Re: Gadget: player has taken the lead with xxx kills
If jammed then spring will call UnitLeftLOS or -Radar, depending on where is was visible. Not sure about the others. When morphed the unit essentially dies and gets replaced by the morphed unit (new unitID).knorke wrote:what happens on entering jammer, entering water, being transported, morphing?
But is the attackerID the enemy or one of the chain exploded bombs?it gives you attackerID...
Re: Gadget: player has taken the lead with xxx kills
added a scoring system to grts this weekend. I have added the relevant parts of your kill tracking to it. why are you checking if a unit is completed or not before kill?
Re: Gadget: player has taken the lead with xxx kills
1% build unit gets destroyed -> counts as killwhy are you checking if a unit is completed or not before kill?
canceling build process -> counts as kill
reclaiming a nano frame -> counts as kill
etc
Re: Gadget: player has taken the lead with xxx kills
It seems we need to have a discussion about what is a kill, I didn't think there would be several views about it. Obviously, I don't think those things you mentioned are really kills.
If a tank is, say 1% complete, it's not really a tank yet, and it has no personnel, so if someone bombs it, how can that be counted as a kill? It also has no ability to defend itself (dunno if that's something we should consider).
If a planned construction is cancelled, then that's not a kill. There is no-one killing it. Same thing if something is reclaimed, then it 's reclaimed, not killed.
To me a kill happens when a unit gets destroyed in combat, be it either a military or a civilian one (although spring doesnt distiguish). But this debate is also higly philosophic, basically we need to decide when a unit is a unit. Maybe we can borrow some arguments from the abortion debate:)
If a tank is, say 1% complete, it's not really a tank yet, and it has no personnel, so if someone bombs it, how can that be counted as a kill? It also has no ability to defend itself (dunno if that's something we should consider).
If a planned construction is cancelled, then that's not a kill. There is no-one killing it. Same thing if something is reclaimed, then it 's reclaimed, not killed.
To me a kill happens when a unit gets destroyed in combat, be it either a military or a civilian one (although spring doesnt distiguish). But this debate is also higly philosophic, basically we need to decide when a unit is a unit. Maybe we can borrow some arguments from the abortion debate:)
Last edited by Jools on 06 Sep 2011, 21:25, edited 1 time in total.
Re: Gadget: player has taken the lead with xxx kills
Canceled counts as a kill lol that is fukt up..
So what if it was aborted(killed in the factory)instead of miscarried(canceled)?
Seriously why is that a unit destroyed?
So what if it was aborted(killed in the factory)instead of miscarried(canceled)?
Seriously why is that a unit destroyed?
Re: Gadget: player has taken the lead with xxx kills
How is unnit formed?
Re: Gadget: player has taken the lead with xxx kills
Anyway, killed units is not the best measure of a player's success. I've started to use "killed hp" instead in my other widget, which means weighting the number of kills by the hp the unit has as 100% full health.
It's not perfect, but I think it's better than just "kills" or "damage dealt".
It's not perfect, but I think it's better than just "kills" or "damage dealt".
Re: Gadget: player has taken the lead with xxx kills
I like kills though and plan on having that and damage dealt recorded. hell i want to record what you kill and how many, store it locally etc.
have all of it on a lol style leaderboard CUZ I CAN. etc.
have all of it on a lol style leaderboard CUZ I CAN. etc.
Re: Gadget: player has taken the lead with xxx kills
That's a nice idea, will be interesting so see how you lay it out graphically. Still, one life is also 1 life so kills is still a good way to count it. Or, whatever way you do it it's not gonna be perfect, because it's not better to kill 20 pyros than 1 goliath, for instance.
Here's how I formatted my kill stats:
Here's how I formatted my kill stats:
Re: Gadget: player has taken the lead with xxx kills
I updated a little my gadget:
- Not counting spectator as players anymore
- Printing faction name as well
- Printing "AI" instead of "" for external AI. But reading the proper AI shortName would require a gadget<->widget communication, making the whole thing a bit more complex than just a gadget.
Edit: Thanks to [BoS]nixtux for telling me about a bug that made it crash when playing against AI.
- Not counting spectator as players anymore
- Printing faction name as well
- Printing "AI" instead of "" for external AI. But reading the proper AI shortName would require a gadget<->widget communication, making the whole thing a bit more complex than just a gadget.
Edit: Thanks to [BoS]nixtux for telling me about a bug that made it crash when playing against AI.
- Attachments
-
- taken_the_lead.lua
- Tis a gadget, not a widget.
- (2.63 KiB) Downloaded 114 times
Re: Gadget: player has taken the lead with xxx kills
bump for knuckleheads in ba subforum.