Skip to content

atl/sm/game

import "atl/sm/game"

Game state and settings (sm.game).

func ServerTick() int

The server's tick counter.

func CurrentTick() int

The current tick (40 per second).

func TimeOfDay() float64

The time of day, 0..1, where 0.5 is noon.

func SetTimeOfDay(t float64)

[client] Sets the time of day.

func Difficulty() int

The game difficulty.

func AggroEnabled() bool

Whether creature aggression is enabled.

func SetAggroEnabled(on bool)

[server] Enables or disables creature aggression.

func AmmoConsumptionEnabled() bool

Whether ammo consumption is enabled.

func SetAmmoConsumptionEnabled(on bool)

[server] Enables or disables ammo consumption.

func FuelConsumptionEnabled() bool

Whether fuel consumption is enabled.

func SetFuelConsumptionEnabled(on bool)

[server] Enables or disables fuel consumption.

func RestrictionsEnabled() bool

Whether build restrictions are enabled.

func SetRestrictionsEnabled(on bool)

[server] Enables or disables build restrictions.

func UpgradeEnabled() bool

Whether upgrades are enabled.

func SetUpgradeEnabled(on bool)

[server] Enables or disables upgrades.

func RecipesEnabled() bool

Whether recipes are enabled.

func SetRecipesEnabled(on bool)

[server] Enables or disables recipes.

func LimitedInventory() bool

Whether the limited inventory is enabled.

func SetLimitedInventory(on bool)

[server] Enables or disables the limited inventory.

func SettingBool(name string) bool
func SettingNumber(name string) float64
func SettingString(name string) string

A game setting by name, as a boolean / number / string.

func Kick(p sm.Player)

[server] Kicks a player.

func Ban(p sm.Player)

[server] Bans a player.

func PauseSaving(reason string, ticks int)

[server] Holds off autosaving while something (named reason) is mid-change.

func ResumeSaving(reason string)

[server] Allows autosaving again.

func ExitToMenu()

Exits to the main menu.

func ExitToMenuWithEndCredits()

Exits to the main menu and plays the end credits.

func LoadWatchedTutorials() atl.Value

[client] The tutorials the user has seen (a table you define).

func SaveWatchedTutorials(watched atl.Value)

[client] Saves the tutorials the user has seen.