Skip to content

Mod Items

joscha999 edited this page Oct 1, 2021 · 1 revision

While a mod is the package the mod items are the items inside that package. The mod defines the basic data like name and saves additional data like the Workshop description but cannot describe how a custom item is build up. The mod item is specific to one thing which it can describe perfectly.

Any mod may have as many items as you want, there's no limit!

The following items are currently available:

Screen Video

A Screen Video is a list of textures (JPG images) that are played at a specific speed on either a slot machine or a TV.

Video Type:

  • "SlotGame" videos are used on slots and must be 512x1024 px.
  • "Widescreen" videos are used on TVs and must be 256x128 px.

Path to JPGs: This file input is used to select the folder from which you want to create this video. The folder should contain only the JPGs that make up your video and the files should be named as simple as possible (e.g. myGreatSlotGame001.jpg, myGreatSlotGame002.jpg ...). Please note that files are loaded in sorted order but not in natural sorted order, this means a file ending in "10.jpg" is sorted in front of a file ending in "2.jpg" - to avoid this you can use the example and end all names with "001.jpg", "002.jpg" and so on.

Play speed Factor: This is a decimal value letting SimCasino know whether or not your video should be played faster or slower. There's no real tip here besides checking on the video in-game and seeing whether or not it needs to be speed up or slowed down.

Loop Video: If set the video will just start over when hitting the end; if not set the last frame will be held indefinitely.

I18n

I18n is short for Internationalization - throughout SimCasino this system is used to translate text. In mod items i18n "keys" may come up which means your mod also requires an i18n item.

One i18n item may contain several texts but only for one "IETF" (the language code this i18n item is used for). You generally want to have at least one i18n file for English for your base texts (though you can add as many languages to your mod as you'd like).

Besides Name and IETF the i18n item editor presents a bit "+" button and a list of Key-Value pairs. Hit the "+" to add new pairs and hit the "Remove" button on the right of a specific pair to remove it again.

The key is the defines where the game should look for, it has to start with your username to avoid conflicts with the base game texts or other mods. The value is the text you want to display. E.g: You'd like to add the name for an object your just made named "My Fancy Plant"; You add an i18n item for English (if your mod doesn't have one yet) and add a new Key-Value pair; As the key you set ".MyFancyPlant.name" and as value you set "My Fancy Plant"; You can now use your key in a modded object or other mod item field that requires an i18n key and the text "My Fancy Plant" will be displayed (or its translation into the user selected language if it's available).

TV Station

A TV Station is a simple definition combining a Screen Video set to the Widescreen type and an i18n text to show up as a named station on the big TV object.

Station Name I18n Key: This must be any key you set up in your i18n - see the I18n section above for more info on how to set that up!

Video Name: This is the name of the Screen Video item that should be shown for this station - please note that the name must match exactly!

Slot Game

A Slot Game item defines a slot game that can be installed on the existing slot machines.

Game Speed: This defines how long each "Spin" of your game will take and is defined by 10/x seconds where x is the value you enter.

Slot Game Name (I18n Key): This must be any key you set up in your i18n - see the I18n section above for more info on how to set that up!

Path to Slot Game Icon: The slot icon in the install screen - should be a 16:9 image but may be any resolution or format as the game will scale it to fit on the UI correctly.

Path to Emission Texture: The emission texture is a small texture defining how the LED areas on slots should shine, it can be any funky color combination or just blank for no animation.

Screen Videos: This section is used to define the specific videos. Please note that the names must exactly match the name defined in the Screen Video item. While only the "Idle" video is necessary having a video for all states will look better.

Slot Market Settings: The market setting adjusts how the slot market works for this game, you can either use one of the presets or try changing the 3 parameters up to get it just right!

Floor/Wall (Construction Material internally)

A Floor to place on the ground or Paint/Wall material for walls.

Floor/Wall Name (I18n Key): This must be any key you set up in your i18n - see the I18n section above for more info on how to set that up!

Type: What this item defines (Floor or Wall material).

Group: Which group this item should be sorted in when displayed in the construction menu in-game.

Floor Tiling Factor: If used on a Floor type this scales the texture in-game. A 2x tiling factor will mean the texture will span 2x2 cells.

Path to Albedo Texture: The Albedo texture is your normal color texture - the one that should be displayed in-game. Note: If you have transparency in your Albedo textures players can apply a custom color to those parts!

Path to Normal Texture: The Normal texture is a definition on how light should reflect on the material - if you're not quite sure what this is check out this page by Unity: Unity Normal Mapping Guide The guide also contains a flat/empty normal you can use for anything you're creating when lighting doesn't matter - see the "Why the bluey-purple colours?" section!

Path to Preview Image: This is the icon that will be shown in the construction menu in-game, usually a scaled down version of the albedo texture is used.

Wall Tiling Factor X and Wall Tiling Factor Y: Similar to the Floor Tiling Factor this is used to scale walls but in this case two dimensions are supported which you can separately adjust.

Picture

A simple picture that can be used in the existing picture frames.

Path to Albedo Texture: The texture that should be shown in the picture frame.

Path to Preview Image: The icon that will be shown in the picture selection dialog when placing a picture frame.

Code

A code mod which can alter how the whole game works! For an example please check the official example mod. The Harmony mod is uploaded on the SimCasino Workshop, if you require it please subscribe to the existing version and reference it!

Path to DLL: The DLL containing your mod - please note that currently code mods cannot be reloaded at runtime, when you change something and recompile you'll have to restart SimCasino.

Placeable Object

Placeable objects are the definition of all objects in SimCasino, use this to create a custom object.

This is only a short overview of the editor, for a more detailed explanation of what a specific property or component does please see <TODO: guide for properties and components> - until it's made please visit the discord and ask away in the Modding-Discussion channel, we'll help you out :).

The editor is build up of two sides, on the left you have the base data definition and on the left you have the components. Base data defines things like the 3d Model that should be used or how much the object should cost while components define how the object acts or what it can be used for. You can have all components on one object but generally some specific ones make more sense then trying to fit them all onto one! Some components will require/depend on other components to exist but any specific component can only be added once.

Model

Defines a 3d model to be loaded which can be used for custom objects. Note that currently only GLTF V2 is supported (Blender has an export function build in for this, other 3d modeling programs may or may not) and the object should be packaged as a .glb file.

If you're using Blender please always apply Transformation, Rotation and Scale, to do so hit Ctrl + A and hit the three options. If this isn't done the Rendering system used in SimCasino cannot correctly understand the bounds of the object and weird culling issues may come up where the object is invisible even though it's still in the sight of the Camera.