This package contains the basic game logic for a King of the Hill style game.
It was designed to work with the starter game templates and relies on the default gameController and scoreScript to control rounds and award points to players. It’s currently only been tested with the Free For All starter template but it should work with others as well. Of course, if you run into any issues, find me on the Crayta Discord and I’ll try to help.
Demo game: Stand Your Ground - FFA KotH
- Install the “King of the Hill Game Logic” package from the Community tab.
- Place an instance of the “King of the Hill Locator” template somewhere in your world.
- On your gameController entity, add the following events:
- OnRoundStart -
kingoftheHillLocator > hillControllerScript > StartSchedules
- OnRoundStart -
- OnRoundEnd -
kingoftheHillLocator > hillControllerScript > CancelSchedules
- OnRoundEnd -
- Configure the properties to suit your game.
All of the configuration options can be found on the King of the Hill Locator. They include the following properties:
- Hill Triggers - An array of triggers that define the area that players must control.
- Check Interval - The amount of time (in seconds) between checking if any players are within the defined Hill Triggers.
- Score Interval - The amount of time (in seconds) between awarding points to a player if they are the only player within the Hill Triggers.
- Points Per Interval - The amount of points to award each Score Interval.
- Must Stay In Trigger - If true, a player must remain within the Hill Triggers in order to gain points.
- Must Be Alive - If true, a player must remain alive in order to gain points.
- Win By Score - If true, when a player reaches the Winning Score the On Winning Score events will fire.
- Winning Score - The value of points a player must reach to fire the On Winning Score events.
- Count Down To Zero - If true, all players will start with the Winning Score and the On Winning Score events will fire when a player reaches zero.
- On Winning Score - Events to fire based on the Win By Score and Winning Score properties. For starter templates to end the round, this will likely need an event set to “gameController / gameScript / EndPlay”.
- You Are King Msg - The message to display for the current king.
- You Are Not King Msg - The message to display for the current king when they are no longer the king.
- Someone Is King Msg - The message to display to all other players who are not the king. The message format is “[NAME] … message” so this message should start with a space.
- Multiple Kings Msg - The message to display when multiple players are in the Hill Triggers.
- No King Msg - The message to display when there are no players in the Hill Triggers.
- Persistent No King Msg - If true, the No King Msg will always be visible to all players when no players are within the Hill Triggers.
NOTE: I suspect there will be some issues if your game uses teams, as the logic that checks for players within the Hill Triggers is explicitly set to award points only when there is a single player within the triggers. I’ll try to add a config option for this soon.
And as always, a brief gif of the package in action: