12
Versions 2.0+ Slayer Documentation by Greek2me

Slayer - Webs · Modding Slayer Slayer is designed to be expandable by other add-ons. This guide will show you how to add your own gamemodes, modules, and other add-ons to Slayer

  • Upload
    others

  • View
    12

  • Download
    0

Embed Size (px)

Citation preview

Versions 2.0+

Slayer Documentation

by Greek2me

Slayer

Documentation

by Greek2me

Greek2me | Blockland ID 11902

Table of Contents Getting Started .............................................................................................................................................. 1

Getting Into the Game .............................................................................................................................. 1

Initial Setup ............................................................................................................................................... 1

Set Up Permissions.................................................................................................................................... 1

Set a Host Name ........................................................................................................................................ 1

Gamemodes .................................................................................................................................................. 2

Changing the Gamemode ......................................................................................................................... 2

Teams ............................................................................................................................................................ 2

Creating Teams ......................................................................................................................................... 2

Editing Teams ............................................................................................................................................ 2

Placing Team Spawns and Other Team Bricks .......................................................................................... 2

Joining Teams ............................................................................................................................................ 3

Advanced ...................................................................................................................................................... 3

Changing Advanced Settings ..................................................................................................................... 3

Default Advanced Settings List ................................................................................................................. 3

Alternate Methods of Editing ................................................................................................................... 4

Debug Modes ............................................................................................................................................ 4

Configuration File ...................................................................................................................................... 4

Modding Slayer ............................................................................................................................................. 5

Server ........................................................................................................................................................ 5

Preferences ........................................................................................................................................... 5

Gamemodes .......................................................................................................................................... 6

Teams .................................................................................................................................................... 8

Client ..................................................................................................................................................... 9

Greek2me | Blockland ID 11902

1

Getting Started Welcome to Slayer! This guide will help to make your Slayer experience easy and fun. Please follow

along as I teach you about the mod.

Getting Into the Game Slayer is started just like any other add-on for Blockland.

1. Install Slayer by placing “Gamemode_Slayer.zip” into your Blockland add-ons folder.

2. Start Blockland.

3. Click on “Start Game”.

4. Click the “Add-Ons” button in the “Start Game” menu.

5. Scroll down and make sure that “Gamemode_Slayer” is checked.

6. Start the game and enjoy! When you first spawn you will be immediately placed into the Slayer

minigame.

Initial Setup Changing settings for Slayer is extremely simple. First, open the Setup window using the instructions

below.

1. Press Escape to open the Escape Menu.

2. Click on “Minigames”.

3. In the Minigame menu that appears, click on “Slayer” on the right-hand side.

Now that you have the Setup window open, you can start changing settings. At the top of the window

you will notice several tabs. The first tab is labeled “General”. You are already in this tab. This is where

you can edit general minigame settings that would appear in the normal minigame window, along with

gamemode settings. The second tab is labeled “Teams”. This tab may be grayed-out, depending on

whether the gamemode you have selected uses teams. From this tab you can edit all team settings. The

final tab is labeled “Advanced”. This tab features a list of advanced preferences that you can change.

To apply any changes to settings that you made, click “Update” at the bottom of the window. You can

also click “Reset” to update the minigame and then reset it.

Set Up Permissions Slayer allows you to set permissions for who can edit, reset, and leave the minigame. You should make

sure that these settings are the way you want them when you first set up Slayer. You can find them in

the “Advanced” tab of the Setup window.

Set a Host Name When you set up Slayer for the first time, you should set the “Host Name” preference in the “Advanced”

tab of the Setup window. By default it’s set to “HOST”.

Greek2me | Blockland ID 11902

2

Gamemodes Slayer allows you to choose between many different gamemodes. Each of these offers a different style

of game play and a different goal.

Changing the Gamemode Changing the gamemode is simple. Just follow the steps below.

1. Open the Setup window. Make sure that you’re on the “General” tab.

2. Scroll down until you see a category labeled “Gamemode”.

3. Click on the drop-down menu to see a list of gamemodes. Select one.

4. Once you’ve selected a gamemode, you might notice that some new settings have appeared

throughout the window. These are specific to the gamemode.

5. Once you are finished, click “Update” or “Reset”.

