Jump to content

Dialogue Modding: Can you create new global variables?


Recommended Posts

Been learning how to create new dialogue for the game and learning about the general structure of the nodes in the conversationbundle files and the text that will be seen ingame within the stringtable files.

I'm aware that there is a list of the variables with the tags like b_Player_Romance located in exported/design/globalvariables/game.globalvariablesbundle.

Only thing I am still a bit ignorant on is how to create new global variables and endgameslides.

If I for example am in the process of making a big dialogue mod for myself and I wanted to add in something like an Ydwin romance how would I go about creating a ydwin_romance_active variable that I would be able to use for my own created nodes.

Could I just add them to the list in the game.globalvariablesbundle and use them for nodes?

Also, how would I go about creating an epilogue slide for ydwin or just in general.

Edited by Negotiator
  • Thanks 1
Link to comment
Share on other sites

9 hours ago, Negotiator said:

Could I just add them to the list in the game.globalvariablesbundle and use them for nodes?

You can append global variables by putting a .globalvariablesbundle in your mod's folder 🙂

Something like this:

ydwin.globalvariablesbundle

{
	"GlobalVariablesSets": [
		{
			"GlobalVariables": [
				{
					"ID": "00000000-0000-0000-0000-000000000000",
					"Tag": "ydwin_romance_active",
					"InitialValue": 0
				}
			]
		}
	]
}
  • Thanks 1
Link to comment
Share on other sites

Thanks Noqn, for the answer, file, and paste stuffs. I'll give things a test ingame and see the results.

 

Edit: Updating the post to let others know of the results of Noqn's tip.

It worked. Perfectly. I'll try and give a short step by step of what I did just in case others want to do this.

File got downloaded as:

1. ydwin_globalvariablesbundle.4b93669e44a4f916acab932a9d59d152

2. renamed it to the file text on the post: ydwin.globalvariablesbundle

3. got my test mod which added an extra node to the usher's conversation at the beginning of the game 21_bs_usher (stringtable for ingame text and conversationbundle for node data)

4. slipped the globalvariablesbundle into override/test/globalvariables

5. added an "OnEnterScripts" uh...script to nodeid:5 that adds 1 to the ydwin romance active value (initially at 0)

like so

"OnEnterScripts": [
            {
                    "Data": {
                        "FullName": "Void SetGlobalValue(String, Int32)",
                        "Parameters": [
                            "ydwin_romance_active",
                                "1"
                        ],
                        "Flags": "",
                        "UnrealCall": "",
                        "FunctionHash": 1935477378,
                        "ParameterHash": -85113287
                    },
                    "Conditional": {
                        "Operator": 0,
                        "Components": []
                    }
                }
            ],

6. added conditional to newly created nodeid: 6 that requires "ydwin_romance_active" to equal 1 and if it's not 1 the conversation ends and the door doesn't open automatically.

like so

