Tips & Tricks from the East Scarp Community

From Stardew Modding Wiki
Jump to navigation Jump to search

This is a list of tips and tricks for custom NPC creators collated from the East Scarp server. Feel free to add your own!


Setting Flags in Dialogue

You can use $1 to set flags - I use it to allow introduction dialogue for new characters when loaded into existing saves outside the intro active convo period. You can also use $1 to set mailflags in the quest response!

`ItemDelivery/Give Kat an egg/some dialogue here/more dialogue here/KatarynaLK 305 1/-1/130/-1/true/$1 GaveKatEgg#Thanks!`


NPC Map Locations Tips by Lemurkat

NPCs can't be changed from unhidden in NPC Map Locations without the player editing their list, but any map with WarpRoom in the name will automatically be hidden from NPC Map Locations.


Symbols in Dialogue

You can't use symbols in dialogue as they get turned into little icons.

  • @ becomes the player's name
  • $ becomes a coin
  • # is a page break
  • < is a heart
  • + is Sam's little skateboard dude symbol


Child NPC Gift Tastes Tip by Kami

One thing to note about child NPCs - they will always refer to their relative by NAME, not title. It's why you'll occasionally see Trinnie call her dad "Bert" when revealing gift taste. It's because of this bit (using the loved gift reveal as an example): ```if (this.Age == 2)

                               {
                                   message = Game1.content.LoadString("Strings\\StringsFromCSFiles:NPC.cs.4086", relativeDisplayName, itemName) + (relativeIsMale ? Game1.LoadStringByGender(this.gender, "Strings\\StringsFromCSFiles:NPC.cs.4088") : Game1.LoadStringByGender(this.gender, "Strings\\StringsFromCSFiles:NPC.cs.4089"));
                               }

