refurbished readme

This commit is contained in:
AliasAlreadyTaken 2023-05-19 22:56:45 +02:00
parent f5442a5c33
commit 5a2e8591e9

View File

@ -3,91 +3,98 @@
## Purpose
This mod allows staff or code to show movies to players.
The yl_cinema mod enables staff or code to show movies to players.
## Download
Get it from https://gitea.your-land.de/your-land/yl_cinema
Download the mod from [here](https://gitea.your-land.de/your-land/yl_cinema).
## Installation
Copy the "yl_cinema" folder to your mod folder and enable it in your world.mt.
1. Copy the "yl_cinema" folder to your mod directory.
2. Enable the mod in your world.mt file.
## Configuration
Find config in ./settingtypes.txt
The mod's configuration can be found in `./settingtypes.txt`. Modify the following settings:
```
yl_cinema.save_path = "yl_cinema_movies"
yl_cinema.admin_priv = "staff"
```lua
yl_cinema.settings.save_path = "yl_cinema_movies"
yl_cinema.settings.admin_priv = "staff"
yl_cinema.settings.enable_bigscreen = true
yl_cinema.settings.enable_craft_bigscreen = true
yl_cinema.settings.enable_craft_bigscreen_recipe = "wool:grey,wool:grey,wool:grey,wool:grey,wool:grey,wool:grey,wool:black,,wool:black"
```
## Modmakers
API: Call these function from your mod to show a movie to a player
### API Functions
```
success, msg, movielist = yl_cinema.listmovies(name, searchterm)
The yl_cinema mod provides the following API functions that can be called from your own mod:
```lua
success, msg, movielist = yl_cinema.listmovies(searchterm)
```
Parameters
* `name` : string. The name of the player the movielist will be shown to.
* `searchterm` : string or nil. An optional searchterm. If set, movielist will only contain the movies that have the searchterm in the title or description.
Parameters:
- `searchterm` (optional): A string used to filter the movie list by title or description.
Returns
* `success` : boolean. Is `true` if a movielist was returned. Is `false` if an error occurred
* `msg` : string. Errormessage if success is false, number of movies if success is `true`
* `movielist` : table of strings. Contains unordered list of `movie_id`s in the format `{"id1","id7","id27","id3"}`. May be empty `{}` if no movie was found.
Returns:
- `success`: A boolean indicating whether the movie list was returned successfully.
- `msg`: An error message if `success` is false, or the number of movies if `success` is true.
- `movielist`: An unordered table of movie IDs in the format `{"id1","id7","id27","id3"}`. It may be empty `{}` if no movies were found.
```
```lua
success, movie = yl_cinema.showmovie(name, movie_id, target_player_name)
```
Parameters
* `name` : string. The name of the player who sends causes the movie be shown.
* `movie_id` : string. The movie ID that is means to be shown.
* `target_player_name` : string or nil. The name of the player the movie is shown to.
Parameters:
- `name`: The name of the player who triggers the movie to be shown.
- `movie_id`: The ID of the movie to be shown.
- `target_player_name` (optional): The name of the player the movie is shown to.
Returns
* `success` : boolean. Is `true` if a movielist was returned. Is `false` if an error occurred
* `movie` : string containing Errormessage if success is `false`, table of movie if success is `true`
Returns:
- `success`: A boolean indicating whether the movie was shown successfully.
- `movie`: A string containing an error message if `success` is false, or a table representing the movie if `success` is true.
```
```lua
success, msg = yl_cinema.getmovie(movie_id)
```
Parameters
* `movie_id` : string. The movie ID that is means to be shown.
Returns
* `success` : boolean. Is `true` if a movie was returned. Is `false` if an error occurred
* `msg` : string. Errormessage if success is `false`, number of movies if success is `true`
Parameters:
- `movie_id`: The ID of the movie you want to retrieve.
Returns:
- `success`: A boolean indicating whether the movie was retrieved successfully.
- `msg`: An error message if `success` is false, or a table with the movie structure (as described in "Create a movie") if `success` is true.
## Usage
There are two chatcommands to show players movies.
The mod provides two chat commands for showing movies and listing movies:
* `showmovie <name> <movie>` : Shows to the <player> the <movie>.
- `/showmovie <name> <movie>`: Shows the `<movie>` to the specified `<player>`.
- `/listmovies [<searchstring>]`: Lists all movies. Optionally, you can provide a `<searchstring>` to filter the movie list.
* `listmovies [<searchstring>]` : Shows the whole movielist to you. Filter the movielist with <searchstring>.
## Create a Movie
## Create a movie
To create a movie, follow these steps:
Create a folder with the movie_id as name. Ask your admin which prefix, suffix or other markings are accepted.
1. Create a folder with the movie ID as the name. Consult your admin for any required prefixes, suffixes, or other markings.
2. Inside the folder, create a JSON file with the following structure: `{movie_id, name, description, title_texture, replay, [{order, texturename, caption, captionposx, captionposy, duration},{...}]}`.
3. Create a "textures" folder inside the movie ID folder and place all the textures of your movie in it
Inside the folder, create a JSON file with structure `{movie_id, name, description, title_texture, replay, [{order, texturename, caption, captionposx, captionposy, duration},{...}]}`
Create a new folder inside the movie_id folder and name it textures. Place all the textures of your movie here. Please note, their filenames need to correspond to the `title_texture` and `texturename` from the pages.
Copy the movie to your yl_cinema.save_path, by default "yl_cinema_movies"
. Ensure that the filenames correspond to the `title_texture` and `texturename` specified in the JSON file.
4. Copy the movie to the yl_cinema.save_path, which is by default "yl_cinema_movies".
## Uninstall
Remove it from your mod folder or deactivate it in your world.mt
To uninstall the mod:
Mods that depend on it will cease to work, if the mod is removed without proper replacement.
1. Remove the mod from your mod folder.
2. Deactivate it in your world.mt file.
Note: If other mods depend on yl_cinema, they will stop working if the mod is removed without a proper replacement.
## License
MIT
This mod is licensed under the MIT License.