Skip to content
Nak edited this page Aug 17, 2021 · 11 revisions

There are two ways of interacting with SF2.

  • CWI ( Commen Weather Interface )

This is the start of an API that (hopefully) will be used by all weather-like mods, like; SF1, Atmos and Atmos2.

It is recommended to use CWI in the future for small interactions like checking for rain / snow or time. As it is aimed at being used by other time/weather-mods.

Note: This is still WIP, might change in the future!

  • StormFox2 API

Unlike SF1, SF2 has been build up in subcategories, making it more organized. E.g; StormFox2.Weather.<X> has all the weather functions.

Due to StormFox 2 being more asynchronous, it is required that most additions (i.e new weather-types) are created on both the client and server.

Note: Most functions are inaccessible until stormfox2.preinit and stormfox2.postinit-hook gets called!
Tip: To check if StormFox2 is installed, you can do if StormFox2 then ..

Variables Description
alt text StormFox2.Version Version number
Main Hooks Description
alt text stormfox2.preinit Gets called just before stormfox2.postinit. Use this for new weather-types or heavy edits.
alt text stormfox2.postinit Gets called when SF2 is done loading. Use this for interactions.
Subcategories Description
alt text StormFox2.Time Time related functions.
alt text StormFox2.Temperature Temperature functions.
alt text StormFox2.Weather Weather related functions.
alt text StormFox2.Downfall Downfall is particle functions like raindrops.
alt text StormFox2.Terrain Terrain are objects that change the map. I.e "snow" that change textures.
alt text StormFox2.Map Map functions gives access to map-related data and functions.
alt text StormFox2.Data Data holds all calculated variables that are used by effects.
alt text StormFox2.Network Sets and sends the data to all clients
alt text StormFox2.Client Contains the GetQualityNumber function.
alt text StormFox2.Environment Functions regarding the clients current environment. I.e if they're outside.

Wiki

API

  • alt text CWI
  • alt text Time
  • alt text Temperature
  • alt text Weather (TBD)
  • alt text Sun (TBD)
  • alt text Moon (TBD)
  • alt text Downfall (TBD)
  • alt text Terrain (TBD)
  • alt text Map (TBD)
  • alt text Data (TBD)
  • alt text Network (TBD)
  • alt text Client (TBD)
  • alt text Environment (TBD)

Clone this wiki locally