-
Notifications
You must be signed in to change notification settings - Fork 0
Mappack gameinstructions.cfg
MMeent edited this page Feb 14, 2014
·
3 revisions
Most of the pvp games are automated so they work easier for the user. Nailed has added a gameloop system which you can use to automate your game. This system uses a very simple instruction system. These instructions can be added in the gameinstructions.cfg file in the order they should be executed. The gameloop can be triggered using /startgame ingame, or using redstone signals ingame (not yet implemented at the time of writing.
Instructions are added to the file in the following way:
#This is a comment
clearinventory team1
setgamemode team1 1
As you can see, a line starts with the name of the instructions, followed by the arguments seperated by ' ' (a space)
-
clearinventory- Clears the inventory of the specified team or all players if no arguments are given. -
countup- Starts counting up and keeps counting until a winner is set by either /setwinner or another way -
countdown- This will start a countdown. Argument is the amount of time to count. This can be for example10sec,5minor2hour. This will also display the countdown timer in the top right of the screen of players. -
disable- Set the value of the specified stat tofalse. See the stat system documentation for more information. -
enable- Set the value of the specified stat totrue. See the stat system documentation for more information. -
clearexperience- Sets the experience value of the specified team to 0 or all the players if no arguments are given. -
resetspawnpoint- Resets the spawnpoint of the specified team to the mappack's default spawnpoint or of all players when no arguments are given -
setdifficulty- Sets the difficulty of the map to the specified value (0 to 3) -
setfoodlevel- Sets the foodlevel of the specified team to the specified value or all players if no team argument given. -
setgamemode- Sets the gamemode of the specified team to the specified value (0 to 2) or all players if no team is given. -
sethealth- Sets the health of all the players in the specified team to the specified value (0 to 20) or all players if no team is given. -
setspawn- Sets the spawnpoint of all the players in the specified team to the coordinates given. Args: team, x, y, z -
settime- Sets the time of the map to the specified value (0 to 23999) -
startwinnerinterrupt- When a winner is set after this, the game will be stopped -
stopwinnerinterrupt- When a winner is set after this, the game will not be stopped -
setwinner- Sets the winner to the team given as argument, and stops the game if winnerinterrupt is enabled (see above). -
trigger- Triggers the stat given as argument on and turns it off after 0.3 seconds. -
watchunready- When the state of a team or player changes from ready to not ready after this, the gameloop will stop -
unwatchunready- When the state of a team or player changes from ready to not ready after this, the gameloop will not stop -
spreadPlayersToRandomSpawns- Spreads the players to random (and unique) spawnpoints. For this you need to specify random spawnpoints in mappack.cfg -
tpToRandomSpawn- Teleports given player to a random spawnpoint. For this you need to specity random spawnpoints in mappack.cfg -
wait- The gameloop will sleep the specified amount of time. Example:1sec,3min,2hour -
teleportall- This will teleport all players to the mapid given as an argument. Give 0 to teleport to lobby. -
unloadmap- This will unload and remove the map from the server, teleporting all players to their safehouses.
This example is from the pvp game Nail.
#Nail game loop
watchunready
countdown 10sec The game will start in %s
unwatchunready
startwinnerinterrupt
#Start Blue
clearinventory teamblue
setspawn teamblue 903 86 1192
setgamemode teamblue 0
sethealth teamblue 20
setfoodlevel teamblue 20
clearexperience teamblue
enable startblue
#World things
settime 12500
setdifficulty 2
#Countdown
countdown 1min %s left until the invaders will be released
#Startred
setspawn teamred 922 84 787
setgamemode teamred 0
sethealth teamred 20
setfoodlevel teamred 20
clearexperience teamred
enable startred
#Game End
countdown 20min %s left
setwinner teamblue
setdifficulty 0