Teams Teams allow for many interesting battles and games. Here’s some information on how to use teams in

Slayer.

Creating Teams Creating teams in Slayer is a very simple process. Follow the steps below to learn how.

1. Open the Setup window and go to the “Teams” tab. (If the “Teams” tab is unavailable, make

sure that you have a gamemode selected that uses teams.)

2. Click on the green button labeled “New”. A panel will appear listing options for your new team.

3. Set up your new team. You can find additional team options via the Advanced button on the

New Team panel.

Name – The name of your team.

Color – Use the color picker to pick a color for your team.

Uniform – You can choose between Full, Shirt, or NONE.

AutoSort – Whether or not players are AutoSorted into this team.

Max Players – The maximum players that may join this team. Set to -1 for an infinite

amount.

Playertype/Starting Equipment – Select a playertype and starting equipment for this

team. Click on “Reset Items/Playertype” to set these to the minigame settings.

Editing Teams This is almost the same as creating teams. The only difference is that instead of clicking the “New”

button, click the team’s name in the list of teams.

Placing Team Spawns and Other Team Bricks Placing team bricks is extremely simple. In this example we will use a “Team Spawn Point” brick.

Greek2me | Blockland ID 11902

3

1. Open the Brick Menu. By default this is done by pressing “B”.

2. Click on the “Slayer” tab.

3. Select your brick. In this case that’s a “Team Spawn Point” brick.

4. Plant the brick where you want the team to spawn.

5. Paint the brick the team’s color. This will set the spawn brick to that team. You can paint it again

to set it to a different team.

6. If you have successfully set the spawn brick you will receive a message saying that it was set.

Joining Teams By default, Slayer automatically sorts players into teams. However, teams can also be joined manually by

typing /jointeam [team name]. This command also works for team swapping.

Advanced Slayer includes many advanced features. Here you’ll learn more about what they do and how to use

them.

Changing Advanced Settings Even though they’re called “advanced”, changing advanced settings is simple.

1. Open the Setup window and go to the “Advanced” tab.

2. Here you will see a list with three columns: Category, Setting, and Value.

3. Category and Setting tell you about what the setting does. Value tells you what it’s currently set

to.

4. Click on a setting in the list to edit it. You will see a new control appear at the bottom of the

window, along with a button labeled “Apply”.

5. Change the setting using the new control. Then click “Apply”.

6. Once you are finished changing settings, click “Update” or “Reset”.

Default Advanced Settings List This is a list of all default advanced settings and a description of each.

Category Setting Description

Bonus Kills Enable Enables kill sprees and double/triple/multi kills.

Bonus Kills Kill Spree Start Determines how many kills are required for a player to be on a killing spree.

Chat Enable Flood Protection Whether to enable chat Flood Protection.

Chat Flood Protection Timeout The time before users can chat again after being blocked by Flood Protection.

Chat Name Color Mode Whether to change players’ names or tags in chat to their team color, or change nothing at all.

Gamemode Allow Dead Talking Whether players are allowed to talk once they have run out of lives.

General Announcements Allows you to add server announcements that will be

Greek2me | Blockland ID 11902

4

displayed in the Announcements Bar of the Setup window.

General Display Brick Plant Message Whether to display the message saying that you successfully planted a Slayer Brick.

General Edit Rights Determines who can edit the minigame.

General Enabled Automatic Updates Whether the server should check for updates on startup.

General Leave Rights Determines who can leave the minigame.

General Notify Players on Update Whether to tell players what settings were changed when updating the minigame.

General Reset Rights Determines who can reset the minigame.

Minigame Custom Rule A message displayed to players when they join and when the minigame is reset.

Minigame Host Name The name that appears as the owner of the minigame in the Join Minigame window.

Minigame Late Join Time Players that join the minigame this long after a minigame reset will not spawn. Set to -1 to turn off this feature.

Minigame Name Distance How far away player’s names can be seen from.

Minigame Start When Server Starts Whether to start the minigame automatically when the server starts.

Teams CP Max Ticks How long it takes to capture a capture point.

Teams Max Events How many team events to add.

Alternate Methods of Editing In addition to the button in the Join Minigame window, there are two other methods of opening the

