Skip to content

Modding Wrapers

flaffy edited this page Aug 8, 2026 · 2 revisions

In this page you will learn how SymphonyRecomp exposes wrappers to the mods, to learn more about how to make a mod please read this wiki page

Using them

Everything lives in the Sotn namespace so you have to import it:

using Sotn;

Player.Hp = Player.HpMax;

Player

stats, position and state of the player character

Player.Hp;        Player.HpMax;
Player.Mp;        Player.MpMax;
Player.Hearts;    Player.HeartsMax;
Player.Gold;      Player.Level;
Player.Entity;    // the player as an Entity, see bellow

Entity and Entities

Entity wraps one entry of the entity table. you build it from an address and read the fields as properties:

var e = Entities.At(12);

e.PosX; e.PosY;
e.Flags; e.FlagBits;
e.Palette; e.ClutId;
e.Step; e.StepSub;
e.HitPoints; e.Attack;
e.Update; // the update function address, use it to tell entities apart
e.IsAlive; e.IsEnemy; e.IsDead;

e.SetFlag(EntityFlags.KeepAliveOffCamera, true);
e.TintPalette(1f, 0.5f, 0.5f);
e.Destroy();
Entities.At(i);
Entities.Player;
Entities.All(); // every live entity, returns enumerator to be walked over
Entities.Enemies();
Entities.GetFreeStage(); // a free slot in the stage range
Entities.SlotOf(e);

slots 0 to 63 belong to the player and its effects, 64 and up are stage entities

Game and Progress

Game is the current state of the run:

Game.InGame; Game.IsLoading;
Game.StageId; // a Stage enum value
Game.Character; //Your PlayableCharacter
Game.CurrentEntity;
Game.InAlucardMode();
Game.InPrologue();

Inventory and items

Inventory.GiveRelic(Relic.SoulOfBat, true);
Inventory.HasRelic(Relic.EchoOfBat);

some enums that wrap over game ids

  • Relic every relic
  • Spell every spell
  • Subweapon every subweapon
  • HandItem and BodyItem for equipment, ItemSlot for where it goes
  • Potion every potion type
  • EquipKind for the equipment category

Stages

stage wide palette effects, this is what the blackout mod uses for example:

Stages.Shade(r, g, b); //applies an color shift on top of the existing colors
Stages.ShadeEntities(r, g, b);
Stages.Tint(r, g, b); // cumulative, unlike Shade
Stages.Restore(); //restore pallete (naming subject to change in the future)
Stages.RestoreEntities(); //restore entities pallete (naming subject to change in the future)
Stages.HideEntities();
Stages.WriteAllPalettes();

Stage is an enum of every stage in the game, including the inverted castle

GameApi

calls into the games functions. this is how you make the game do something instead of just reading its memory, the call wrapers handles the cpu context restoration so you don't have to worry with it.

GameApi.PlaySfx(id);
GameApi.PlaySfxVolPan(id, volume, pan);
GameApi.AddHearts(10);
GameApi.LearnSpell(Spell.SoulSteal);
GameApi.AddToInventory(HandItem.Shortsword);
GameApi.SetFadeMode(FadeMode.ToBlack);
GameApi.DealDamage(enemy, attacker);
GameApi.GetFreeEntity(start, end);
GameApi.CreateEntFactory(...);

there is also a generic call site when something is not wrapped yet:

uint result = GameApi.Call(address, a0, a1, a2, a3);

A real mod

The Blackout mod that ships with SymphonyRecomp is the best reference, it is plain source under mods/blackout/. it combines most of the above:

Read it before writing your own, it is not a long mod you can read it pretty quickly, its also worthy to take a look at the wraper code to better understand what they do

Clone this wiki locally