View unanswered posts | View active topics It is currently Fri Mar 29, 2024 11:35 am



Reply to topic  [ 6 posts ] 
 Simple kill counter 
Author Message

Joined: Wed Aug 25, 2010 5:47 am
Posts: 5
Reply with quote
Post 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.


Tue Jun 24, 2014 6:46 pm
Profile

Joined: Fri Sep 10, 2010 1:48 am
Posts: 666
Location: Halifax, Canada
Reply with quote
Post 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.


Wed Jun 25, 2014 4:10 am
Profile

Joined: Fri Nov 23, 2012 5:42 am
Posts: 143
Reply with quote
Post 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


Wed Jun 25, 2014 3:54 pm
Profile

Joined: Fri Sep 10, 2010 1:48 am
Posts: 666
Location: Halifax, Canada
Reply with quote
Post 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.


Wed Jun 25, 2014 4:45 pm
Profile

Joined: Fri Nov 23, 2012 5:42 am
Posts: 143
Reply with quote
Post 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.


Wed Jun 25, 2014 11:19 pm
Profile

Joined: Wed Aug 25, 2010 5:47 am
Posts: 5
Reply with quote
Post Re: Simple kill counter
Thank you. The game has value now lol.


Thu Jun 26, 2014 9:41 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 6 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.060s | 15 Queries | GZIP : Off ]