[ACS] Show player kills or damage done

Discuss all aspects related to modding Zandronum here.
Post Reply
User avatar
DooMAGE
 
Posts: 29
Joined: Sun Aug 19, 2012 9:26 pm

[ACS] Show player kills or damage done

#1

Post by DooMAGE » Sun Mar 11, 2018 5:26 pm

Hello guys,

I'm trying to show on the screen the player name and how many monsters they killed. Like a realtime top five.
But I can't find any ACS command to access this info, also there is no way to access via ACS the intermission variables, like damage given?

I know that there is on ZDaemon GetPlayerInfo() PLAYERINFO_KILLS: the player's kill (NOT frag) count.

I'm almost giving up :/

User avatar
NachtIntellect
Forum Regular
Posts: 480
Joined: Mon Jun 11, 2012 9:20 am
Location: Bienenstock, Germany

[ACS] Re: Show player kills or damage done

#2

Post by NachtIntellect » Mon Mar 12, 2018 12:28 pm

Hmm this is kind of a hacky way around but you could always create a pain state for said monster that gives the activator something that is either stored as an ACs variable or item the same can probably be done with the kill count just change it so on death it gives player said item or variable, this is just what I would do I never bothered using anything built in instead I just create it myself.

It's a bit tricky for me to explain right now since I haven't used ACS in a while but I've done something similar for the player alright so if you want to print a message on screen that shows the player name use Hudmessage and inside for the first argument use n:1 What this does is print the first players name if you want more than 1 players name just create another line and to change it to another players name just increase the number after n: by 1 then you just need to fill out all the other arguments a good trick to hide these numbers is to have an if statement using the PlayerInGame() function again I am a little rusty and it may sound confusing at first but I am still willing to help you out if I can.

User avatar
DooMAGE
 
Posts: 29
Joined: Sun Aug 19, 2012 9:26 pm

[ACS] Re: Show player kills or damage done

#3

Post by DooMAGE » Mon Mar 12, 2018 8:23 pm

Everything sounds great, I'm still learning to code, but I get what do you mean.
So to accomplish this we should use DECORATE for the death/pain states and ACS to show on the screen. right?

User avatar
NachtIntellect
Forum Regular
Posts: 480
Joined: Mon Jun 11, 2012 9:20 am
Location: Bienenstock, Germany

[ACS] Re: Show player kills or damage done

#4

Post by NachtIntellect » Mon Mar 12, 2018 10:49 pm

Yeah, that is right what one of my friends and I have worked on and it's something like this you should be able to tell exactly how to use it:

Code: Select all

//In the death state I have ACS_ExecuteAlways(667,0,130,0,0) which gives the player 130 of the inventory item "money".

SCRIPT 667 (int amount)
{
 	if(amount>-1) 
 	{
 		SetActivatorToTarget(0);
 		GiveInventory("money",amount);
 	}
}
I do also think that you might have to calculate exactly how much damage is done which is a little bit of a pain, there should be another way to tell how much hp a monster has lost when you shoot at it but I can't exactly remember the details.

User avatar
DooMAGE
 
Posts: 29
Joined: Sun Aug 19, 2012 9:26 pm

[ACS] Re: Show player kills or damage done

#5

Post by DooMAGE » Tue Mar 13, 2018 1:19 am

Thanks I'll take a look.
If I can manage to show the kills on the screen, thats enough for me. No need to show damage then :)

Post Reply