Garry's Mod

Garry's Mod

StormFox 2
 This topic has been pinned, so it's probably important
Nak  [developer] 5 Apr, 2021 @ 5:25pm
For creators: Commen StormFox 2 functions.
Only post here if you got questions for adding SF2 support to your mod.
SF2 is just out of the oven and doesn't have a lot of documentation.

You can reach me on Discord if you have questions: https://discord.gg/mefXXt4u9E

Alternative, here is is some of the common functions:

Check version
The easy way to check what version is installed, is to check for "StormFox" and "StormFox2"
if StormFox and StormFox.Version < 2 then -- StormFox 1 elseif StormFox2 then -- StormFox 2 end

Time
Returns the current time as a number between 0 and 1440.
StormFox2.Time.Get( bNearestSecond = false )

Returns the current time in a string format. "13:00" or "1:00 PM" depending on clients settings.
StormFox2.Time.GetDisplay(nTime = CurrentTime)

Converts a string to a time-number ( 0-1439 )
StormFox2.Time.StringToTime( sTime )

Converts a time-number to a string.
StormFox2.Time.TimeToString( nTime, bUse12Hour )

Simple functions
StormFox2.Time.IsDay() StormFox2.Time.IsNight()

Temperature
Returns the current temperature
StormFox2.Temperature.Get(sType = "celsius")

Returns the current temperature, depending on the clients settings.
StormFox2.Temperature.GetDisplay( nCelcius = CurrentTemperature )

Returns the symbol for the current client-setting.
StormFox2.Temperature.GetDisplaySymbol()

Returns the temperature unit the client uses:
StormFox2.Temperature.GetDisplayType()

Converts temperature from one unit, to another:
StormFox2.Temperature.Convert(sTypeFrom = "celsius", sTypeTo = "celsius", nNumber)

Weather
Returns the current weather-icon
StormFox2.Weather.GetIcon()

Returns the description of the current weather
StormFox2.Weather.GetDescription()

Returns the weather-object
StormFox2.Weather.GetCurrent()

Returns true if it is raining. ( Or snowing )
StormFox2.Weather.IsRaining()

Returns the amount it is raining ( 0 - 1 )
StormFox2.Weather.GetRainAmount()

Sun/Moon
Returns the sun-angle
StormFox2.Sun.GetAngle( nTime = CurrentTime )

Returns the moon-angle
StormFox2.Moon.GetAngle( nTime = CurrentTime )

Simple functions
StormFox2.Sun.IsUp( nTime = CurrentTime ) StormFox2.Sun.GetSunRise() StormFox2.Sun.GetSunSet() StormFox2.Sun.GetSunAtHigest() StormFox2.Moon.IsUp()

Wind
Returns the wind in m/s
StormFox2.Wind.GetForce()

Returns the wind yaw-direction
StormFox2.Wind.GetYaw()

Returns the wind-norm
StormFox2.Wind.GetNorm()

Thunder
Creates a thunderstrike near location
StormFox2.Thunder.CreateAt( pos = random )

Creates a thunderstrike that strikes the given position / entity
StormFox2.Thunder.Strike( zPosOrEnt, bRangeDamage )

Returns true if it is thundering
StormFox2.Thunder.IsThundering()
Last edited by Nak; 5 Aug, 2021 @ 7:35am
< >
Showing 1-1 of 1 comments
Originally posted by Nak:
Only post here if you got questions for adding SF2 support to your mod.
SF2 is just out of the oven and doesn't have a lot of documentation.

You can reach me on Discord if you have questions: https://discord.gg/mefXXt4u9E

Alternative, here is is some of the common functions:

Check version
The easy way to check what version is installed, is to check for "StormFox" and "StormFox2"
if StormFox and StormFox.Version < 2 then -- StormFox 1 elseif StormFox2 then -- StormFox 2 end

Time
Returns the current time as a number between 0 and 1440.
StormFox2.Time.Get( bNearestSecond = false )

Returns the current time in a string format. "13:00" or "1:00 PM" depending on clients settings.
StormFox2.Time.GetDisplay(nTime = CurrentTime)

Converts a string to a time-number ( 0-1439 )
StormFox2.Time.StringToTime( sTime )

Converts a time-number to a string.
StormFox2.Time.TimeToString( nTime, bUse12Hour )

Simple functions
StormFox2.Time.IsDay() StormFox2.Time.IsNight()

Temperature
Returns the current temperature
StormFox2.Temperature.Get(sType = "celsius")

Returns the current temperature, depending on the clients settings.
StormFox2.Temperature.GetDisplay( nCelcius = CurrentTemperature )

Returns the symbol for the current client-setting.
StormFox2.Temperature.GetDisplaySymbol()

Returns the temperature unit the client uses:
StormFox2.Temperature.GetDisplayType()

Converts temperature from one unit, to another:
StormFox2.Temperature.Convert(sTypeFrom = "celsius", sTypeTo = "celsius", nNumber)

Weather
Returns the current weather-icon
StormFox2.Weather.GetIcon()

Returns the description of the current weather
StormFox2.Weather.GetDescription()

Returns the weather-object
StormFox2.Weather.GetCurrent()

Returns true if it is raining. ( Or snowing )
StormFox2.Weather.IsRaining()

Returns the amount it is raining ( 0 - 1 )
StormFox2.Weather.GetRainAmount()

Sun/Moon
Returns the sun-angle
StormFox2.Sun.GetAngle( nTime = CurrentTime )

Returns the moon-angle
StormFox2.Moon.GetAngle( nTime = CurrentTime )

Simple functions
StormFox2.Sun.IsUp( nTime = CurrentTime ) StormFox2.Sun.GetSunRise() StormFox2.Sun.GetSunSet() StormFox2.Sun.GetSunAtHigest() StormFox2.Moon.IsUp()

Wind
Returns the wind in m/s
StormFox2.Wind.GetForce()

Returns the wind yaw-direction
StormFox2.Wind.GetYaw()

Returns the wind-norm
StormFox2.Wind.GetNorm()

Thunder
Creates a thunderstrike near location
StormFox2.Thunder.CreateAt( pos = random )

Creates a thunderstrike that strikes the given position / entity
StormFox2.Thunder.Strike( zPosOrEnt, bRangeDamage )

Returns true if it is thundering
StormFox2.Thunder.IsThundering()
question is, does this have EVERYTHING from the first one but better?
man wish other mods like gbombs or gdisasters supported the new one, idk what one to get 1 or 2
< >
Showing 1-1 of 1 comments
Per page: 1530 50