Setup window. The first is to bind a key to the Setup window. This can be done in the Blockland Options

menu, under Controls. The second method is to type /Slayer Edit.

There’s also a command to reset the minigame. All you have to do is type /Slayer Reset. This allows your

admins to reset the minigame even if they don’t have the GUI.

Debug Modes Slayer includes several debug modes. These modes echo information to the console. There are three

debug levels: 0, 1, and 2. The default level is 0. This turns off debug mode. Level 1 is mainly used to tell

when players edit the minigame or other similar events. Level 2 is not recommended for use. Using it

will cause the console to be flooded with debugging information. You can change the mode in your

config file.

Configuration File Slayer stores all of your settings in several configuration files. You can find them at

“config/server/Slayer”. Be careful if you edit one however, one mistake can do serious damage.

Greek2me | Blockland ID 11902

5

Modding Slayer Slayer is designed to be expandable by other add-ons. This guide will show you how to add your own

gamemodes, modules, and other add-ons to Slayer.

Server This section contains information about modifying the server side of Slayer.

Preferences

Slayer contains a preference system to allow users to easily change settings.

Adding Preferences

Slayer allows you to register preferences for your own mods. Use this example to help you create your preferences.

Title – The title for your preference.

Category – The category for your preference. This is especially needed if you use the “Advanced” list.

Variable – The preference’s variable.

Type – What type of control the preference will appear as in the GUI. o Bool – A standard checkbox. o String – A string value.

Example – “string maxLength” – “string 200”

maxLength – A number specifying how many characters are allowed. o Int – An integer value.

Example – “int minValue maxValue” – “int -20 100”

minValue – The minimum value allowed.

maxValue – The maximum value allowed. o Slide – A slider bar.

Example – “slide minValue maxValue Ticks Snap” – “slide 0 10 9 1”

minValue – The minimum value allowed.

maxValue – The maximum value allowed.

Ticks – The number of ticks on the slider.

Snap – Bool. Whether or not slider snaps to ticks. o List – A drop-down list.

if(!$Slayer::Server::Dependencies::Preferences)

exec("Add-Ons/Gamemode_Slayer/Dependencies/Preferences.cs");

