Skip to content

atl/sm/event

import "atl/sm/event"

Calls method callback(args) on another object's script (sm.event). Network rules apply: a server call reaches the server side, a client call the client side. For a Go script, callback is a name registered with Method. Each function returns true if the event was sent.

func ToGame(callback string, args any, o Options) bool

Sends to the game script.

func ToWorld(w sm.World, callback string, args any, o Options) bool

Sends to a world's script.

func ToPlayer(p sm.Player, callback string, args any, o Options) bool

Sends to a player's script.

func ToCharacter(c sm.Character, callback string, args any, o Options) bool

Sends to a character's script.

func ToInteractable(i sm.Interactable, callback string, args any, o Options) bool

Sends to an interactable's script.

func ToHarvestable(h sm.Harvestable, callback string, args any, o Options) bool

Sends to a harvestable's script.

func ToUnit(u sm.Unit, callback string, args any, o Options) bool

Sends to a unit's script.

func ToTool(t sm.Tool, callback string, args any, o Options) bool

Sends to a tool's script.

func ToScriptableObject(so sm.ScriptableObject, callback string, args any, o Options) bool

Sends to a scriptable object's script.

type Options struct {
EventType *int
PauseSave *bool
}

Optional event settings.