Jump to content

Photo

Modding : Json & Global Variables


4 replies to this topic

#1
UnmotivatedCheddar

UnmotivatedCheddar

    Stranger

  • Members
  • Pip
  • 4 posts

Hi,

 

Let me just preamble this by saying I'm not even sure I'm using the correct terminology here, seemingly a variable can still be called a global variable even if it's localized to a single file, that's not really what I'm talking about here, rather a central location to store variables from where other files can also draw from.

 

I've been looking at files, wanting to get into modding and thought I'd modify an already existing character, changing the name among other things. What I found was that the dialogue mentioning the names is just written as is, there's no calls being made to a central variable string containing the name, meaning that instead of editing the name in a single place, you'd have to go through an unknown number of files just to change the name of one character! And I still haven't found the one correlating to the actual Name box being displayed. Now I've heard rumoured that SDV wasn't all that modder friendly, but c'mon!

 

 

What I'm wondering is; does such a thing not exist in Json (global variables stored in a central location able to be accessed from outside), or is ConcernedApe just that bad at programming?

I'm pretty much an amateur myself, I only learned the basics of Python and C# way back when, but even I know that that's like the very very basics right there.

 

Has noone told him about this? Is he going to fix this? It would be like a world of difference, I mean the dialogue isn't even all kept in one place, you've got a separate dialogue file for rainy weather even, all of which I have to go through and unpack each xnb file just to get to the json file. You have a file named NpcNames in the string folder, but it only contains SOME Npcs. There's no order to anything it seems. Like how am I supposed to know how many of these random files contains a reference, in plain text no less, to the character which I'm trying to rename. I have to edit every single family member's dialogue files for starters, the rainy dialogues, the related events, and who knows what else.

 

Or is there a better way of doing this?

 

-

 

Edit: I just realised I know the answer to parts of this question, because the farmer's name is one such global variable that I've been talking about (or at least a call to a function fetching the variable), referenced throughout as @. Meaning that they do exist in json, they're just heavily underutilized by ConcernedApe it seems.


Edited by UnmotivatedCheddar, 26 April 2020 - 12:51 PM.


#2
MissCoriel

MissCoriel

    Momma

  • Staff
  • PipPipPip
  • 622 posts

There are a lot of things you can call. @ is farmer, %spouse gets your spouse's name, %farm shows the name of your farm.  %time will get the current game time.  There are things that can be called.  

I recommend you refer to the Dialogue Modding portion of the wiki to see what there is. 

If I am reading this correctly, you wanted to rename an NPC that exists.  This is easily done by editing the NPCDispositions.xnb

"Abigail": "teen/rude/outgoing/neutral/female/datable/Sebastian/Town/fall 13/Caroline 'mom' Pierre 'dad'/SeedShop 1 9/Abigail",

As you see there is Abigail in the key.  I like to call it the system name.  You cannot and should not change that.  However at the end of the Disposition you can see her name again.  If you change that, you can change the name of the NPC in the game.  

"Abigail": "teen/rude/outgoing/neutral/female/datable/Sebastian/Town/fall 13/Caroline 'mom' Pierre 'dad'/SeedShop 1 9/Abbs",

What I showed you will make it where everything Involved with Abigail will instead refer to her as Abbs.  Though when writing events and stuff you still need to use the system name Abigail, so don't get them crossed.

For a more practical Example my Wizard Replacement Mod Razolyn uses Wizard for speech and the like but it always shows Razolyn for it.  If there is any more you wish to know go ahead and drop a question.



#3
UnmotivatedCheddar

UnmotivatedCheddar

    Stranger

  • Members
  • Pip
  • 4 posts

Hey thanks for replying!

 

So that will take every instance of the character name mentioned anywhere, not just the name plate, and change it, despite it not being a string variable in the text?

 

So it's done per some kind of live script then, well that makes things a bit less daunting at least.

 

Thank you, I had just about given up there.



#4
MissCoriel

MissCoriel

    Momma

  • Staff
  • PipPipPip
  • 622 posts

As far as I know, yes.. the only time you need to use the NPCs "Actual" name is Events and stuff but won't be visible to people.

For instance, when Razolyn speaks I have to do this:

speak Wizard \"I am Razolyn the Magnificent!\"/

But to people playing the game it will say,

Razolyn: "I am Razolyn the Magnificent!"

So just keep in mind you need to keep using the system name when adjusting things.



#5
UnmotivatedCheddar

UnmotivatedCheddar

    Stranger

  • Members
  • Pip
  • 4 posts

Ok, many thanks.





Reply to this topic



  


Page loaded in: 1.006 seconds