Slayer.addPref("Example Pref","Category","$variable","bool",1,0,1,-1,0,"Rules SD

Mode","%mini.exampleCallback(%1,%2);",0);

//BROKEN DOWN – YOU DON’T NEED TO INCLUDE THIS IN YOUR MODS

Slayer.addPref(

“Pref Title”,

“Category”,

“Variable”,

“Type”,

“Default Value”,

“Requires Reset”,

“Notify Players”,

“Admin Level”,

“isObject”,

“List”,

“Callback”,

“Preload”

);

Greek2me | Blockland ID 11902

6

Example – “list” TAB “value1 Text1” TAB “value2 Text2” – “list” TAB “0 Shirt Only” TAB “1 Full Uniform”

Value – What the variable is set to when the matching text is selected.

Text – The text displayed for the matching value.

You may have as many sets of values and text as you want.

Default Value – The value that the preference is originally set to.

Requires Reset – Whether the minigame needs to be reset when this preference is changed.

Notify Players – Whether to notify players that this preference has changed.

Admin Level – Determines permissions needed to edit this preference. o 0 – Host o 1 – Super Admin o 2 – Admin o -1 – Admin

IsObject – Whether the variable is an object. Used for things like items and playertypes.

List – Where to display this preference in the GUI. o Leave this value blank to not display this preference in the GUI or for a custom GUI. o Advanced – Display this preference in the “Advanced” tab of the GUI. o Rules – Display this preference in the “General” tab of the GUI in a rule list.

Example – “Rules Type Category” – “Rules CTF Points”

Type – When to display this preference in the GUI. o Set to a gamemode’s fName to only display for that gamemode. o Teams – Only display for gamemodes that use teams. o !Teams – Only display for gamemodes that don’t use teams. o Rounds – Only display for gamemodes that use rounds. o !Rounds – Only display for gamemodes that don’t use rounds.

Callback – A function to call when the preference is changed. o Example – “exampleFunction(%1,%2);” or “%mini.exampleFunction(%1,%2);”

%1 – The new value of the preference. %2 – The old value of the preference. %mini – The Slayer minigame.

Preload – Whether this needs to load before anything else.

Getting and Setting Preference Values

In addition to simply using the variable of the preference, you can also use some functions to get or set

the value of it. This is extremely useful in some cases.

Gamemodes

Gamemodes are a major part of Slayer. With scripting experience, you can easily create your own. In

addition to reading this documentation, you should also look at some of the gamemodes included with

Slayer.

//SETTING PREFERENCES

Slayer.setPref(“Category”,”Title”,%value);

//GETTING PREFERENCE VALUES

Slayer.getPref(“Category”,”Title”);

Greek2me | Blockland ID 11902

7

Adding Gamemodes

For your gamemode to appear in the GUI, you must first register it.

Name – The UI name for your gamemode. This is what players and users will see.

fName – A single-word identifier for your gamemode. This is used in functions.

Use Teams – Bool. Whether your gamemode uses teams.

Use Rounds – Bool. Whether your gamemode uses rounds (lives, points, time).

Gamemode Functions

Slayer provides your gamemode with many functions to allow it to change the way the game works. All

function names below are preceded by “Slayer_FNAME_” where FNAME is your gamemode’s fName.

This allows the function to only be called when your gamemode is active.

Function Description

canDamage(%mini,%objA,%objB) Used to find if the minigame can damage an object. Return 1 or 0.

canUse(%mini,%player,%obj) Used to find if the minigame can use an object. Return 1 or 0.

onChat(%mini,%client,%msg) Called when a client sends a chat message.

onCPCapture(%mini,%brick,%color,%oldColor,%client) Called when a capture point is captured.

onCPReset(%mini,%brick,%color,%oldColor,%client) Called when a capture point is reset.

onExportPrefs(%path) Called when preferences are exported to a file.

onJoin(%mini,%client) Called when a client joins the minigame.

onLeave(%mini,%client) Called when a client leaves the minigame.

onModeEnd(%mini) Called when the gamemode ends. Useful for gamemode cleanup.

onModeStart(%mini) Called when the gamemode starts.

onObserverTrigger(%mini,%obj,%cam,%btn,%state,%client) Called when a client clicks to respawn.

onRules(%mini,%client) Called when the rules are displayed to a client.

onScore(%mini,%client,%flag) Called when a client’s score changes.

onSlyrBrickAdd(%mini,%brick,%type) Called when a Slayer brick is added.

onSlyrBrickRemove(%mini,%brick,%type) Called when a Slayer brick is removed.

onSpawn(%mini,%client) Called when players spawn.

if(!$Slayer::Server::Dependencies::Gamemode)

exec("Add-Ons/Gamemode_Slayer/Dependencies/Gamemode.cs");

Slayer.Gamemode.addMode("Team Slayer","TSlyr",1,1);

//BROKEN DOWN – YOU DON’T NEED TO INCLUDE THIS IN YOUR MODS

Slayer.Gamemode.addMode(

"Name",

"fName",

“Use Teams”,

“Use Rounds”

);

Greek2me | Blockland ID 11902

8

onVehicleSpawn(%mini,%brick,%vehicle,%a) Called when a vehicle spawns.

pickSpawnPoint(%mini,%client) Used to find where the client will spawn. Return a brick to set that as the spawn point.

postDeath(%mini, %client,%obj,%killer,%type,%area) Called when players die.

postReset(%mini,%client) Called after the minigame is reset.

postVictory(%mini,%winner,%nameList) Called after the winner of the round is announced.

preDeath(%mini, %client,%obj,%killer,%type,%area) Called when players die. Return 1 TAB “blah” for a special death message.

preReset(%mini,%client) Called before the minigame is reset.

preVictory(%mini,%winner,%nameList) Called before the winner of the round is announced.

Teams_onAdd(%mini,%teamSO,%team) Called when a team is added.

Teams_onChat(%mini,%client,%msg) Called when a client sends a teamchat message.

Teams_onJoin(%mini,%team,%client) Called when a client joins a team.

Teams_onLeave(%mini,%team,%client) Called when a client leaves a team.

Teams_onRemove(%mini,%teamSO,%team) Called when a team is removed.

victoryCheck_Lives(%mini) Used to determine if anyone has won by lives. Return a client or team to specify a victor.

victoryCheck_Points(%mini) Used to determine if anyone has won by points. Return a client or team to specify a victor.

victoryCheck_Time(%mini,%ticks) Used to determine if anyone has won by time. Return a client or team to specify a victor.

Teams

Teams can be easily edited by other mods.

Team Preferences

Slayer allows you to register preferences for teams.

if(!$Slayer::Server::Dependencies::Teams)

exec("Add-Ons/Gamemode_Slayer/Dependencies/Teams.cs");

Slayer.Teams.addPref("Example Pref","Category","variable","bool",1,1,-1,0,"Advanced","%team.doStuff(%1,%2);");

//BROKEN DOWN – YOU DON’T NEED TO INCLUDE THIS IN YOUR MODS

Slayer.addPref(

“Pref Title”,

“Category”,

“Variable”,

“Type”,

“Default Value”,

“Notify Players”,

“Admin Level”,

“isObject”,

“List”,

“Callback”

);

Greek2me | Blockland ID 11902

9

Title – The title for your preference.

Category – The category for your preference. This is especially needed if you use the “Advanced” list.

Variable – The preference’s variable. o Example – If you set the variable to “testing”, you can access it via %team.testing.

Type – What type of control the preference will appear as in the GUI. o Bool – A standard checkbox. o String – A string value.

Example – “string maxLength” – “string 200”

maxLength – A number specifying how many characters are allowed. o Int – An integer value.

Example – “int minValue maxValue” – “int -20 100”

minValue – The minimum value allowed.

maxValue – The maximum value allowed. o Slide – A slider bar.

Example – “slide minValue maxValue Ticks Snap” – “slide 0 10 9 1”

minValue – The minimum value allowed.

maxValue – The maximum value allowed.

Ticks – The number of ticks on the slider.

Snap – Bool. Whether or not slider snaps to ticks. o List – A drop-down list.

Example – “list” TAB “value1 Text1” TAB “value2 Text2” – “list” TAB “0 Shirt Only” TAB “1 Full Uniform”

Value – What the variable is set to when the matching text is selected.

Text – The text displayed for the matching value.

You may have as many sets of values and text as you want.

Default Value – The value that the preference is originally set to.

Notify Players – Whether to notify players that this preference has changed.

Admin Level – Determines permissions needed to edit this preference. o 0 – Host o 1 – Super Admin o 2 – Admin o -1 – Admin

IsObject – Whether the variable is an object. Used for things like items and playertypes.

List – Where to display this preference in the GUI. o Leave this value blank to not display this preference in the GUI or for a custom GUI. o Advanced – Display this preference in the “Advanced” team options.

Callback – A function to call when the preference is changed. o Example – “exampleFunction(%1,%2);” or “%mini.exampleFunction(%1,%2);”

%1 – The new value of the preference. %2 – The old value of the preference. %mini – The Slayer minigame. %team – The team being edited.

Client

Below is a list of Slayer’s client functions and a description of each. Each of these belongs to the

GameConnection class.

Greek2me | Blockland ID 11902

10

Function Description

addDeaths(%flag) Adds to the client’s death count.

addKills(%flag) Adds to the client’s kill count.

addLives(%flag) Adds to the client’s life count.

applyUniform() Applies the client’s team uniform.

dead() Returns whether the client is dead (can respawn).

forceEquip(%slot,%item) Forces the client to equip a certain item.

getDeaths() Returns the client’s death count.

getKills() Returns the client’s kill count.

getLives() Returns the client’s life count.

getScore() Returns the client’s score.

getTeam() Returns the client’s team (scriptObject).

nextCamTarget() Moves the client’s camera to the next player when in the deadCam.

setDead(%flag) Sets whether the client is dead (can respawn).

setDeaths(%flag) Sets the client’s death count.

setKills(%flag) Sets the client’s kill count.

setLives(%flag) Sets the client’s life count.

setTeam(%teamName) This is used for the setTeam event, but it can be used in mods as well.

updateEquip(%slot,%old) Updates the client’s item to match the minigame setting if their item has not changed from %old.