The King Of The Hill (KOTH) Zone is a spawnable item that players can place in their maps. It is the first in a series of items that will provide a range of different game modes for the FPS system.
The KOTH Zone gives players points when they defend it. Successful defence of the KOTH zone is defined as one player or players from one team being within the KOTH zone for a period of time, alone or with no other teams present in the zone.
The public variables on the KOTH Zone allow players to define the time required to earn points and the number of points earned. The points are integrated with the leaderboard and round system, deployed in the Safe Zone Lobby, allowing players to define the number of points required to win a round.
The KOTH zone supports a number of visible events including a dynamic animation system that will time animations to fit with the point duration defined by the player (e.g. in the tutorial video we show a flag rising up a flag pole. If the players define a point as taking 10 seconds to accrue, the KOTH zone will time the animation of the flag rising to fit with that 10 second time period, resetting the animation if the point is not completed.)
This video tutorial shows how to configure and publish your own Health and Ammo Givers as inventory items that players can in place in their own customised multi-player maps in Sinespace;
PENDING
Public variables
There are four public variables on the KOTH Zone script.
pointInterval is the time it takes for a point to be won.
points is the number of points you get each time.
team is currently pending; we will support team games on the KOTH zone shortly.
Events
You can trigger events for the zone being free, taken (in an all against all mode) or taken by a specific team.
References
There is one reference; the animator. The animator. The default animator shows a cylinder going from large and green to red and small over the course of one point period.
Animation Controller
Please note the speed is set to 0 and the animation is one second long.
Whatever you choose to animate, keep it to 1 second overall.
The script then updates the object you are animating in time with the time period defined in the pointInterval public variable; which defaults to 30 seconds but can be configured by the developer or the player setting out the item in their map.
Trigger activators
There are two trigger activators on the KOTH Zone. One is set to owner only and the other is set to exclude owner.
These are calling enterplayer / exitplayer and enterother / exitother functions on the script. You do not need to adjust these.
The KOTH Zone requires a server script that coordinates events across the network.
To upload a server script you need to create an empty game object and add the Server Script component.
Attach the KingOfTheHillServerSide LUA script from the Shooter / scripts project folder.
Give the script a class ID. This can be anything so long as you reference it on the King of the Hill zone itself. Best practice would be to follow Java style namespaces; com.sinewavecompany.sinespace.fps.koh
Add a virtual goods component to the object and select type / Server Script.
Fill out the virtual good component as usual and upload.
Please note the server script will not appear anywhere in your inworld inventory.
Once uploaded, copy the item ID; when you upload a virtual good item you can see the item ID both in the title bar of the virtual good component in the editor and in the item list in your curator.sine.space account.
On the KOTH zone itself add the Require Server Script component.
Add the item ID from the server script you uploaded. Add the class ID, copying and pasting it from the server script.
Now when you upload the KOTH Zone with the Require Server Script component attached it will listen to the Server Script you have uploaded.