```

It sends relativeDisplayName back to the {0} string instead of nameAndTitle, which would be the relative's title (i.e., "my mom" or "my dad" :SOBS:). You never see Vincent calling his mother or father Jodi or Kent due to this oversight, though, because Vincent and Jas only have each other listed as relationships in their dispositions! `"Vincent": "child/neutral/outgoing/positive/male/not-datable/Jas/Town/spring 10/Jas /SamHouse 10 23/Vincent",`


Useful SMAPI Commands by Lemurkat

`debug ebi <event id>`: Plays your event regardless of preconditions. Note that you should enter this command on a map that is NOT the map your event is set on. If it is the same map, it won't work. Also, it will place you at the top left hand corner of the map after the event. So having CJB cheats or NoClip is advised as you may be stuck in a Building Tile. `patch summary full`: Displays a list of all the Content Patcher applied patches, thus allowing you to see if things are loading correctly or if they are being overlooked. IF they are not loading, check for typos first. `patch reload <Mod Unique ID>`: This reloads the content patcher mod specified, thus allowing you to test the event again after you've tweaked the files without restarting. Saving 4-10 minutes of time! It's AMAZING. `patch export <Target path>`: Will export a copy of the specified file as it is currently recognised by the game, showing all the additions made. Useful for checking schedules and dialogue changes, especially when other mods may also be applying them to the same target. YOu can also export png files of tilesheets, but NOT maps, sadly.


TMX Format Tip by Lemurkat

For the sake of Mac users, all TMX Tiled files should have format changed to CSV.


Coding Festival Positions by Lemurkat

When programming in festival positions, the secondary position is MainEvent in most maps, but Main-Event for Winter8 (Ice Festival).

       {
           "Action": "EditData",
           "Target": "Data/Festivals/spring24",
           "TextOperations": [
               {
                   "Operation": "Append",
                   "Target": [
                       "Entries",
                       "Set-Up_additionalCharacters"
                   ],
                   "Value": "Jasper 4 29 down",
                   "Delimiter": "/"
               },
               {
                   "Operation": "Append",
                   "Target": [
                       "Entries",
                       "MainEvent_additionalCharacters"
                   ],
                   "Value": "Jasper 4 29 down",
                   "Delimiter": "/"
               }
           ]
       },


Map Co-ordinate Clash Checks by itsbenter

In windows you can use `findstr` in cmd to check whether a certain map coordinate has been used or not. To do this you'll need a folder with unzipped downloaded custom NPCs and unpacked schedule from the game content folder. Then you can open cmd (Windows button + R) then type `cmd`.

Then type `findstr /S /I /c:"<area and coordinate to check>" <path to folder with schedule>\*.json`

If there's any NPC that stand there in anytime it will show up.

Example : `findstr /S /I /c:"Saloon 16 20" C:\Users\ben\OneDrive\Desktop\Mods_with_custom_NPC\*.json` I checked for the text "Saloon 16 20" in every json file in that path where I keep them.


Festival Testing by Arknir & Lemurkat

If you have debug mode on, you can actually activate a festival and sleep the next day to test things in the corresponding season. I like to do this to test things in winter. Here is a list of commands I copy and paste into my SMAPI console for testing: `debug festival <S:festivalID>` Starts the specified festival ID.

The season, day, and time will be set to match the starting time, and you will be warped to the correct location. Valid IDs are listed below.

  • debug festival spring13 - Egg Festival
  • debug festival fall16 - Stardew Valley Fair
  • debug festival spring24 - Flower Dance
  • debug festival fall27 - Spirit's Eve
  • debug festival summer11 - Luau
  • debug festival winter8 - Festival of Ice
  • debug festival summer28 - Moonlight Jellies
  • debug festival winter25 - Winter Star

You can also just go to the day before the festival and sleep.


Event Triggering Tip by Lemurkat

If you are wanting a player to trigger an event with a vague sense of urgency but it's inside a building, start it outdoors. Players do not always enter interior maps regularly .


Event Viewpoint Tip by Lemurkat

For anyone writing an event that is set on the edges of a map and unsure of where to set the viewport to not have a huge black strip of void down one side, use `/viewport x y clamp true/` and it will make sure that it fits the borders of the monitor.


Complex Questions Template by Axell

I made a template for complex questions so it's easier for me to understand/fill them out! I hope it can help someone else understand them too because they sure confused me.

"Dialoguekey": "INTRODUCTION #$q ID1/ID2 question_followup#HEADER#$r ID1 FRIENDSHIPCHANGE answer_one#RESPONSE#$r ID2 FRIENDSHIPCHANGE answer_two#RESPONSE",


               "answer_one": "",
               "answer_two": "",
               "question_followup": "$p ID RESPONSE1 | RESPONSE2",```
  • $q - start question command
  • $r - response command
  • $p - prerequisite ID for a previously asked question
  • INTRODUCTION - What the NPC will say at the start of the dialogue
  • HEADER - the text above the question answers
  • RESPONSE - Player's response to the NPC's question
  • RESPONSE1 - NPC Response given in follow up based on given ID
  • RESPONSE2 - The default response in follow up
  • FRIENDSHIPCHANGE - amount of points given or lost [ex: 10, 0, -10]
  • ID1 - numeric ID for first response [ex:1077111]
  • ID2 - numeric ID for second response [ex: 1077112]
  • Response ID# syntax - [ManifestID][Question Number][Response Number] (ty kami)
  • dialoguekey - When the dialogue will be said[ex. spring_Mon]
  • question_followup - What the NPC will say if this dialogue is called again
  • answer_number - The NPC's response to the player's answer.


  • Be sure to change the name of your custom dialogue keys! [ex. "answer_one" -> "SenAdventure_one"]
  • You can add more player answers to questions (but you can only have 2 IDs)
  • DO NOT use break line in the follow-up response, it will break.


Quick Dialogue Testing by Kami

For easy testing of your dialogue without having to reload your save file over and over, this command in SMAPI is REALLY handy!

debug loaddialogue NPCINTERNAL Characters\Dialogue\NPCINTERNAL:DIALOGUEKEY

NPCINTERNAL is the internal name of your character, rather than the display name! DIALOGUEKEY is the full key of your dialogue without the double quotes (i.e. spring_Mon4)

The thing that tripped me up is this command uses BACK slashes instead of forward slashes to specify the file path!

With this, I was able to test around a hundred lines of dialogue in about 10-15 minutes.


Friendly Divorce Dialogue Tips by Lemurkat

When you divorce someone with friendly divorces/Free Love and no friendship decay, they may stay on high hearts with you. I've been thinking about how to change dialogue to reflect that you are now their ex and they still know you well (since low heart dialogue tends to be more getting to know each other). And my solution will be to set two conditions:

