Checking number of player kills

Post » Sun Nov 28, 2010 4:14 pm

Is it possible to check number of player kills (or at least could you give me example of script that triggers sound on kill - NOT ON XP GAIN) ?
User avatar
Ludivine Poussineau
 
Posts: 3353
Joined: Fri Mar 30, 2007 2:49 pm

Post » Sun Nov 28, 2010 12:07 pm

GetPCMiscStat "People Killed" and GetPCMiscStat "Creatures Killed" will return the number of NPCs and Creatures the player has killed.
User avatar
Amysaurusrex
 
Posts: 3432
Joined: Wed Aug 09, 2006 2:45 pm

Post » Sun Nov 28, 2010 12:24 pm

x = GetPCMiscStat "People Killed"
y = GetPCMiscStat "Creatures Killed"
z = x+y

How to check change of Z


if (insert command [something that check change of Z])
playsound xxxx
endif
User avatar
Ebony Lawson
 
Posts: 3504
Joined: Fri Feb 16, 2007 11:00 am

Post » Sun Nov 28, 2010 12:23 pm

make new quest & script



scn (name of your script)

short doonce
short count

begin gamemode
if doonce == 0
set count to ( getpcmiscstat "People Killed" + getpcmiscstat "Creatures Killed" )
set doonce to 1
endif

if ( count != ( getpcmiscstat "People Killed" + getpcmiscstat "Creatures Killed" ) )
; playsound xxx
set count to ( getpcmiscstat "People Killed" + getpcmiscstat "Creatures Killed" )
endif
end
User avatar
Shaylee Shaw
 
Posts: 3457
Joined: Wed Feb 21, 2007 8:55 pm

Post » Sun Nov 28, 2010 3:43 pm

This is a GECK forum question that's answered by pretty much any scripting tutorial on the GECK wiki.
Alystn's spot on, although a slightly neater & marginally more efficient way of arranging that script is:
short countshort doonebegin gamemodeif(doonce)   if(count != ...)     ;...   endifelse   set doonce to 1   set count to ...endifend

User avatar
Darren
 
Posts: 3354
Joined: Wed Jun 06, 2007 2:33 pm

Post » Sun Nov 28, 2010 5:46 pm

Thank you guys, now I can continue my Player Voice mod :hubbahubba:
User avatar
Gisela Amaya
 
Posts: 3424
Joined: Tue Oct 23, 2007 4:29 pm


Return to Fallout 3