-
Notifications
You must be signed in to change notification settings - Fork 0
For Developrs
Akross edited this page May 19, 2026
·
2 revisions
This page shows how to add new commands, edit existing commands, and extend command functionality.
- The easiest way to do so is by first, creating a context variable in
VintageStoryPresence.Common.Presence.PresenceContext
public class PresenceContext
{
public string MyNewCommand { get; set; }
}- Adding the command to the registrar
VintageStoryPresence.Common.Presence.PresenceCommands
public static class PresenceCommands
{
public static void RegisterDefaults()
{
PresenceFunctionRegistry.Register("MyNewCommand",
context => context.MyNewCommand);
}
}- Lastly, add the functionality within
VintageStoryPresence.Common.Presence.Context.PresenceContextBuilder
public static class PresenceContextBuilder
{
public static PresenceContext BuildContext(float delta)
{
// These should cover the api's that you need for accessing any game or player data
ICoreAPI? api = PresenceCore.Api;
ICoreClientAPI? capi = PresenceCore.Capi;
IWorldAccessor? world = api?.World;
return new PresenceContext
{
/* ... */
// Remember to add a comma before the last command or after yours
MyNewCommand = "My new function here!",
}
}
}