Page 1 of 2

RPG Builder Integration Questions

Posted: Sun Dec 25, 2022 3:45 am
by Solange
Hi Tony,

Let me preface this by saying that I'm using RPG Builder (thanks so much for the integration btw) and that I suck at coding.
1. Is there an easy way to change the image in the Alert UI on the fly? Right now, it displays the same image every time. I was thinking something like Disco Elysium, where the Alert image changes if you're picking up an item, updating a quest, saving the game, etc.

I wonder how they did it.

With Quest Machine, I believe you give the option to pass in an image on the alert system there, but not the Dialogue System.
2. There's a lua function you added to RPG Builder -> rpgAddCharacterExperience(amount)

When I try to use this, however, I'm getting an error:

Dialogue System: Lua code 'rpgAddCharacterExperience(5)' threw exception 'Tried to invoke a function call on a non-function value. If you're calling a function, is it registered with Lua?'

etc.

I also don't see it in the Custom -> RPG Builder lua section. I feel like I'm missing something dumb here. Some of the other Player Lua scripts like rpgPlayerGetName() work fine, and others like the Questing ones seem to be missing too. Did I somehow mess this up by downloading the early beta integration?

3. I'm using Quest Machine because I prefer it over the RPG Builder default quest system.

However, I'm having some issues integrating the new RPG Builder/Dialogue Manager combined Save System with Quest Machine, probably because I haven't 100% wrapped my head around how it works yet.

What's the best way to do this, do you reckon?

The main issue I'm having is that I had put the Quest Journal on the prefab of the Player Character, but this has the unfortunate consequence that now every player character has the same quests saved.

Obviously not ideal :)

I still have to learn how the save system works in depth. I've put that off until now.

I assume part of the problem here is that RPG Builder uses a prefab to spawn in a copy of the player character, and that everything is getting saved to that prefab


Thanks so much for the advice. Your plugins are great, that's why I'm trying to jam them into other stuff which breaks things :)

Happy holidays

edit: oops, I knew I was missing something dumb with #2. You added an updated integration to the extras page

Re: RPG Builder Integration Questions

Posted: Sun Dec 25, 2022 4:51 am
by Solange
going to add 1 more question as it's related to the integration

I had a janky system set up where Dialogue Manager was under the RPG Builder Essentials prefab, and I was using the Dialogue Panel's OnOpen() and OnClose() to hide/close the UI HUD and disable UI presses for RPG Builder.

I did this because the RPG Builder UI was too bulky / unnecessary and because if you used the keyboard to press 2, for example, to respond to a dialogue prompt, it was shooting off a Fireball

my problem is the new save system integration seems to rip the Dialogue Manager out of the RPG Builder Essentials on a scene change, like going back to the Main Menu, because of the Don't Destroy component. so my janky solution doesn't work anymore

is there a better object on which to attach the Save components than the Dialogue Manager?

Re: RPG Builder Integration Questions

Posted: Sun Dec 25, 2022 8:59 am
by Tony Li
I'll check the Dialogue Manager integration to make sure it disables the RPG Builder hotkeys and UI during conversations.

If you need to disable anything else, you could use a script like this on any GameObject. It doesn't have to be on a specific GameObject:
ConversationStartEndEvents.cs

Code: Select all

using UnityEngine;
using UnityEngine.Events;
using PixelCrushers.DialogueSystem;

public class ConversationStartEndEvents : MonoBehaviour
{
    public UnityEvent onConversationStartEvent;
    public UnityEvent onConversationEndEvent;
    
    void OnEnable() 
    {
        DialogueManager.instance.conversationStarted += OnConversationStarted;
        DialogueManager.instance.conversationEnded += OnConversationEnded;
    }
    
    void OnDisable() 
    {
        DialogueManager.instance.conversationStarted -= OnConversationStarted;
        DialogueManager.instance.conversationEnded -= OnConversationEnded;
    }
    
    void OnConversationStarted(Transform actor) { onConversationStartEvent.Invoke(); }
    void OnConversationEnded(Transform actor) { onConversationEndEvent.Invoke(); }
}
RPG Builder doesn't have official Quest Machine integration yet. I'm waiting for Thomas to make some changes to RPG Builder first. I'll get the Quest Machine integration out as soon as I can after that.

