StormFox API
Definitions:
- time-varable is a number between 0 and 1440 that indicates the time.
- 1440 and 0 is midnight
- 360 is sunrise
- 720 is midday
- 1080 is sunset
- Brackets
- "[]" around an argument or result, means its optional. It can be left/return as a nil.
List of commen and useful functions:
Time Functions
| Functions | Description | Eample of input |
|---|---|---|
| StormFox.StringToTime(String: time-string) | returns time-value from a string. Incl AM/PM support. | "11:00 PM" or "23:00" |
| StormFox.GetTimeSpeed() | returns the ingame-minutes-pr-second, set by; sf_timespeed x. | |
| StormFox.GetTime(boolean: return wholenumbers) | returns the current time-varable. | |
| StormFox.GetRealTime([number: time-value],[boolean Use AM and OM]) | returns the current time as a string. | |
| StormFox.GetDate() | returns day, month as a number. | |
| StormFox.GetRealDate([boolean: return only 3 letters]) | returns day and month acording to StormFox, as a string. | |
| StormFox.SpecialDay([number: day],[number: month]) | returns a table of some special events, for the given or current day. | |
| StormFox.IsNight() | returns true if its night | |
| StormFox.IsDay() | returns true if its day | |
| Server Side | ||
| StormFox.SetTime(number: time-value) | Sets the current time (Don't call this often) | number time-value or String time-string |
Weather Functions
| Functions | Description |
|---|---|
| StormFox.IsRaining() | returns true if its raining |
| StormFox.IsThunder() | return true if there is thunder. |
| StormFox.CelsiusToFahrenheit(number: celsius) | returns Freedom units. |
| StormFox.GetBeaufort(number: meters-pr-second) | returns Beaufort-unit and description. |
| StormFox.GetWeather() | returns the current weather. |
| StormFox.GetWeatherID() | returns the ID of the current weather. |
| StormFox.GetTemperature(boolean: use farenheight) | returns the current temperature. |
| SERVER | |
| StormFox.SetWeather(String: Weather ID, number: magnitude, [number: transition time in seconds)] | Sets the weather |
| StormFox.SetTemperature(number: temperature, boolean: use_fahrenheit) | Sets the temperature |
| StormFox.SetThunder( boolean ) | Sets thunder |
Sun/Moon Functions
| Functions | Description |
|---|---|
| StormFox.GetSunAngle([number: time-value]) | returns the angle of the sun. |
| StormFox.GetMoonAngle([number: time-value]) | returns the angle of the moon. |
| StormFox.GetMoonPhase() | returns the moon-phase and light-procent of the moon. |
| CLIENT | |
| StormFox.GetMoonMaterial() | returns IMaterial: generated moonlight-material, IMaterial: the moondark-material, number: current moon-rotation. |
| StormFox.GetMoonVisibility() | returns moon visibility between 0-1 as a number |
| StormFox.GetSunVisibility() | returns sun visibility between 0-1 as a number |
| StormFox.GetSunRayVisibility() | returns sun-ray visibility between 0-1 as a number |
StormFox hooks
| Hooks | Description | Arguments |
|---|---|---|
| StormFox - PostInit | Called when StormFox has launched. | |
| StormFox - PostEntity | Called when StormFox is loading and entites are valid. | |
| StormFox - PostEntityScan | Called when StormFox has scanned for map-entites. | |
| StormFox - NewWeather | Called when StormFox changes weather. | String: WeatherID, String: OldWeatherID |
| StormFox - DataChange | Called when data changes. | String:DATA, Any Value, [number: lerp-time] |
| StormFox - NetDataChange | Called when network-data changes. | String:DATA, Any Value, [number: lerp-time] |
| StormFox - Timechange | Called when timespeed changes. (sf_timespeed) | number |
| StormFox - Timeset | Called when time have been set. | |
| StormFox-Sunrise | Called on sunrise | |
| StormFox-Sunset | Callen on sunset | |
| StormFox-NewDay | Called on new days |
