Loading...
  OR  Zero-K Name:    Password:   

Chili Deluxe Player List with resource sharing capabilities

11 posts, 1967 views
Post comment
Filter:    Player:  
sort
I was annoyed of the common way to share resources in Zero-k, and since I didn't want to wait till the dev added this future to the Chili Deluxe Player List, I did it myself along with some other changes. But don't expect to much I coded this quick and dirty. So if anyone is interested in it, here it is:
Pastebin

Added Features:
* Shows clan summary lines with clan econ totals and average Elo of remaining players, of your clan in your team
* Display damage statistics: dealt and taken damage for players and teams and your clan (using Spring.GetTeamStatsHistory)
* Double-click on resource bars to share resources with allies
* Double-click on the resource bars next to your player name to ask for resources
* Double-click on the unit share button next to your player name to ask for unit support or if you don't have any for a constructor.
* Click on player or team name to chat with them, or if your spec to view them.
* Click on resource income label to add or remove player , team or clan from support list
* Player on the support list will get every sec the amount of resource they need not to stall.

Known Problems:
*Setting the font size to high will mess up the composition a little.
+1 / -0
11 years ago
> Player on the support list will get every sec the amount of resource they need not to stall.

Does it respect elo somehow? Who gets it if you stall or are low on resources yourself?
+0 / -0

11 years ago
Great work!
Just tested it with MoriturusMortus and it's cool. just double click resource bar in chili deluxe list and you share the amount you set as default :)

also doubleclick for unit share instead of the press H action and search for player... much shorter now :)

Well done
+0 / -0
quote:
Does it respect elo somehow? Who gets it if you stall or are low on resources yourself?


To answer your question, It supports only Player that you added manuel to the support list by clicking on the metal or energy income label next to the player name you want to add. And under the options you can set a Ceiling. And you just send metal or energy if the player on your support list has a negative income!
To make it little more clear here is the part of the code which determents the amount of metal or energy giving to a player.

quote:
function SendSupport(teamID, resource)

local Transfer = 0

local myCeiling = options.support_my_Ceiling.value

local Cur,Max,_,Income,Expense,_,_,_ = Spring.GetTeamResources(localTeam, resource)
local Plus = Income-Expense

local AllyCur,AllyMax,_,AllyIncome,AllyExpense,_,_,_ = Spring.GetTeamResources(teamID, resource)
local AllyPlus = AllyIncome-AllyExpense

local allyFloor = (AllyMax*0.9) -- options.support_ally_floor.value

if AllyCur < allyFloor and Cur > myCeiling and AllyPlus < 0 then
if (Cur-(AllyPlus*(-1))) >= myCeiling then
Transfer = (Cur-myCeiling)
else
Transfer = (AllyPlus*-1)
end
if (AllyCur+Transfer) > allyFloor then
Transfer = allyFloor-AllyCur
end
Spring.ShareResources(teamID, resource, Transfer)
echo(teamID.." "..resource.." "..Transfer)
end
end

+0 / -0

11 years ago
Sounds cool. Is this an addition to the chili deluxe player list or seperate? And can you tell how to install for all the coding-newies among us :).
+0 / -0
It's a separate widget.

You need to copy everything from pastebin (RAW Paste Data) in your editor (make sure you've got everything) and save it as gui_chili_deluxeplayerlist_mod.lua in [...]\Documents\My Games\Spring\LuaUI\Widgets , also make sure that you don't save it as a txt file.

In Game: Settings -> Show Advanced Settings, then Settings / Misc / Local Widget Config -> Enable local widgets. Then use F11 to bring up the Widget List; disable Chili Deluxe Player List - Alpha 2.02 (or any other player list widget you may be using) and enable Chili Deluxe Player List - MOD.
+0 / -0
Skasi
11 years ago
Since you're already there, could you please try to increase the performance of the chili deluxe player list? As far as I know FPS drop is the only thing stopping it from becoming the default player list.
+0 / -0
I am not good at optimizing code for performance better say I have never done this and every code I wrote myself so far clearly shows that i lack the skill for doing this kind of work ;D. But yes the performance of the chili deluxe player list is very bad.
+0 / -0
NLrankMoriturusMortus:

Just add some code which counts the cpu time each important looking code block uses.

To optimize, you don't have to rewrite a bunch of small things, only to figure out where the biggest performance drops occur.

If you can't write better code, make the function using these code-blocks optional.

That may reduce the usefulness a small bit, but let us set it as default and may attract more peoples to look at the other parts which cause minor performance drops
+0 / -0

11 years ago
Chesti the double click to share units has always been part of the playerlist.
+0 / -0

11 years ago
Of the normal chili deluxe player list? Oi, why didn't anyone tell me about that? :)
+0 / -0