forked from your-land/yl_cinema
adding things, maybe
dev | ||
json.lua | ||
textures | ||
.luacheckrc | ||
api.lua | ||
chatcommand_movie_list.lua | ||
chatcommand_movie_show.lua | ||
chatcommands.lua | ||
config.lua | ||
dependencies.lua | ||
feature_bigscreen_crafting.lua | ||
feature_bigscreen_entity.lua | ||
feature_bigscreen_integration.lua | ||
feature_bigscreen_items.lua | ||
feature_bigscreen.lua | ||
features.lua | ||
init.lua | ||
initialize.lua | ||
internal.lua | ||
mod.conf | ||
README.md | ||
screenshot.png | ||
settingtypes.txt | ||
setup.lua |
yl_cinema
Purpose
The yl_cinema mod enables staff or code to show movies to players.
Download
Download the mod from here.
Installation
- Copy the "yl_cinema" folder to your mod directory.
- Enable the mod in your world.mt file.
Configuration
The mod's configuration can be found in ./settingtypes.txt
. Modify the following settings:
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 Functions
The yl_cinema mod provides the following API functions that can be called from your own mod:
success, msg, movielist = yl_cinema.listmovies(searchterm)
Parameters:
searchterm
(optional): A string used to filter the movie list by title or description.
Returns:
success
: A boolean indicating whether the movie list was returned successfully.msg
: An error message ifsuccess
is false, or the number of movies ifsuccess
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.
success, movie = yl_cinema.showmovie(name, movie_id, target_player_name)
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
: A boolean indicating whether the movie was shown successfully.movie
: A string containing an error message ifsuccess
is false, or a table representing the movie ifsuccess
is true.
success, msg = yl_cinema.getmovie(movie_id)
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 ifsuccess
is false, or a table with the movie structure (as described in "Create a movie") ifsuccess
is true.
Usage
The mod provides two chat commands for showing movies and listing movies:
/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.
Create a Movie
To create a movie, follow these steps:
- Create a folder with the movie ID as the name. Consult your admin for any required prefixes, suffixes, or other markings.
- Inside the folder, create a JSON file with the following structure:
{movie_id, name, description, title_texture, version, replay, [{order, texturename, caption, captionposx, captionposy, duration},{...}]}
. - Create a "textures" folder inside the movie ID folder and place all the textures of your movie in it. Ensure that the filenames correspond to the
title_texture
andtexturename
specified in the JSON file. - Copy the movie to the yl_cinema.save_path, which is by default "yl_cinema_movies".
Uninstall
To uninstall the mod:
- Remove the mod from your mod folder.
- 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
This mod is licensed under the MIT License.