Jump to content

Zombie Death Meter


vonVile

Recommended Posts

I know the game already has one, but I don't want to dig up the Character Info screen to see it. What I plan to do is make a zombie (and NPC) death meter appear beside the primary weapon icon. I'll have to find where and what the variable for the zombie kills is in PZ, and use it to display the number on screen.

 

There will also be a hot key button to turn it on and off. I don't think the "~/`" key is in use yet.

 

Boy, this is going to be a major challenge! :)

Link to comment
Share on other sites

Something similar for "Time survived" under the clock would be good for YouTubers/streamers, so the viewers can see how long without either working it out themselves from the clock and calendar or asking the streamer to bring up the window.

Link to comment
Share on other sites

:cry:

 

Worry not... you can do it yourself. All the basics are in here:

 

-- =============================================================================-- COORDINATE VIEWER-- by RoboMat---- Created: 07.08.13 - 21:31-- =============================================================================CoordViewer = {}CoordViewer.version = "0.4.0";CoordViewer.author = "RoboMat";CoordViewer.modName = "Coordinate Viewer";CoordViewer.flag = true;CoordViewer.keyPressed = false;-- -------------------------------------------------- Functions-- ----------------------------------------------------- Prints out the mod info on startup and initializes a new-- trait.function CoordViewer.init()    print("Mod Loaded: " .. CoordViewer.modName .. " by " .. CoordViewer.author .. " (v" .. CoordViewer.version .. ")");end----- Creates a small overlay UI that shows debug info if the-- P key is pressed.function CoordViewer.showDebugger()    local tManager = getTextManager();    local player = getPlayer();    if player ~= nil and CoordViewer.flag then        local screenX = 20;        local screenY = 200;        local x = player:getX();        local y = player:getY();        local z = player:getZ();        x = CoordViewer.round(x, 1);        y = CoordViewer.round(y, 1);        z = CoordViewer.round(z, 1);        tManager:DrawString(UIFont.Small, screenX, screenY, "Coordinates ", 1, 1, 1, 1);        tManager:DrawString(UIFont.Small, screenX, screenY + 10, "X: " .. x, 1, 1, 1, 1);        tManager:DrawString(UIFont.Small, screenX, screenY + 20, "Y: " .. y, 1, 1, 1, 1);        tManager:DrawString(UIFont.Small, screenX, screenY + 30, "Z: " .. z, 1, 1, 1, 1);    endend----- Checks if the P key is pressed to activate / deactivate the-- debug menu.-- @param _keyPressed - The key which was pressed by the player.--function CoordViewer.checkKey(_keyPressed)    if _keyPressed == 25 then        CoordViewer.flag = not CoordViewer.flag; -- reverse flag    endend----- Round the values.-- @param _number - The value to be rounded.-- @param _decimal--function CoordViewer.round(_number, _decimal)    local temp = _decimal and 10 ^ _decimal or 1;    return math.ceil(_number * temp - 0.5) / temp;end-- -------------------------------------------------- Game hooks-- ------------------------------------------------Events.OnGameBoot.Add(CoordViewer.init);Events.OnKeyPressed.Add(CoordViewer.checkKey);Events.OnPostUIDraw.Add(CoordViewer.showDebugger);

 

If you need help, just ask.

 

P.S.: For the zombie kills I suggest you take a look at the IsoPlayer class in the javadocs ;)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...