You are viewing a potentially older version of this package. View all versions.
FlyingHose-Knattleikr-1.0.0 icon

Knattleikr

Kick a dropped trophy around like a ball. Signs that start with [goal] are goals and keep the score.

Date uploaded 2 hours ago
Version 1.0.0
Download link FlyingHose-Knattleikr-1.0.0.zip
Downloads 10
Dependency string FlyingHose-Knattleikr-1.0.0

This mod requires the following mods to function

denikson-BepInExPack_Valheim-5.4.2360 icon
denikson-BepInExPack_Valheim

BepInEx pack for Valheim. Preconfigured with the correct entry point for mods and preferred defaults for the community.

Preferred version: 5.4.2360

README

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.

CHANGELOG

1.0.0

  • First release, with the rest of YesuBuildKit at 1.0.0.
  • A trophy dropped on the ground can be kicked with any melee attack: furthest with the unarmed kick, less with a weapon (a heavier one pushes farther), least with a punch. A kick on the run carries the run into the ball. Running into a ball in play nudges it about half a metre ahead. A standing kick carries about 10 metres, a running kick about 15.
  • A ball in play gets ball physics on its owner: little air drag, a bounce, and collision checked every step so it cannot pass through walls or terrain. The trophy gets its own physics back when play ends; none of it is saved.
  • Ball.Power (1, from 0.5 to 1.5) scales every touch, and no ball ever leaves faster than 16 metres a second.
  • A kicked ball is in play for Ball.InPlaySeconds (60), renewed by each touch. Auto-pickup skips it while in play; the Use key always picks it up.
  • Signs that start with [goal] are goals. Two goals within Goal.PitchRange (60 m) make a pitch; a lone goal counts on its own sign. A ball that comes within Goal.Radius (2.5 m) of the sign scores once per pass; it must go twice that far from the goal before it can score there again. The count is written inside the tag ([goal 3] Red) and the rest of the sign is never changed, and a line tells everyone near who scored. There is no goal sound.
  • Only the item's owner moves it, and a kick from another player is checked by the owner for distance and ward access. Trophies inside a ward you cannot use are never kicked.
  • Server settings Ball.Enabled, Ball.KickAnyItem, Ball.InPlaySeconds, Ball.Power, Goal.Radius, and Goal.PitchRange, shown in Althing.
  • Every player needs the mod, with the suite's version check on join.