Repository navigation
Modder reference
emuengine edited this page Aug 18, 2026
·
6 revisions
| Component | Unique ID |
|---|---|
| SMAPI mod | EmuEngine.MayorMod |
| Content Patcher pack | EmuEngine.MayorModCP |
| Flag | Description |
|---|---|
| EmuEngine.MayorModCP_RunningForMayor | The player has registered. |
| EmuEngine.MayorModCP_VotingDay | The election day is today. |
| EmuEngine.MayorModCP_HasVoted | This farmer has cast their vote. |
| EmuEngine.MayorModCP_WonMayorElection | Player has won the election but not mayor yet. |
| EmuEngine.MayorModCP_LostMayorElection | Player has lost the election |
| EmuEngine.MayorModCP_ElectedAsMayor | The player is the mayor |
| EmuEngine.MayorModCP_IsCouncilDay | Today is a council meeting day |
| EmuEngine.MayorModCP_TownCleanup | Tidy town initiative passed |
| EmuEngine.MayorModCP_RiverCleanup | Clean river initiative passed |
| EmuEngine.MayorModCP_SecurityOnGuard | Public safety meeting passed |
| EmuEngine.MayorModCP_StrategicReserve | Strategic supply reserve meeting passed |
| EmuEngine.MayorModCP_ModNeedsReset | A total mod reset is pending for the next day |
| EmuEngine.MayorModCP_CouncilMeetingPlanned<ID> | A council meeting with the agenda is scheduled |
These Ids are prefixed with "EmuEngine.MayorModCP_CouncilMeetingPlanned" to get the full flag. They are used for the council event trigger.
| ID | Description |
|---|---|
| Intro | Intro meeting for council members. |
| TownCleanup | Meeting about town cleanup. |
| RiverCleanup | Meeting about river cleanup. |
| SaloonHours | Meeting about increasing Saloon hours. |
| StrategicReserve | Meeting about creating a strategic reserve in case of disaster. |
| TownRoads | Meeting about adding more roads. |
| TownSecurity | Meeting about town security and adding Officer Mike as a guard on the mines. |
So I have a Harmony Handler for patching various methods in SDV. It's probably useful to know the random behaviors I'm changing. They are all prefix patches.
| Patch | Description |
|---|---|
| DecoratableLocation.IsFloorableOrWallpaperableTile | I made life difficult for myself and I wanted to be able to use the flooring/wallpaper I already had in the Town Hall. This basically checks for that tileset so we can make the Town Hall decoratable and I get to have and eat my cake. |
| DecoratableLocation_ReadWallpaperAndFloorTileData | Add missing wallpaper vectors for mayormod tileset. Also part of the above. |
| NPC.TryLoadSchedule | Allows me to load a custom schedule key for voting day. The key is "VotingDay". |
| ParsedItemData.GetTexture | Intercepts texture retrieval process and provides a custom texture. Basically used to get the gold statues to look like your farmer. |
| Furniture.checkForAction | Makes the gold statue interactable so you can set the texture. |
| StardewValley.Object.placementAction | Specific check for EmuEngine.MayorModCP_ManorHouseBasement location so the staircase warps you to the vanilla basement. Compatibility with Nullnnow.MS-Offerings. |
| SpecialOrder.GetDaysLeft | Sets it so Strategic Reserve special order never runs out of days and always set to 100. |
So I spent quite a long time on that first event getting Gil to walk. These are the custom event commands that I had to make to do that. This is mostly because removing tiles in an event doesn't put them back after. It also has issues with animated tiles. I dunno they may be handy in other event scripts.
| Command | Parameters | Description |
|---|---|---|
| emuEngineMayorMod_storeMapTile | layer x y storageKey | Stores the tile object from a position. This works for animated tiles. |
| emuEngineMayorMod_retrieveMapTile | layer x y storageKey deleteOnRetrieve | Restores a previously stored tile to a position. deleteOnRetrieve is optional |
| emuEngineMayorMod_clearDialogueEvent | topicId | Removes a conversation topic from activeDialogueEvents & previousActiveDialogueEvents. |
| emuEngineMayorMod_clearSeenEvent | eventId | Removes an event Id from the farmers eventsSeen list so it can replay. |
Come ask questions, chat, and get early looks at future updates on the Mayor Mod Discord