Data Realms Fan Forums
http://45.55.195.193/

Simple kill counter
http://45.55.195.193/viewtopic.php?f=75&t=45749
Page 1 of 1

Author:  doomedbeksinski [ Tue Jun 24, 2014 6:46 pm ]
Post subject:  Simple kill counter

Right now I'm taking object oriented design for Java so I feel like an idiot to ask for this.. but I've only been taking the class for a week and all I really know is how to make a calculator or a simple algorythm.


Needless to say: I want a kill counter that displays the deaths of each team. At the very least a counter that displays all deaths suffered except the ones on your team. Basically I'd like to have a counter in one of the corners of the screen displaying deaths suffered and either not counting the team you're playing, or differentiating it somehow so I can see how many kills I've racked up.


Skirmish's play value was killed for me as soon as that counter disappeared.

Author:  Bad Boy [ Wed Jun 25, 2014 4:10 am ]
Post subject:  Re: Simple kill counter

I don't guarantee these'll work with the current version, but findude's already done that. Even if it's not what you want, it gives you code to work off of. Lua's nice to read, don't worry, if you're learning java I'm sure you'll figure it out quickly enough:
viewtopic.php?f=61&t=20741&p=389909&hilit=death+count#p389909

Also, added note, try to search for things before requesting them. Granted it can be easy to overlook the right result, but it's still a good idea.

Author:  clunatic [ Wed Jun 25, 2014 3:54 pm ]
Post subject:  Re: Simple kill counter

It looks like that mod won't work at all and even as a base to work from it's not very usefull, because it relies on lua functions that don't exists anymore (GetTeamDeathCount for instance).

Anyway, I cobbled together something quick that works and could serve as a base for a more fancy version. You can find it here: http://forums.datarealms.com/viewtopic.php?f=61&t=16863&p=554031#p554031

Author:  Bad Boy [ Wed Jun 25, 2014 4:45 pm ]
Post subject:  Re: Simple kill counter

Oh wow, I didn't know they completely got rid of GetTeamDeathCount or any functions for that matter, damn. That's a shame, but good catch clunatic, thanks.

Author:  clunatic [ Wed Jun 25, 2014 11:19 pm ]
Post subject:  Re: Simple kill counter

Actually, I was wrong, GetTeamDeathCount works just fine, I'd just made a stupid mistake. That also makes the code much easier:

Code:
function Update(self)
   local K2 = ActivityMan:GetActivity():GetTeamDeathCount(Activity.TEAM_2)
   local K3 = ActivityMan:GetActivity():GetTeamDeathCount(Activity.TEAM_3)
   local K4 = ActivityMan:GetActivity():GetTeamDeathCount(Activity.TEAM_4)

   FrameMan:SetScreenText("Kills: "..(K2+K3+K4), 0, 0, -1, false)

end


That's all you need really, for a simple kill counter. You can still download the mod I posted in the minor mod release thread if you don't want to bother with attaching it to something yourself.

Author:  doomedbeksinski [ Thu Jun 26, 2014 9:41 pm ]
Post subject:  Re: Simple kill counter

Thank you. The game has value now lol.

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/