Lightning Component

From wiki
Revision as of 00:57, 23 July 2017 by DeamonHunter (Talk | contribs) (Config Options)

Jump to: navigation, search

Category:Component Modding are all optional properties that can be added to any file. Components are useful in extending the original files with even more information, such as the cost of the item or whether the block can be broken by a weapon.

On this page, we go over the Lightning component, signified by the following;

"lightning": {
  =Content=
}

Lightning components are used to add lightning to Weather. In addition to adding lightning, this component allows you to customise the lightning to a degree.

When and How to use

Lightning component should be added to any weather that should have lightning added to it. Such as storms.

To start off with first, you will need to create a Weather. Once that is done, you can add the following below the last property of the file;

"lightning": {
  "baseDistance": 1000.0,
  "baseDistanceSpread": 900.0,
  "strikeInterval": 25.0,
  "strikeIntervalSpread": 5.0,
  "distantThunderSounds": [
    "staxel.sounds.RollingThunder"
  ],
  "nearThunderSounds": [
    "staxel.sounds.NearThunder"
  ]
}

"baseDistance" is how far away the lightning will spawn. "baseDistanceSpread" is how much additional random distance that is added or subtracted from the base distance. "strikeInterval" is how many seconds between lightning strikes. "strikeIntervalSpread" is how much additional random time that is added or subtracted from the base time. "distantThunderSounds" is a list of Sounds that will be used when the lightning is spawned more than 1000 units away. "nearThunderSounds" is a list of Sounds that will be used when the lightning is spawned less than 1000 units away.

With that, this component is complete.


Config Options

All config options must be inside the body of;

"lightning": {
  =Config Here=
}


"baseDistance"

Valid options (Float): A positive decimal number

Default Value: No default value is specified. Always need to provide your own.


This is the base amount of distance the lightning will occur at.


"baseDistanceSpread"

Valid options (Float): A positive decimal number

Default Value: No default value is specified. Always need to provide your own.


This is the additional amount of random distance that is to be added or subtracted from base distance.


"distantThunderSounds"

Valid options (List of Strings): A list of strings each pointing to a Sound code.

Default Value: No default value is specified. Always need to provide your own.


These are the lightning sounds that will be used when the lightning is greater than 1000 units away.


"nearThunderSounds"

Valid options (List of Strings): A list of strings each pointing to a Sound code.

Default Value: No default value is specified. Always need to provide your own.


These are the lightning sounds that will be used when the lightning is lesser than 1000 units away.


"strikeInterval"

Valid options (Float): A positive decimal number

Default Value: No default value is specified. Always need to provide your own.


This is the amount of seconds between lightning strikes.


"strikeIntervalSpread"

Valid options (Float): A positive decimal number

Default Value: No default value is specified. Always need to provide your own.


This is the additional amount of random time that is to be added or subtracted from base time.