Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions Docs/articles/scene-tutorial.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# CustomScene
A CustomScene is Slugbase's method of allowing an easy way for mod creators to add slugcat-specific scenes, such as unique select screens, sleep screens, or even part of sequences such as intros.

CustomScenes are stored either in the `slugbase/scenes/` folder as unique .json files, or inside of [CustomSlideshow](https://github.com/nonAssociatedIdiot/SlugBaseRemixExtraDocs/edit/master/Docs/articles/slideshow-tutorial.md)s.
# Basic Usage
## "id"
`MenuScene.SceneID` (acts like a `string`)\
Ex. `"id": "Sleep_MySlugcat"`

ID is a `SceneID`, which effectively is a string that no other scene should share. Instead of referencing a file name, all built-in SlugBase features reference whatever ID that is put here.

If no ID is defined, the scene will not be able to be referenced, unless it is a scene that is inside of a [CustomSlideshow](https://github.com/nonAssociatedIdiot/SlugBaseRemixExtraDocs/edit/master/Docs/articles/slideshow-tutorial.md).
## "scene_folder" (Optional)
`string`\
Ex. `"scene_folder": "scenes/sleep - myslugcat"`

SceneFolder is a `string`, acting as a directory from the root of your mod (usually a folder in `StreamingAssets/mods/`) of which all of the images within this scene will use instead of the root directory. Do not add a `/` to the end, as it may cause errors!

For example, with a specific scene there are 5 images stored in the folder `StreamingAssets/mods/myslugcat/scenes/sleep - myslugcat/`, each with a number name (such as `1.png`, `2.png`, etc). I could individually input each image with its filepath (as `scenes/sleep - myslugcat/1`, `scenes/sleep - myslugcat/1`, etc), or I could put `"scene_folder": "scenes/sleep - myslugcat"` at the start and then input the images as `1`, `2`, and so on instead.
## "idle_depths"
`float[]`\
Ex. `"idle_depths": [ 2.8 ]`

IdleDepths is an array of `float`s that determines what depths the camera may focus on. For death screens, the camera focus usually only has one focus, but for others, there is more room for variation.
# Select Screen Usage
This section is for parameters that are only effective on the select menus. All of these are optional, and none of these have any effect within slideshows or anywhere outside of the select screen.
## "slugcat_depth"
`float`\
Ex. `"slugcat_depth": 2.8`

SlugcatDepth is a `float` that determines the depth of the slugcat (or main object/creature of the scene). It's recommended to choose one of the numbers that `idle_depths` has, as otherwise the focus may only be on the object/creature you want focused on for a short period of time.
## "mark_pos"
`Vector2`\
Ex. `"mark_pos": [620,500]`

MarkPos is a `Vector2` (which is effectively an array of 2 integers) that determines where the Mark of Communication appears on the scene if the slugcat has acquired it on the current save file.
## "glow_pos"
`Vector2`\
Ex. `"glow_pos": [620,400]`

GlowPos is a `Vector2` (which is effectively an array of 2 integers) that determines where the glow from the Mark of Communication appears on the scene if the slugcat has acquired it on the current save file. Usually, it's best to set the second number to 100 below whatever your `mark_pos` is.
## "select_menu_pos`
`Vector2`\
Ex. `"select_menu_pos": [0, 0]`

SelectMenuOffset is a `Vector2` (which is effectively an array of 2 integers) that offsets all images in the scene by whatever numbers are within it.
# Images Within Slideshows
The "images" array is filled with `CustomScene.Image`s, which are just objects of which contain information about the layered images of the scene. Here are the constructors of each image:
## "name"
`string`\
Ex. `"name": "scenes/sleep - myslugcat/abc"` (When the image is stored at `StreamingAssets/mods/myslugcat/scenes/sleep - myslugcat/abc.png` and [`scene_folder`](https://github.com/nonAssociatedIdiot/SlugBaseRemixExtraDocs/blob/master/Docs/articles/scene-tutorial.md#scene_folder-optional) is not defined)

Name determines the filepath of the image shown. If [`scene_folder`](https://github.com/nonAssociatedIdiot/SlugBaseRemixExtraDocs/blob/master/Docs/articles/scene-tutorial.md#scene_folder-optional) is defined, SlugBase will look for the file at whatever folder (that is inside the mod folder) that it defines, instead of `StreamingAssets/mods/<mod_id>`.
## "pos"
`Vector2`

Position is a `Vector2` (which is effectively an array of 2 integers) that determines the pixel location of where the image is on-screen.
## "flatmode" (Defaults to `false`)
`bool`\
Ex. `"flatmode": true`

If `true`, this image will display when in flat mode and will be hidden otherwise. (When using flatmode, be sure that the image's depth is set to -1!)
## "depth"
`float`\
Ex. `"depth": 2.5`

Depth is a `float` determining the image's depth.
## "shader" (Defaults to `Menu.MenuDepthIllustration.MenuShader.Normal`)
`MenuDepthIllustration.MenuShader`\
Ex. `"shader": "Basic"`

Shader is how the image is rendered. By default, it uses the vanilla `Normal` shader.
# Example Scene
You can dig through [here](https://github.com/SlimeCubed/SlugTemplate/tree/master/mod) for finding the example for how the scenes are constructed and referenced.
63 changes: 63 additions & 0 deletions Docs/articles/slideshow-tutorial.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# CustomSlideshow
A CustomSlideshow is Slugbase's method of allowing an easy way for mod creators to add slugcat-specific slideshows, such as intro, dream, or ending sequences.

CustomSlideshows are stored in the `slugbase/slideshows/` folder as unique .json files.
# Basic Usage
## "id"
`SlideShow.SlideShowID` (acts like a `string`)\
Ex. `"id": "Intro_MySlugcat"`

ID is a `SlideShow.SlideShowID`, which effectively is a string that no other scene should share. Instead of referencing a file name, all built-in SlugBase features reference whatever ID that is put here.

If no ID is defined, the scene will not be able to be referenced.
## "slideshow_folder" (Optional)
`string`\
Ex. `"slideshow_folder": "scenes/intro - myslugcat"`

SlideshowFolder is a `string`, acting as a directory from the root of your mod (usually a folder in `StreamingAssets/mods/`) of which all of the images within this scene will use instead of the root directory. Do not add a `/` to the end, as it may cause errors!

(An example for how it works can be found here(insert link).)
## "music"
`CustomSlideshow.SlideshowMusic`\
Ex.
```
"music": {
"name": "RW_Outro_Theme_B",
"fade_in": 5
}
```
Music is a `CustomSlideshow.SlideshowMusic`, which is an object with two inputs: `"name"` and `"fade_in"`. `"name"` is a string representing the file name of the sound to use from the `StreamingAssets/music/songs` folder, and `"fade_in"` is a float representing the amount of seconds to fade the music in.
## "next_process"
`ProcessManager.ProcessID`\
Ex. `"next_process": "Credits"`

Process is a `ProcessManager.ProcessID`, which acts like a string. All of the available-to-reference processes are listed [here](https://rainworldmodding.miraheze.org/wiki/Slideshows_and_Scenes#Next_process).
# Using Scenes Within Slideshows
To use scenes within slideshows, first you must start with a `"scenes": []`, and fill the array with the json from each scene. However, these do not act like normal scenes in some ways. Mainly in that some of the focusing-related parameters of a scene are obsolete, and are replaced with the ability to control the focus and camera movement. Here are the added parameters of any given slideshow scene:
## "fade_in_start"
`float`\
Ex. `"fade_in_start": 1.1`

StartAt is a `float` that determines the time of which the scene will begin to fade in. The time is recorded in seconds from the point that the cutscene started playing, so keep in mind that all of the time-related parameters should be chronological (so that two scenes aren't playing at the same time).
## "fade_in_end"
`float`\
Ex. `"fade_in_end": 3.5`

FadeInDoneAt is a `float` that determines the time of which the scene will finish fading in. (This is not the length of how long the fading in is! You can calculate how long a given scene takes to fade in by doing `fade_in_end`-`fade_in_start`.)
## "fade_out_start"
`float`\
Ex. `"fade_out_start": 9.2`

FadeOutStartAt is a `float` that determines the time of which the scene will begin to fade out. (There are no parameters for how long the fading out is.)
## "camera_path"
`Vector3[]`\
Ex.
```
"camera_path": {
[0, 100, 0.5],
[10, 200, 0.7],
[-50, 150, 0.4]
}
```

CameraMovement is an array with `Vector3`s in it. The first/second numbers represent the x/y (in pixel position) of the camera, and the third number represents the depth of focus.
2 changes: 1 addition & 1 deletion Docs/articles/world-state-tutorial.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# World State

A "World State" is SlugBase' way of categorizing all world-related slugcat specific changes. A SlugBase slugcat can inherit a world state from another slugcat to use its same room connections, spawns, accessible regions, and so on. The world will appear as if it was the campaign of the other slugcat, except for non-world changes, such as iterator states, echoes, campaign cutscenes, ect.
A "World State" is SlugBase's way of categorizing all world-related slugcat specific changes. A SlugBase slugcat can inherit a world state from another slugcat to use its same room connections, spawns, accessible regions, and so on. The world will appear as if it was the campaign of the other slugcat, except for non-world changes, such as iterator states, echoes, campaign cutscenes, etc.

# Basic Usage

Expand Down