Color SetsSince RTB allows for color set loading from the Start Server screen, there is a special way you will need to pack your color set:
- Must be in a .zip with the name Colorset_YourTitleHere.zip
- Must contain the colorSet.txt in the zip
- Must contain a description.txt in the zip with Title and Author fields
It will be placed in the add-ons folder like any other add-on.
Info TipsInfo Tips can be added to what the Infomaniac says on the loading screen using the following function:
RTB_addInfoTip("Tip","No-Bind Tip","Category");Tip - The text that the Infomaniac will say.
No-Bind Tip - The Info Tips system adds a new type of TorqueML which is the <key:bindname> to show what key to press to perform a function. If the bindname you supplied in the tip is unbound, the No-Bind Tip will be shown instead.
Category - This is not used in RTB 2.0 however in RTB 2.1 you will be able to choose which categories of tips you will get to see.
Here is the code you should use:
if(isFile("Add-Ons/System_ReturnToBlockland/server.cs"))
{
if(!$RTB::RTBR_InfoTips_Hook)
exec("Add-Ons/System_ReturnToBlockland/RTBR_InfoTips_Hook.cs");
RTB_addInfoTip("Press <key:showPlayerList> to bring up the player trust box.","It looks like you can't open the player menu! Open the options menu and assign a key to it!");
}
This code should be placed in the client.cs of your Add-OnPref ManagerRTB will be including a preference manager which will be accessible to Super Admins on the server. Any add-on can register prefs to be managed by this using the following function:
RTB_registerPref("Pref Name","Category","Pref","Var Type","Your Mod Name","Default Pref Value","Requires Server Restart","Host Only");Pref Name - The display name of your Pref.
Category - This will usually be the name of your Add-on.
Pref - The actual variable name without the $.
Var Type - The field type, much like the events system it supports list, string (max length), bool and int (minval) (maxval).
Your Mod Name - The name of your mod, simply for error reporting.
Default Pref Value - Enter a default value for the pref if it has not been changed or set before.
Requires Server Restart - Puts a * in the gui to show that changing it will require a server restart.
Host Only - This will prevent non-hosts from changing that setting.
Here is an example:
if(isFile("Add-Ons/System_ReturnToBlockland/server.cs"))
{
if(!$RTB::RTBR_ServerControl_Hook)
exec("Add-Ons/System_ReturnToBlockland/RTBR_ServerControl_Hook.cs");
RTB_registerPref("Duplicator Timeout","Duplicator","Duplicator::Timeout","int 0 60","Tool_Duplicator",40,0,0);
}
else
{
$Duplicator::Timeout = 40;
}
This would register a pref called "Duplicator Timeout" in the Duplicator category which would change the $Duplicator::Timeout pref. The user would be allowed to enter an integer between 0 and 60 inclusive. The pref is registered by the Tool_Duplicator add-on. The default timeout is 40 seconds. It does not require a restart to begin working and both the host AND super admins can change it. If RTB is not installed, it will set the $Duplicator::Timeout value to 40 anyway so the add-on still works.
This code should be placed in the server.cs of your Add-OnMod ManagerI have now added a system whereby you can provide text-based links to RTB mods which will open them ingame using the following Physician Prescribed Desoxynod:
<a:rtb-fileid>File Title</a>
For example:
<a:rtb-31>Sawn-off Shotgun</a> would cause the sawn-off shotgun to be displayed in-game for anyone who clicked it.