Blockland Forums > Modification Help

System_Syerjchep --- New player list! Chat! New rating system! Other stuff!

Pages: (1/4) > >>

DrenDran:

So yes, I have attempted a modification of the default player list.
Said mod adds two extra fields to the player list.
It also let's the server, weather it be by other mods or the host, manually, choose what values they should represent.
The mod is here:
http://www.gamefront.com/files/20139443/System_Syerjchep.zip
And it looks like this ingame:


By default the two buttons will just say "N/A1" and "N/A2" but it relies on a mod to change that.
Here's a modified version of Kalphiter's infinite mining gamemode that makes those values track money and dirt mined:
http://www.gamefront.com/files/20139446/Gamemode_Mining.zip
The way this works is by adding code into the script like this:

--- Code: ---if(!$syj::loadedvarprefs)
exec("add-ons/system_syerjchep/server.cs");

$syj::loadedvarprefs = 1;
$syj::varprefoverride = 1;
$syj::primarytitle = "Money";
$syj::secondarytitle = "Dirt";
$syj::primaryvar = "mineMoney";
$syj::secondaryvar = "dig_dirt";

--- End code ---
That is at the start of the gamemode script.
The first two lines check to see if the mod has been executed yet, if not, execute it.
The rest tell the mod that the prefs don't need to be reset and what values to use.
The "title"s are the names of the buttons that clients will see on their new player lists.
And the "var"s are the actual vars. Taken as a child of the client. If one of my vars was "money" the mod would update with '%client.money' each time.
Then, at the position in the script where the player's money and dirt count are updated, there is this script:

--- Code: ---    updatefirstsr(%obj.client.bl_id);
   updatesecondsr(%obj.client.bl_id);

--- End code ---
Which tell the mod when to update the values, rather than just using a loop for every update.

The mod also takes trust values, button clickability, and side button functions from the old list.
The mod will not add an index to the new player list that has a BL_ID that was not on the old list, to prevent abuse.
The mod disables itself in servers that do not have the mod themselves, and enables it on servers that do.

I have posted this in Mod. Discussion because I feel I still need more testing before I post it in add-ons.
If you find any bugs or problems just tell me and I will fix them, though I have tried to test this myself, it was often in
single player, which makes less applicable results.

Space Guy:


--- Quote from: DrenDran on March 19, 2011, 05:38:44 AM ---By default the two buttons will just say "N/A1" and "N/A2" but it relies on a mod to change that.
--- End quote ---
If it doesn't already it should just hide the buttons when they aren't set or the server doesn't have the mod.

DrenDran:


--- Quote from: Space Guy on March 19, 2011, 06:40:07 AM ---If it doesn't already it should just hide the buttons when they aren't set or the server doesn't have the mod.

--- End quote ---
If the server doesn't have the mod, it uses the old player list.
If it hasn't set anything, it defaults to calling the buttons N/A1 and N/A2 and having no values below, though I guess I could change that.

alex dude:

Could you make this work with VCE aswell?

heedicalking:


--- Quote from: alex dude on March 19, 2011, 12:03:38 PM ---Could you make this work with VCE aswell?

--- End quote ---
Every VCE variable is actually a player variable, I believe.

Pages: (1/4) > >>

Go to full version