dev | ||
json.lua | ||
.luacheckrc | ||
chatcommands.lua | ||
config.lua | ||
init.lua | ||
internal.lua | ||
mod.conf | ||
README.md | ||
screenshot.png | ||
settingtypes.txt | ||
setup.lua |
yl_cinema
Purpose
This mod allows staff or code to show movies to players.
Download
Get it from 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.
Configuration
Find config in ./settingtypes.txt
yl_cinema.save_path = "yl_cinema_movies"
yl_cinema.admin_priv = "staff"
Modmakers
API: Call these function from your mod to show a movie to a player
success, msg, movielist = yl_cinema.listmovies(name, 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.
Returns
success
: boolean. Istrue
if a movielist was returned. Isfalse
if an error occurredmsg
: string. Errormessage if success is false, number of movies if success istrue
movielist
: table of strings. Contains unordered list ofmovie_id
s in the format{"id1","id7","id27","id3"}
. May be empty{}
if no movie was found.
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.
Returns
success
: boolean. Istrue
if a movielist was returned. Isfalse
if an error occurredmovie
: string containing Errormessage if success isfalse
, table of movie if success istrue
success, msg = yl_cinema.getmovie(movie_id)
Parameters
movie_id
: string. The movie ID that is means to be shown.
Returns
success
: boolean. Istrue
if a movie was returned. Isfalse
if an error occurredmsg
: string. Errormessage if success isfalse
, number of movies if success istrue
Usage
There are two chatcommands to show players movies.
-
showmovie <name> <movie>
: Shows to the the . -
listmovies [<searchstring>]
: Shows the whole movielist to you. Filter the movielist with .
Create a movie
Create a folder with the movie_id as name. Ask your admin which prefix, suffix or other markings are accepted.
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"
Uninstall
Remove it from your mod folder or deactivate it in your world.mt
Mods that depend on it will cease to work, if the mod is removed without proper replacement.
License
MIT