Issue My Custom Mod Won't Leave Spawn Location

CellaScarpi

Cowpoke
Platform Windows
Game version 1.6.15

I am trying to create my own NPC and after lots of trial and error I've got my mod loading, with dialogue but he will not leave the spawn location.
I have been reading, testing, and redoing this mod over and over again for the last month. I've removed ALL mods and reinstalled Smapi and Content Patcher to make sure everything is up to do.

Here is my schedule.json

{"Changes": [
{"Action":"EditData",
"Target":"assets/schedules/schedule",
"Entries":
{
"spring": "630 Busstop 27 22 0/700 Town 78 95 3/730 Town 22 26 1/900 ArchaeologyHouse 19 5 0/2000 Town 22 26 1",
"summer": "630 Town 33 95 0/700 Town 78 95 3/730 Town 22 26 1/900 ArchaeologyHouse 19 5 0/2000 Town 22 26 1",
"fall": "630 Town 33 95 0/700 Town 78 95 3/730 Town 22 26 1/900 ArchaeologyHouse 19 5 0/2000 Town 22 26 1",
"winter": "630 Town 33 95 0/700 Town 78 95 3/730 Town 22 26 1/900 ArchaeologyHouse 19 5 0/2000 Town 22 26 1",
"rain": "630 Town 33 95 0/700 Town 78 95 3/730 Town 22 26 1/900 ArchaeologyHouse 19 5 0/2000 Town 22 26 1",
"GreenRain": "630 Town 33 95 0/700 Town 78 95 3/730 Town 22 26 1/900 ArchaeologyHouse 19 5 0/2000 Town 22 26 1"
}
}]
}


Here is the Load schedule command in the content.json

{
"Action": "Load",
"Target": "Data/Schedule",
"FromFile": "assets/schedules/schedule.json",
"Type": "json"
},

I am just feeling so lost and hopeless this started out as a fun project for myself I wanted to slowly make it more and more complicated, but at this point I can't feel like i can even try to work towards making heart events or making my dialogue fun and complex when my character just stands at the busstop and never moves .Any help is appreciated. Thank you
 

Azurysu

