Animation#
Animation drafts allow you to create custom night lights.
Animation drafts have the type of animation
.
Attributes#
active#
Type: boolean
Whether the draft is active and should be loaded by the game.
additive#
Type: boolean
Whether to draw the animation frames using additive blending.
alias#
Type: string
aliases#
Same as alias, but for multiple IDs.
animation#
Type: Animation
array
author#
Type: string
The name of the author behind the draft.
category#
Type: string
ID of the category the draft should be contained in.
category from#
Type: string
Draft ID to grab category from and use for the draft.
color#
Type: Color
A color that can be used to tint the animation.
colors#
An array of colors that can be used to tint the animation.
If multiple colors were provided a random color will be picked for an animation spot based on building location and seed.
dev#
Type: boolean
final#
Type: boolean
If set to true, the draft can no longer be overriden.
frame animation indices#
Must be used together with the animation attribute.
frames#
Frames to use for the animation.
frames winter#
handle interpolation#
Type: integer
hidden#
Type: boolean
Whether the draft shows up in the toolbar.
hide id#
Type: boolean
Whether to hide the draft ID even when the debug mode is enabled. This will automatically be set to true if final is set to true or if your draft is part of an encrypted plugin file.
icon frames#
icon frames winter#
id *#
Type: string
Unique identifier of the draft.
index#
Type: boolean
Whether to allow the draft to be indexed by Lua methods.
inherit#
Type: boolean
Whether to modify a draft of the same ID by inheriting values.
light#
Type: boolean
If set to true the game's shading (ie for night) will not be applied to the animation.
light switching#
Type: boolean
If set to true the animation will only be shown during night with some probabilistic switching behaviour dependent on the using object.
loop#
Type: boolean
max version#
Type: integer
The maximum game version that will run the draft.
meta#
Type: Meta
min version#
Type: integer
The minimum game version required to run the draft.
mute#
Type: boolean
Whether to suppress any errors that have occurred while loading the draft.
mute lua#
Type: boolean
night light probability#
Type: float
The probability of the light to turn on during night. 1 means it will always switch on. Smaller values mean that location and spot seed will be used to determine whether to switch it on.
not implemented#
Type: boolean
Whether the draft has to be inherited to be considered implemented. Will cause an error otherwise.
once#
Type: boolean
Whether the draft should be loaded once.
What this means is that if another draft is encountered with the same ID, game will ignore loading it rather than failing with an error message.
ordinal#
Type: integer
Position of the draft in a category. Lower ordinal value will list the draft higher. Negative values are allowed.
ordinal from#
Type: string
ID of the draft to grab ordinal from. Must be used in combination with the ordinal attribute.
override#
Type: boolean
Whether to modify a draft of the same ID by replacing values.
Rather than replacing the values, you may want to add or only change specific values of the draft. For that refer to the inherit attribute.
ping pong#
Type: boolean
premium#
Type: boolean
Whether the draft is premium. A draft that is considered premium will not be active in non premium versions of the game.
premium requirement#
Type: Nested requirement
Only loaded on premium versions.
premium requirements#
Type: Requirement
array
Only loaded on premium versions.
preview frames#
Frames that will be used for preview in the toolbar instead of regular frames.
preview frames winter#
Frames that will be used for preview in the toolbar instead of regular frames during winter.
privileged#
Type: string
Privileged key for your draft. Allows to use special features, which are restricted to trusted plugin creators only.
Deprecated
Due to a change in how the privilege system works, you are now recommended to use require privileges or require super privileges.
require privileges#
Type: boolean
Whether the draft requires features such as monthly income, frame placement, etc.
Added in version 1.11.73
require super privileges#
Type: boolean
Whether the draft requires features that are restricted to DSA.
Added in version 1.11.73
requirement#
Type: Nested requirement
requirements#
Type: Requirement
array
rotation aware#
Type: boolean
If set to true the animation is considered to be animation aware. This means that the frames are assigned into groups. The group to draw will depend on the rotation of the underlying building.
Ie if 8 frames were defined then frames 0,1 will be used for the first rotation and so on.
script#
Type: string
Used to attach a script to the current draft.
Supported modes of operation#
-
Loading the script from file:
-
Declaring the script inline:
-
Using a helper script
#LuaWrapper
for Real time script editing:
scripts#
Like script, but for multiple scripts.
searchable#
Type: boolean
Whether the draft can be searched in the toolbar.
separator#
Type: boolean
Whether to separate draft from others in a category.
show new marker#
Type: boolean
Whether the draft will show a new marker in the toolbar.
sound click#
Type: obj
This sound will be played when clicked on the draft in default mode.
Example#
{
"sound click": {
"file": "path to file.mp3",
// alternatively there's "res" string attr to refer to a game resource
}
}
speed#
Type: float
Animation speed multiplier.
strict lua#
Type: boolean
template#
Type: string
ID of the template draft to inherit the implementation from.
You can also reference other templates.
template parameters#
template prefix#
Type: string
Has effect only when using templates.
Example#
Say you have some template drafts with IDs $ja_building_template00
, $ja_residential_template00
.
Instead of specifying them fully like so
You can instead use the attribute like so:
templates#
Like template, but accepts multiple IDs.
text#
Type: string
Description, usually of the building.
text id#
Type: string
title#
Type: string
Title, usually of the building.
title id#
Type: string
type *#
Type: string
A special attribute that determines what kind of attributes and abilities a draft has.