Knattleikr
Kick a dropped trophy around like a ball. Signs that start with [goal] are goals and keep the score.Knattleikr
Part of FlyingHose's Modpack. Needs only BepInEx.
Trophies pile up in chests and do nothing. With this mod, a trophy dropped on the ground is a ball. Kick it around, put up two signs as goals, and the signs keep the score. Knattleikr is the old Norse ball game; a Greydwarf head will do.
No new item, recipe, or building is added. Kicking deals no damage, costs nothing beyond the attack itself, and never changes or destroys the trophy.
Kicking
Drop a trophy and swing at it. Any melee attack whose swing passes over a trophy lying on the ground sends it flying along the swing:
- The unarmed kick (the second attack with empty hands) sends it furthest, in an arc about a metre and a half high: about 10 metres from a standing kick. Kick it on the run and it goes farther, about 15 metres at a full run.
- A swing with a weapon or tool sends it less far, and a heavier weapon sends it farther than a light one.
- A punch sends it least.
The ball bounces, rolls a little, and settles. Running into a ball that is in play nudges it about half a metre ahead of you, enough to walk it along; at a full run you overtake it.
Ball.Power scales every touch. Whatever it is set to, no ball ever leaves faster than 16 metres a second, so a ball lands within about 20 metres and stays near the players.
In play
A kicked trophy is in play for 60 seconds, and every touch starts the time again. While a ball is in play, auto-pickup skips it for every player, so it is not swallowed when someone runs past. Picking it up by hand with the Use key always works, and ends play.
When play ends, the trophy is an ordinary dropped trophy again, and auto-pickup takes it as usual.
A ball that falls under the ground is put back on top of it, and a ball in play does not pass through walls or terrain, however hard it was kicked.
Goals
A sign whose text starts with [goal] is a goal. The rest of the first line is the side's name, for example [goal] Red. A ball in play that comes within 2.5 metres of the sign scores, judged along the ball's path so a fast ball cannot slip past. One pass is one point: a ball lying in the goal, or bouncing about in it, scores no more until it has gone 5 metres clear. A standing kick scores from about 10 metres, a running kick from about 15.
Each sign marks the goal its side defends. When exactly two goal signs stand within 60 metres of each other they make a pitch: a ball into the Red goal is a point for the other side, written on the other sign. The ball is then set down in the middle between the two goals.
A goal standing alone counts every ball into it on its own sign, for kicking practice. The ball stays where it is. Three or more goals within 60 metres of each other cannot tell which pair is the pitch, so each one counts on its own sign, the same as a lone goal.
The count is written inside the tag, for example [goal 3] Red, and the rest of the sign stays exactly as you wrote it, other lines included. A sign without the mod still reads as you wrote it, with the number in the tag. Only trophies score, even when other items can be kicked. Every player within 60 metres of the goal sees who scored and with what: GOAL! Thorin scores for Blue with a Greydwarf trophy. The scorer is whoever touched the ball last.
To clear a count, edit the tag back to [goal], for example [goal] Red. Nothing else resets it. The score lives only in the sign's text; the mod saves no file.
What is never kicked
- A trophy inside a ward you have no access to. Display trophies stay in their base.
- Anything on an item stand, or anything that is not lying loose on the ground.
- With the default settings, anything that is not a trophy.
Other mods
Loot Filter, Zone Storage, and Baggi work exactly as before for every item that is not in play. Loot Filter's ignore list and Knattleikr's in-play skip both use the item's own pickup mark, and Knattleikr puts back whatever value it found, so the two work together in either load order.
The server sets the numbers
Everything except the General switches is synced. On a server, the server's values are used and your own config file is ignored while you are connected. Values outside the allowed range are pulled back into it.
| Setting | Default | Range | What it does |
|---|---|---|---|
Ball.Enabled |
true | on or off | Off means nothing can be kicked, no goal scores, and auto-pickup is the game's own. |
Ball.KickAnyItem |
false | on or off | Any dropped item can be kicked, not only trophies. Goals still count trophies only. |
Ball.InPlaySeconds |
60 | 10 to 600 | How long a ball stays in play after a touch. |
Ball.Power |
1 | 0.5 to 1.5 | How hard every touch sends the ball. 1 is a standing kick of about 10 metres. No ball leaves faster than 16 metres a second at any value. |
Goal.Radius |
2.5 | 1 to 5 metres | How close a ball must come to a goal sign. |
Goal.PitchRange |
60 | 10 to 200 metres | How close two goals must be to make a pitch, and how near a player must be to hear a goal. |
Local settings, one per player:
| Setting | Default | What it does |
|---|---|---|
General.Enabled |
true | Master switch. Off means no patches and no RPCs. Needs a restart. |
General.DebugLogging |
false | Detailed log lines. |
The config file is BepInEx/config/com.yesucs.yesubuildkit.knattleikr.cfg. The settings also show in Althing.
Everyone needs the mod
The server and every player must have the same version of Knattleikr. A server with the mod refuses players who do not have it, and a player with a different version sees which version the server runs. On a dedicated server the mod does the version check, the config sync, and the goal counts on signs the server holds.
How it works
Only the game that owns a dropped item ever moves it, as the game itself does. Your game works out your kick. If it owns the ball, it applies the kick; otherwise it sends the kick to the ball's owner, which checks that you stand close and have access to any ward there before it moves anything. The mod never takes an item away from another game to move it.
While a ball is in play, its owner gives it ball physics: little air drag, a bounce, and collision checked every step so a fast ball cannot pass through a wall. When play ends, or the mod is turned off, the trophy gets its own physics back. None of this is saved; a dropped item always loads with the game's own physics.
The in-play time is stored on the ball itself, so every game agrees and it carries over if another game takes the ball over. The ball's owner checks for goals four times a second while a ball is in play, and asks the goal sign's owner to add the point, so a goal counts once.
If a game update breaks one of the mod's hooks, that part turns off with one line in the log, and the game plays as if the mod were not there.