Regarding the alert UI, do you want to change the background image of the alert panel or change an image shown in the alert? If you want to change an image shown in the alert, you can use TextMesh Pro and <sprite> tags in your alert text. If you want to change the background image of the panel, that will require a little scripting.

Re: RPG Builder Integration Questions

Posted: Mon Dec 26, 2022 4:13 am
by Solange
Hi Tony,

Thanks for the reply. If it's not too much trouble, adding the RPG Builder hotkey / UI disable option would be a nice addition.

In the meantime, I'll slap that script on the HUD and see if it works. The biggest annoyance for me was the keyboard still using hotkeyed abilities. especially because I pause the game during dialogue

IIRC, the way he has it set up is that the Cursor Hovering over a UI panel (or typing in an input field) is what disables hotkey activations. one issue is that the Dialogue window does not take up the full screen. i tried making a transparent panel that covered the entire screen, but it didnt seem to have any effect

However, there are some public functions in the GAME_EVENTS object under the ESSENTIALS prefab in RPG Builder, like the Cursor Hovering Over UI check. i just turned that on when the Dialogue Panel opened. i'm sure there's a more elegant solution

Quest Machine integration would be great.

and yes, just the image that pops up in the alert, not the background panel.

"you can use TextMesh Pro and <sprite> tags in your alert text."

thank you, i didn't think of this

Re: RPG Builder Integration Questions

Posted: Tue Dec 27, 2022 1:46 pm
by Solange
Hey again,

Did you test the RPG Builder integration with multiple characters created / saved?

I'm having some strange issues when I go beyond 1 save file (usually 4+ is when stuff starts breaking). It seems to start loading the wrong save files, of other characters. When I create a new one, it will use the save file of a character that's already created.

Also, when I delete the last character, for some reason, when I make a new one it loads the old save file of the last character deleted unless I close out of the game entirely and restart.

I know these issues aren't a problem with Dialogue Manager itself, but I'm really scratching my head trying to work through this and wondering if you had any insight. Not sure what I did to break everything :lol:

Thanks again

Re: RPG Builder Integration Questions

Posted: Tue Dec 27, 2022 1:52 pm
by Tony Li
Are you using the latest version of the integration from the Dialogue System Extras page? (Currently DS_RPGBuilderSupport-2022-12-20.unitypackage as of this reply, although a new one may be coming soon.)

Re: RPG Builder Integration Questions

Posted: Tue Dec 27, 2022 1:54 pm
by Solange
Yes, I am

I'm also using a bunch of your Savers on objects. It seems to work fine with 1 character / save file (even Quest Machine) but once I started creating a bunch of characters to test, that's when the chaos started :)

Re: RPG Builder Integration Questions

Posted: Tue Dec 27, 2022 2:03 pm
by Tony Li
I'll check that. It's something I tested (Dialogue System, not Quest Machine, with RPG Builder), but maybe there's some edge case. Are you also using the latest version of RPG Builder?

Re: RPG Builder Integration Questions

Posted: Tue Dec 27, 2022 2:20 pm
by Solange
Yep, latest version. When I made the initial post, I wasn't using your latest integration, but I am now

Don't worry, I know it's not a problem with Dialogue Manager itself. I was just curious if you had tested multiple save characters on RPGB. I'm trying to figure out what would cause the save files to go wonky like this

I'm not using the prefab Dialogue Manager you included with the integration, but rather an older copy I was using before

are there any settings I should watch out for that might be screwing things up? maybe it's something I'm overlooking

currently, I have the Dialogue Manager under the RPGB essentials with the RPG B bridge, Dialogue System Saver & PlayerPrefs Saver

then another object w/ Do Not Destroy that has the Save System and JSON Data Serializer

i tried putting those on Dialogue Manager, too, but it didnt seem to make a difference

again, as far as I can tell, it seems to work fine with 1 or 2 saves (besides the deleting last character issue). problem arises when I make a bunch. I thought it might be somehow related to the order the characters were in in the Continue screen, but I cant tell

Re: RPG Builder Integration Questions

Posted: Tue Dec 27, 2022 2:44 pm
by Solange
i should add that it seems that the stuff associated with RPG B has the correct persistence like the Interactable Objects / Equipment / Character Name and what not. it's the Dialogue Manager savers (Position Saver, Enabled Saver, Active Saver etc) that seem to load the wrong character's saved data (and the quests from Quest Machine, too, that are on the other character)

so thats why i asked here.

would there be anything in Quest Machine that's breaking the saved data?