`"Relationship:[CharacterName] |contains= Married": false,` 

and

`HasSeenEvent |contains= [14-heart-event ID]": true` 

for their 14 heart event.


Daily Dialogue Tips by Yri

I make sections like:

  • Family
  • Friends
  • Work
  • Environment
  • Worldbuilding
  • Gossip/Tips
  • Weather
  • Smalltalk
  • Hobbys
  • Fun facts about SDV

I write one line for each topic and when I'm done, I start from the beginning again.

So basically:

  • Mon - Family
  • Tue - Friends
  • Wed - Work
  • Thu - Environment
  • Fri - Worldbuilding
  • Sat - Gossip/Tips
  • Sun - Weather
  • Mon - Smalltalk
  • Tue - Hobbys
  • Wed - Funfacts about SDV
  • Thu - Family
  • Fri - Friends
  • Sat - Work
  • Sun - Environment

And so on and so forth.

With seasons I did the same thing, just season themed. For example:

Winter:

Mon - Family = "Did I ever tell you that my mother loves snow? The island where I'm from is in a constant state of summer so we never get snow, it's exotic to her."

Tue - Friends "I really want to visit Robin and build a snowman, do you think we're to old for that?"

Wed - Work "I'm glad I can work from home so I don't have to go out in the cold."

Thu - Environment "Hey @, If the lake freezes maybe we can go skating together?"

Fri - Worldbuilding "I wish we had a movie theater here. I want to go watch a movie, it distracts me from this cold winter weather."

Sat - Gossip/Tips "Did you know that you can find Crystal Fruits now, maybe i should go search for one, Robin likes them."

Sun - Weather "Even if it's sunny it doesn't feel warm, how can you not be freezing?"

One-Off FTM Spawns by Lemur

Set that spawn area to LimitedNumberOfSpawns: 1 and DaysUntilSpawnsExpire: 0, which means the area will only spawn anything once, but monsters will reappear overnight until they're defeated. Note that deleting your pack or its data folder will reset that spawn data, since it saves there.


Easier i18n Dialogue Conversions by Airyn

For anyone struggling with i18n, I found that an easy way for me to do it is:

  1. Make a copy of the dialogue file, or copy-paste all your dialogue code blocks into a new json if you've got them in the main content.json
  2. Strip out all the coding so it's just the dialogue lines like "spring_Wed8": "blah blah dialogue"
  3. Find/replace all the spring_ etc with mymodname.dailydialogue.spring_ or whatever you want the i18n key to be
  4. Add the i18n brackets to the top & bottom and name the file default.json because you should now basically have an i18n file
  5. Go back to the original dialogue file and just copy-paste the dialogue code key (the spring_Wed8 bit) over the actual dialogue
  6. Then you can do a quick copy-paste of the i18n key (the mymodname.dailydialogue. bit) in front of the dialogue code key and add brackets


Unlockable Romance Routes by Kami

For those interested in having the player unlock a romantic route for your NPC, follow these steps!

First, ensure that your NPC's default disposition is not-datable. Note: If you want them to dance at the Flower Dance despite this, you can do something like this:

       {
           "LogName": "NPCDispositions",
           "Action": "EditData",
           "Target": "Data/NPCDispositions",
           "Fields": {
               "NPCInternalName": {
                   "5": "datable"
               }
           },
           "When": {
               "DayEvent": "flower dance"
           }
       }

Next, have an event at the end of their platonic arc (usually 8-hearts or 10-hearts, depending on your story progression) that allows the player to respond to a question fork. If you aren't familiar with forks, Arknir has an excellent, interactive guide posted in a thread here: https://discord.com/channels/702333912722178059/953450773541441547/953465726096769084

The default route of the fork should not give the mail flag, and instead allow the player to continue on the platonic route instead of unlocking them as a marriage candidate/romanceable.

The branched route should be the romance route, and you can set a mail flag at the beginning of the fork like /mail YourModName_isDatable/ or something recognizable.

From there, you can use this flag to change your NPC disposition (see above, but replace "DayEvent: "flower dance" with the condition below) and/or edit dialogue by adding a When condition "HasFlag": "YourModName_isDatable". Flags are really powerful booleans that can be used to influence the way your mod works! Definitely try them out!