respawn_timer/Readme.md

71 lines
2.2 KiB
Markdown
Raw Normal View History

2020-11-29 07:41:25 -08:00
# Respawn Timer (`respawn_timer`)
Forces players to wait a set duration before respawning.
## About
2020-11-29 07:57:27 -08:00
Depends on [`modlib`](https://github.com/appgurueu/modlib) and [`hud_timers`](https://github.com/appgurueu/hud_timers). Licensed under the MIT License. Written by Lars Mueller aka LMD or appguru(eu).
2020-11-29 07:41:25 -08:00
## Screenshot
2020-11-29 07:47:17 -08:00
![Screenshot](screenshot.png)
2020-11-29 07:41:25 -08:00
## Links
* [GitHub](https://github.com/appgurueu/respawn_timer) - sources, issue tracking, contributing
* [Discord](https://discordapp.com/invite/ysP74by) - discussion, chatting
2020-11-29 07:48:18 -08:00
* [Minetest Forum](https://forum.minetest.net/viewtopic.php?f=9&t=25749) - (more organized) discussion
2020-11-29 07:41:25 -08:00
* [ContentDB](https://content.minetest.net/packages/LMD/respawn_timer) - releases (cloning from GitHub is recommended)
## Features
* Player is actually dead while dead (`player:get_hp() == 0`). This minimizes breakage of other mods.
* Custom respawn formspec (simple button).
* Enhanced security: Actions of dead players (chatting, inventory, ...) are forbidden.
* Basic persistence: Rejoining will only reset the timer.
## API
Relies on multiple hacks and thus imposes the following limitations on other mods:
* No manual modification of the `minetest.registered_on_dieplayers` table `on_mods_loaded`
* No insertion at index 1 of the `minetest.registered_on_chat_messages` table `on_mods_loaded`
* Mods doing this have to be listed as optional dependencies
* Mods using bone position overrides on nonstandard bones have to use the API for those to be preserved properly
* Standard bone names are `"Head"`, `"Body"`, `"Arm_Right"`, `"Arm_Left"`, `"Leg_Right"`, `"Leg_Left"`
* `respawn_timer.bone_names_by_model["<filename>.<ext>"] = { "Bone_1", "Bone_2", ... }` including standard bone names if used
* If both bone position and rotation are set to `{ x = 0, y = 0, z = 0 }`, the bone will be ignored
2020-12-22 04:40:45 -08:00
Respawning can be done using `respawn_timer.respawn(player_ref)`.
## Configuration
<!--modlib:conf:2-->
### `timer`
2020-12-28 09:26:59 -08:00
2020-12-22 04:40:45 -08:00
#### `color`
2020-12-28 09:26:59 -08:00
2020-12-22 04:40:45 -08:00
Timer fill color as hex string
* Type: string
* Default: `FF00FF`
2022-05-13 03:38:13 -07:00
* &gt;= `000000`
* &lt;= `FFFFFF`
2020-12-22 04:40:45 -08:00
#### `duration`
2020-12-28 09:26:59 -08:00
2020-12-22 04:40:45 -08:00
Timer duration in seconds
* Type: number
* Default: `5`
2022-05-13 03:38:13 -07:00
* &gt;= `0`
* &lt;= `6000`
2020-12-22 04:40:45 -08:00
#### `name`
2020-12-28 09:26:59 -08:00
2020-12-22 04:40:45 -08:00
Timer caption
* Type: string
* Default: `Respawn`
<!--modlib:conf-->