So you are going to make the framework for everyone else to use as they see fit? Or-- you're going to make a Google Doc so everyone can add new questions?
Didn't think about Google Doc yet. Just thought that editing files will be much easier then rewriting parts of code. I will also be able to test how dialogues and faces look on the fly. Yeah, maybe like framework. But with monopoly on special scripts. Just like the game basically. I have no Idea how to make a framework anyway.
I mean like, "Hey guys this is the template for Baldur's Gate style dialogue, feel free to create your own dialogue", sorry if it wasn't clear enough >_<
Yeah, this. I hope anyone will be able to add folder with custom Npc's name to the mod's directory with all their dialogues and they will appear in the game for example.
Ahhh, I see that could work (and it certainly will spare you from the pain of ....creating all the contents)
Why not go for a csv style of file it's easy to parse into an array in most languages Dor the format it could be something like that: Q;id;[S/M/B];150;{modifier};text A;id;[S/M/B];100 or {modifier];[F/S];text - Q and A: are questions and answer - id: Is shared by both questions and answers it's how we tell which answer belong to which question - S/M/B: Respectively, single, married and both. (I thought about adding C for cheating when you flirt with someone who is not your wife but I'll separate it as it's a bit controversial and will let the community decide ) - The number: For the question it's the relationship you must have with the npc for your flirt to succeed (I would add a random element too when deciding if the flirt succeed or not but that's up for keyten to decide. It could also be replaced by a modifier (see the next option) for the answer it's the probability that you get this answer (throw a random number and check wich one you get) - Modifier: I left this as a free form for modders it could be a particular event (appears only on the birthday, a particular time or day (valentine day, night etc...) or even year. Or even call a particular script when it's triggered this can be one or a mix of modifier knowing that the "call event" is meant to override any answer and of course is not mandatory a call event in the answer would overide the answer the text would remain to explain for example Y,e:bday,c:event1 would mean the question would appear only on year 3 on during the "game event" birthday and call the event "event1" This can be added later when the base is working correctly so at first it would be left empty or have have very limited functionnality. - F/S (For answer only): Failure/Success. It's pretty straightforward. - Text: It's the point of the mod of course, it's text shown (or In case of a "call event" modifier a comment explaining roughly what's happening Some basic formatting could be great too. What I mean is not necessarily adding colors or italic or bold. What I'm asking would be more line breaks (I don't think we could write \n directly) and a way to divide the text on several dialog boxes to avoid filling all the screen with a long wall of text As always it's only brainstorming here, so don't feel pressured to add anything you find too difficult or that you don't want to code
Nice, always interested how devs of "dialogue" games make the dialogue files. There is actually one problem: How the game catches answer to a question. When it catches an answer It calls a subroutine that provides you with pointer to a farmer and the first word of the answer. Why the first word and not all string? Noone but dev knows. So you can't make two answers that starts with one word. At least in a normal way. Also you may use in-game dialogue formatting to make dialogues. So #e will split dialogue into two, $7 will give you seventh portrait etc. There is also #q... #r... #r construction for multiple answers. There are more than 10 special #Symbols to do different things. Also I am not sure If I will be able to catch the dialoguebox closed event so you won't be able to do some advanced stuff as event starting? I dunno, I will think about that later.
I was just thinking about this mod earlier, it looks like it's going to be so good. Were you still wanting someone to write dialogues for it? I can devote a portion of my time to writing up some good dialogue, making it character specific and all. (I hesitated to offer before because I hadn't played enough, but by Fall now I have a decent enough grasp to try.)
Of course I do! I am currently trying to finish code, make file system and I only have some dialgoues for Abigail. Anyway I hope that this mod will work like Api for making any custom dialogues with Npcs so everyone will be able to share text files without any changes in the code.
Ooohhh....Fascinating. Guess this is going to make the dating mechanics in the game a little more spicy and maybe as a core for other modders who'd like to add some quests dialogue or other stuff.
So you can't simply feed a dialogue into a textbox then? I don't know the level of freedom you have, but maybe you can override the class and the method? That's all the fun with object oriented programming... I don't know much about c# (It's the language used right?) but the idea would be something like that Code: class name extends parentClass { fetchLine( [the params for the original function], flag = false){ if(flag){ pointer = ParseTextAndSimulatePointer(params) } else { pointer = parentClass.fetchline(params) } return pointer } } I guess it would be a bit more complicated but you get the idea Or you could make an answer that only contains a variable that you fill before showing the answer (That wouldn't be pretty depending on how it's coded internally but if it works, I don't know) As for the detection of the dialog box event, there are several way to get around I can think about: - The game is pretty much paused while in dialogue mode you could check for activity on the npc side but it could be resource consuming (well in regard to the game usual behavior) On the other side there must be à boolean somewhere that handle the "world paused state" or a function that would return this state (The question being... Where?) - An even more hacky way is that you could catch input from the player which is a bit more unreliable, when prepared, as soon as it makes a movement the event would start (it's a bit of an ugly workaround though) Anyway as I said launching event is something to keep in mind while coding so that if you want and can include the possibility, you wouldn't have to rewrite a large part of the code. It can be tackled later.
Nice! I meant I can detect If the game in a dialogue (game1.dialogueUp). So I can check If the dialoguebox variable was changed every second? Too recource consuming. Anyway I have found afterDialogueBoxFade delegate. Now I can make questions after dialogues I think. I am thinking about such file content now: FIlename will be a question name. Conditions1 Command1 Command2 Command3 ... Folder with answers Conditions2 Command1 Command2 Command3 ... Folder with answers It there is no true conditions question will not appear in the list of questions. Where conditions are things like season, weather or relationships. Only one question will be choosed. If there is no folder with answers at the end conversation with Npc will end. And Commands are special events like starting a conversation with npc, or special emotes of you or Npc, warps or whatever I have coded into the mod. New command will start as soon as conversation with Npc has ended.
Yay, this is working. Things are now happening one after another. Now you can have this conversation for example: Question1=>Dialogue1=>Dialogue2=>Script3=>Message1=>Question3=>Dialogue3=>Exit All that left is to write a file system and add different requirements for dialogues. And to somehow detect at what npc you clicked. Didn't think about the last one much but shouldn't be very complicated.
Any way you could post source? I've been planning a similar mod adding and editing NPC behaviors, including conversations, but I've been having a hard time figuring out how to edit and work with the characters and relations. Being able to glean off your source would be very helpful
I can but this will not help you in any way. I am not going to change any behaviours or conversations (yet). I just use : StardewValley.Game1.drawDialogue(DialSpeaker, DialEleContent); to draw dialogues. DialSpeaker is Npc. This is where conversations with Npcs ends for now. Also I believe you can get access to all npc's dialogues using: DialSpeaker.Dialogue or use DialSpeaker.CurrentDialogue to gain access to current dialogue. Not sure about last one. Or just delete all current dialogues and add new ones through DialSpeaker.addExtraDialogues(dialogues).