Cowpoke
Hey! Sorry to hear you've been having issues with your mod. I completely understand- it's really damn frustrating, I feel u :') I've been trying to make a Harvey content mod but sometimes errors get in the way (and most of them are the dumbest thing you could ever imagine like an extra comma or an extra letter). I'm still learning how to program custom NPCs, so I can't help you exactly pinpoint the problem you may be having, wish I knew more about modding :( But I think I might know where the issue might be!

Normally an NPC has a "Schedule" folder with its name. Inside there should be two files: "Namescheduledialogue.json" and "Nameschedule.json". All vanilla NPCs when unpacking the game are stored in the Character folder, so your custom NPC should follow the same guidelines (For example, Abigail's schedule is stored in Character/schedules/Abigail.json, and her schedule dialogue is stored in Strings/Schedules/Abigail.json).

Assuming you already have succesfully spawned the NPC in the map as well as you have schedule dialogue correctly set up in your mod, loading your NPC's schedule in your content.json should be easy.

For the first schedule.json part, you don't need to use EditData nor introduce any kind of change, since you are defining the NPC's schedule. You are making the file edit itself! You should be fine with only the schedule data. EditData should be used when you want to introduce a change inside an NPC's already existing schedule.json
(for example, if you want your NPC to change some schedule behaviors after seeing a certain heart event, you can create an extra schedule.json that modifies that if you'd like).


About the load command part- when you load the schedule you seem to be targeting "Data/Schedule". You should target the NPC from the "Character" folder, not "Data"- as the NPC schedule information is NOT stored in there.

Say for example, your NPC is called Maria; in that case, it should be targetting "Characters/Schedules/Maria". Not the Data folder, as she's not in there! This is how the schedule works for all vanilla NPCs in the game.

Code:
{
      "LogName": "Schedule",
      "Action": "Load",
      "Target": "Characters/schedules/Maria",
      "FromFile": "assets/mariaSchedule/Schedule.json"
    },
This is what it should like. I'm not too sure if this is the correct answer, but it's still worth a try.

What I'm doing here is targeting Maria's character schedule, and loading the respective .json from the "mariaSchedule" folder inside my mod (or however you may have called it).

What I highly recommend and I usually do when I'm stuck and I don't know how to program something/I'm having issues with my current work is look at other people's work and kind of reverse-engineer it! In this case, maybe searching for a mod like SVE or any other that adds a custom NPC will help you understand things a lot.

Another thing that maybe will help is looking at the full documentation over on Github, and check the SV modding wiki too.

Hope this helped at least a bit! Have a good day >:)
 

CellaScarpi

Cowpoke
Hey! Sorry to hear you've been having issues with your mod. I completely understand- it's really damn frustrating, I feel u :') I've been trying to make a Harvey content mod but sometimes errors get in the way (and most of them are the dumbest thing you could ever imagine like an extra comma or an extra letter). I'm still learning how to program custom NPCs, so I can't help you exactly pinpoint the problem you may be having, wish I knew more about modding :( But I think I might know where the issue might be!

Normally an NPC has a "Schedule" folder with its name. Inside there should be two files: "Namescheduledialogue.json" and "Nameschedule.json". All vanilla NPCs when unpacking the game are stored in the Character folder, so your custom NPC should follow the same guidelines (For example, Abigail's schedule is stored in Character/schedules/Abigail.json, and her schedule dialogue is stored in Strings/Schedules/Abigail.json).

Assuming you already have succesfully spawned the NPC in the map as well as you have schedule dialogue correctly set up in your mod, loading your NPC's schedule in your content.json should be easy.

For the first schedule.json part, you don't need to use EditData nor introduce any kind of change, since you are defining the NPC's schedule. You are making the file edit itself! You should be fine with only the schedule data. EditData should be used when you want to introduce a change inside an NPC's already existing schedule.json
(for example, if you want your NPC to change some schedule behaviors after seeing a certain heart event, you can create an extra schedule.json that modifies that if you'd like).


About the load command part- when you load the schedule you seem to be targeting "Data/Schedule". You should target the NPC from the "Character" folder, not "Data"- as the NPC schedule information is NOT stored in there.

Say for example, your NPC is called Maria; in that case, it should be targetting "Characters/Schedules/Maria". Not the Data folder, as she's not in there! This is how the schedule works for all vanilla NPCs in the game.

Code:
{
      "LogName": "Schedule",
      "Action": "Load",
      "Target": "Characters/schedules/Maria",
      "FromFile": "assets/mariaSchedule/Schedule.json"
    },
This is what it should like. I'm not too sure if this is the correct answer, but it's still worth a try.

What I'm doing here is targeting Maria's character schedule, and loading the respective .json from the "mariaSchedule" folder inside my mod (or however you may have called it).

What I highly recommend and I usually do when I'm stuck and I don't know how to program something/I'm having issues with my current work is look at other people's work and kind of reverse-engineer it! In this case, maybe searching for a mod like SVE or any other that adds a custom NPC will help you understand things a lot.

Another thing that maybe will help is looking at the full documentation over on Github, and check the SV modding wiki too.

Hope this helped at least a bit! Have a good day >:)
Thank you so much for replying! I have given up on anyone replying, i actually fixed it a few hours ago and was so excited I have been over the moon so it was yes the content.json Iwent back to

{
"LogName": "Schedule",
"Action": "Load",
"Target": "Characters/Schedules/Edward",
"FromFile": "assets/schedules/schedule.json"
},


Which I previously had done back and forth between that and editdata command

and I needed:


{
"LogName": "Schedule Dialogue",
"Action": "Load",
"Target": "Strings/schedules/Edward",
"FromFile": "assets/schedules/scheduleDialogue.json"
},


and I needed:

{
"LogName": "Animation Descriptions",
"Action": "EditData",
"Target": "Data/animationDescriptions",
"Entries": {
"edward_stand": "0 0/0/0 0",
"edward_walk_down": "0 3/8/4 0",
"edward_walk_right": "4 7/8/4 4",
"edward_walk_left": "8 11/8/4 8",
"edward_walk_up": "12 15/8/4 12",
"edward_dance": "16 19/8/4 16",
"edward_think": "3 4/4/4 3"
}
}


and I changed my schedule to include strings:


{
"default": "700 Woods 11 18 2 edward_walk \"Strings\\schedules\\Edward:default1\"/800 Town 78 95 2 \"Strings\\schedules\\Edward:default2\"/1300 ArchaeologyHouse 19 5 2 \"Strings\\schedules\\Edward:default3\"/1500 Saloon 12 20 2 \"Strings\\schedules\\Edward:default4\"/2000 Town 22 26 1 edward_stand \"Strings\\schedules\\Edward:default5\"/2200 Woods 49 28 1 edward_stand \"Strings\\schedules\\Edward:default5\",
"spring": "GOTO default",
"summer": "GOTO default",
"fall": "GOTO default",
"winter": "GOTO default",
"rain": "GOTO default"
}


and I made sure my strings/schedule/edward.json file had the data it needed:
{
"default1": "Edward seems to be deep in thought.",
"default2": "He studies the town with curiosity.",
"default3": "Edward is examining something carefully.",
"default4": "He watches people come and go in the saloon.",
"default5": "Edward stands quietly, lost in thought."
}
This section doesn't seem to be working properly but I don't care he's walking, talking and interactable so now I'm gonna slowly but surely work on the rest including eventually a custom house/ map for him and events. :)
 

CellaScarpi

Cowpoke
Hey! Sorry to hear you've been having issues with your mod. I completely understand- it's really damn frustrating, I feel u :') I've been trying to make a Harvey content mod but sometimes errors get in the way (and most of them are the dumbest thing you could ever imagine like an extra comma or an extra letter). I'm still learning how to program custom NPCs, so I can't help you exactly pinpoint the problem you may be having, wish I knew more about modding :( But I think I might know where the issue might be!

Normally an NPC has a "Schedule" folder with its name. Inside there should be two files: "Namescheduledialogue.json" and "Nameschedule.json". All vanilla NPCs when unpacking the game are stored in the Character folder, so your custom NPC should follow the same guidelines (For example, Abigail's schedule is stored in Character/schedules/Abigail.json, and her schedule dialogue is stored in Strings/Schedules/Abigail.json).

Assuming you already have succesfully spawned the NPC in the map as well as you have schedule dialogue correctly set up in your mod, loading your NPC's schedule in your content.json should be easy.

For the first schedule.json part, you don't need to use EditData nor introduce any kind of change, since you are defining the NPC's schedule. You are making the file edit itself! You should be fine with only the schedule data. EditData should be used when you want to introduce a change inside an NPC's already existing schedule.json
(for example, if you want your NPC to change some schedule behaviors after seeing a certain heart event, you can create an extra schedule.json that modifies that if you'd like).


About the load command part- when you load the schedule you seem to be targeting "Data/Schedule". You should target the NPC from the "Character" folder, not "Data"- as the NPC schedule information is NOT stored in there.

Say for example, your NPC is called Maria; in that case, it should be targetting "Characters/Schedules/Maria". Not the Data folder, as she's not in there! This is how the schedule works for all vanilla NPCs in the game.

Code:
{
      "LogName": "Schedule",
      "Action": "Load",
      "Target": "Characters/schedules/Maria",
      "FromFile": "assets/mariaSchedule/Schedule.json"
    },
This is what it should like. I'm not too sure if this is the correct answer, but it's still worth a try.

What I'm doing here is targeting Maria's character schedule, and loading the respective .json from the "mariaSchedule" folder inside my mod (or however you may have called it).

What I highly recommend and I usually do when I'm stuck and I don't know how to program something/I'm having issues with my current work is look at other people's work and kind of reverse-engineer it! In this case, maybe searching for a mod like SVE or any other that adds a custom NPC will help you understand things a lot.

Another thing that maybe will help is looking at the full documentation over on Github, and check the SV modding wiki too.

Hope this helped at least a bit! Have a good day >:)
ALSO LOVE HARVEY he's my fav!
 

Azurysu

Cowpoke
Thank you so much for replying! I have given up on anyone replying, i actually fixed it a few hours ago and was so excited I have been over the moon so it was yes the content.json Iwent back to

{
"LogName": "Schedule",
"Action": "Load",
"Target": "Characters/Schedules/Edward",
"FromFile": "assets/schedules/schedule.json"
},


Which I previously had done back and forth between that and editdata command

and I needed:


{
"LogName": "Schedule Dialogue",
"Action": "Load",
"Target": "Strings/schedules/Edward",
"FromFile": "assets/schedules/scheduleDialogue.json"
},


and I needed:

{
"LogName": "Animation Descriptions",
"Action": "EditData",
"Target": "Data/animationDescriptions",
"Entries": {
"edward_stand": "0 0/0/0 0",
"edward_walk_down": "0 3/8/4 0",
"edward_walk_right": "4 7/8/4 4",
"edward_walk_left": "8 11/8/4 8",
"edward_walk_up": "12 15/8/4 12",
"edward_dance": "16 19/8/4 16",
"edward_think": "3 4/4/4 3"
}
}


and I changed my schedule to include strings:


{
"default": "700 Woods 11 18 2 edward_walk \"Strings\\schedules\\Edward:default1\"/800 Town 78 95 2 \"Strings\\schedules\\Edward:default2\"/1300 ArchaeologyHouse 19 5 2 \"Strings\\schedules\\Edward:default3\"/1500 Saloon 12 20 2 \"Strings\\schedules\\Edward:default4\"/2000 Town 22 26 1 edward_stand \"Strings\\schedules\\Edward:default5\"/2200 Woods 49 28 1 edward_stand \"Strings\\schedules\\Edward:default5\",
"spring": "GOTO default",
"summer": "GOTO default",
"fall": "GOTO default",
"winter": "GOTO default",
"rain": "GOTO default"
}


and I made sure my strings/schedule/edward.json file had the data it needed:
{
"default1": "Edward seems to be deep in thought.",
"default2": "He studies the town with curiosity.",
"default3": "Edward is examining something carefully.",
"default4": "He watches people come and go in the saloon.",
"default5": "Edward stands quietly, lost in thought."
}
This section doesn't seem to be working properly but I don't care he's walking, talking and interactable so now I'm gonna slowly but surely work on the rest including eventually a custom house/ map for him and events. :)
Oww I'm so glad it finally works! If you need help with that last part, please tell me so we can look further into it and hopefully find a solution to it.

Hope you can finally get the motivation you need to finish your mod, and wish you the best <3
 

CellaScarpi

Cowpoke
Oww I'm so glad it finally works! If you need help with that last part, please tell me so we can look further into it and hopefully find a solution to it.

Hope you can finally get the motivation you need to finish your mod, and wish you the best <3
Thank you! I got the strings for schedule dialogue working now I'm trying to get a event reacted but I keep hitting the same error... I know I'll solve it eventually but back a long time ago when I was writing fanfiction we had group chats for bouncing ideas and inspo... I wish I could find something like that for this. A lot of the information I find is sadly for older versions
 

Azurysu

Cowpoke
I've never been in one of those, I bet it was cool to share inspo for new fic ideas! And yeah, we're on the same boat here. I had some problems with an event trigger some days ago and posted it here hoping someone would answer- at least I'm glad I found the culprit... I was trying to trigger an event while manually changing the date, so it didn't update the requirement to trigger it properly unless using "patch update" on the SMAPI console XD

A lot of the info around the internet for older versions is still useful for the latest ones, but I think you'll have more luck reading the documentation for mods/dependencies or trying to reverse-engineer some of your favourite mods.
 

CellaScarpi

Cowpoke
I've never been in one of those, I bet it was cool to share inspo for new fic ideas! And yeah, we're on the same boat here. I had some problems with an event trigger some days ago and posted it here hoping someone would answer- at least I'm glad I found the culprit... I was trying to trigger an event while manually changing the date, so it didn't update the requirement to trigger it properly unless using "patch update" on the SMAPI console XD

A lot of the info around the internet for older versions is still useful for the latest ones, but I think you'll have more luck reading the documentation for mods/dependencies or trying to reverse-engineer some of your favourite mods.
Now I am very curious since that is the boat i am currently in is trying to trigger my 1 heart event.
 
Top