"Conditionals": {
                "Operator": 0,
                "Components": [
                {
                        "$type": "OEIFormats.FlowCharts.ConditionalCall, OEIFormats",
                        "Data": {
                            "FullName": "Boolean IsGlobalValue(String, Operator, Int32)",
                            "Parameters": [
                                "ydwin_romance_active",
                                "EqualTo",
                                "1"
                            ],
                            "Flags": "",
                            "UnrealCall": "",
                            "FunctionHash": 901380568,
                            "ParameterHash": -1168634782
                        },
                        "Not": false,
                        "Operator": 0
                    },]

7. Then I tested to make sure the game wasn't just ignoring this and set the conditional to 

"ydwin_romance_active",
                                "EqualTo",
                                "0"

and the newly created node was skipped after changing this value.

 

Hope this helps someone!

 

Also, and I'd like to ask for others to correct me if I'm wrong as this is just an assumption, for the endgameslide question I think I may have found the answer by using a node from endgamesldes.conversationbundle for reference (node 261):

{
            "$type": "OEIFormats.FlowCharts.Conversations.TalkNode, OEIFormats",
            "EmotionType": "",
            "EmotionStrength": 0.5,
            "PersistEmotion": true,
            "EmotionDelay": 0.0,
            "SpeakerGuid": "6a99a109-0000-0000-0000-000000000000",
            "ListenerGuid": "b1a8e901-0000-0000-0000-000000000000",
            "ExternalVO": "",
            "HasVO": true,
            "NotSkippable": false,
            "IsQuestionNode": false,
            "HideSpeaker": false,
            "IsTempText": false,
            "PlayVOAs3DSound": false,
            "PlayType": 0,
            "Persistence": 0,
            "NoPlayRandomWeight": 0,
            "VOPositioning": 0,
            "DisplayType": 1,
            "NodeID": 261,
            "ContainerNodeID": -1,
            "Links": [
                {
                    "$type": "OEIFormats.FlowCharts.Conversations.DialogueLink, OEIFormats",
                    "RandomWeight": 1,
                    "PlayQuestionNodeVO": true,
                    "QuestionNodeTextDisplay": 0,
                    "FromNodeID": 261,
                    "ToNodeID": 262,
                    "PointsToGhost": false,
                    "Conditionals": {
                        "Operator": 0,
                        "Components": []
                    },
                    "ClassExtender": {
                        "ExtendedProperties": []
                    }
                }
            ],
            "ClassExtender": {
                "ExtendedProperties": [
                    "SpeakerAnimation,0",
                    "ListenerAnimation,0",
                    "DoNotClearText,False",
                    "FocusedSpeaker,6a99a109-0000-0000-0000-000000000000",
                    "VOEventOverride,None"
                ]
            },
            "Conditionals": {
                "Operator": 0,
                "Components": [
                    {
                        "$type": "OEIFormats.FlowCharts.ConditionalCall, OEIFormats",
                        "Data": {
                            "FullName": "Boolean IsGlobalValue(String, Operator, Int32)",
                            "Parameters": [
                                "b_Sank_In_Ukaizo_Storm",
                                "EqualTo",
                                "1"
                            ],
                            "Flags": "",
                            "UnrealCall": "",
                            "FunctionHash": 901380568,
                            "ParameterHash": 171684792
                        },
                        "Not": false,
                        "Operator": 0
                    }
                ]
            },
            "OnEnterScripts": [
                {
                    "Data": {
                        "FullName": "Void SetEndGameSlide(String)",
                        "Parameters": [
                            "gui\\endgameslides\\endgameslide_drown.png"
                        ],
                        "Flags": "",
                        "UnrealCall": "",
                        "FunctionHash": -2009207772,
                        "ParameterHash": -535125688
                    },
                    "Conditional": {
                        "Operator": 0,
                        "Components": []
                    }
                }
            ],
            "OnExitScripts": [],
            "OnUpdateScripts": []
        },

 

1. Following this same format, I could theoretically create a node under conditionals that has

 "ydwin_romance_active",
                                "EqualTo",
                                "1"

2. for the "OnEnterScripts" have the same png from this node or different pngs from other nodes come up

"OnEnterScripts": [
                {
                    "Data": {
                        "FullName": "Void SetEndGameSlide(String)",
                        "Parameters": [
                            "gui\\endgameslides\\endgameslide_drown.png"

or maybe even following the same format insert my own png and set that up and have something like

 "gui\\endgameslides\\ydwin.png"

Edited by Negotiator
  • Like 1
Link to comment
Share on other sites

Awesome, glad to hear it worked!

There is one ending slide with Ydwin which might be of use, from Beast of Winter:

"gui\\endgameslides\\lax\\lax_endgame_11.png" (from Node 14 in conversations\lax02_01_iceberg_dungeon\lax02_endgameslides.conversationbundle)

Spoiler

J6ppAcg.png

 

 

  • Like 1
Link to comment
Share on other sites

Would be better to use that instead of the sailing ship like I was going to I suppose lol. Thanks a bunch for the help. May seem like small answers but being able to create global variables and finding the best pngs will make my mod that much better.

Currently working on Pallegina's romance after having just created global romance variables for her, fassina, mirke, and ydwin thanks to your answer. Replaced all of ydwin`s barks with the player female noble voice set since I felt it suits her better and moved the rest of the voice files out.

Also finished:

1. Adding slides for the sidekicks (unromanced versions and text not complete so far, pngs could also use changing such as using the ydwin one you recommended) .

2. Added variables for good/evil watcher for the created convos after xoti goes dark or light allowing me to give more variation to what xoti ending you can get (evil watcher/light xoti/not in a romance, good watcher/dark xoti/not in a romance, etc.

3. Added convos for after maia gets flagged to quit the navy.

4. Added convos for after the player enters a full romance with maia.

5. Added convos for after the player enters a full romance with xoti.

6. Altered/expanded most of the ending slides for almost every node. Left what feels fine alone but it`s all subject to change till it's done.

Thinking about what I can do for Vatnir as well. Good bit of potential there.

I also recently discovered a trick. Maybe others might get something out of it too.

In each node there is something called 

DisplayType:

if it is set at 1 it shows your usual dialogue box that you can connect nodes with.

If it is set to 2 it shows floating text over the npc's head and it's done. No participation. (like that floating text in combat)

 

Set the display type from 2 to 1 of one of those floating nodes and you can start a branch of dialogue.

For example here is one of the usher's lines that's usually just floating text with no continuation or choice selection, but is now in a dialogue box and continues to a node I made.

https://i.imgur.com/qih0LBi.jpg

https://i.imgur.com/UcFkWou.jpg

 

So not only can you simplify the process of making a new conversation by sacrificing a line of floating text (or keeping it and just transitioning into a new convo), but you can go off of that floating text allowing you to make it so the watcher can participate in banters or other dialogue from npcs you might think they would chime in on.

Thanks to someone else for locating the lines I needed I was able to take those floating dialogs that you can't respond to (floating text you get when to talk to the sidekicks) and give the sidekicks the potential to be elevated to nearly full companion status (of course these convos will be silent, but people who have played poe1 like me should have no problem).

Edited by Negotiator
Made things more readable.
  • Like 2
Link to comment
Share on other sites

On 6/4/2020 at 8:14 AM, Negotiator said:

Replaced all of ydwin`s barks with the player female noble voice set since I felt it suits her better and moved the rest of the voice files out.

If you don't mind the conversation audio being disabled for her character, you can change Ydwin's voice by altering the "ChatterFile" and "ChatterPrefix" lines from the entry in speakers.gamedatabundle to those from the Noble Female.

{
    "GameDataObjects": [
	{
            "$type": "Game.GameData.SpeakerGameData, Assembly-CSharp",
            "DebugName": "SPK_Companion_Ydwin",
            "ID": "6bca91c7-7933-49e5-b27a-29d52d3304c2",
            "Components": [{
                    "$type": "Game.GameData.SpeakerComponent, Assembly-CSharp",
                    "ChatterFile": "1af15f4a-4a1e-435a-a597-9104adb8246e",
                    "ChatterPrefix": "player_noble_f",
                }
            ]
        }
	]
}

 

Edited by Kvellen
  • Thanks 2
Link to comment
Share on other sites

@Kvellen Good to know, thanks. I'll try it out. That definitely would save me time for when I want to do this for other characters. Copy/pasting the noble folder and renaming around 120 files individually wasn`t very fun.

I was originally going off the method used in this mod which I`m using for Xoti to give her the kind female player voice set:

https://www.nexusmods.com/pillarsofeternity2/mods/56

And yes I absolutely don't mind the convos audio being disabled. In fact it will help for whenever I decide to tweak her existing dialogue (though like Pallegina I'm planning to just make a new alternate node that requires the romance value or whatever other value I make to be at 1 and make the original dialogue require the value to be at 0).

 

Edit: Just wanted say I tried Kvellen's method ingame on Eder and it works. He successfully sounded like a woman (of course I changed it back though since he's not a woman...).

Edited by Negotiator
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...