Easy NPC

Easy NPC

2M Downloads

Dialogue pop-up idea/Player-specific NPC commands

norfaremc opened this issue ยท 2 comments

commented

Hello there, I was wondering if you could create a new dialogue type that allows us to modify the size of the dialogue window/location on screen and allow players to interact with the world while it is displayed.
Example command:
/easy_npc dialog open Example{window:full_screen}
/easy_npc dialog open Example{window:windowed_screen}
Or, allowing a new dialogue type toggle in the dialogue creation so players can just use /easy_npc dialog open Example
Allowing us (and players) the option to configure the size and location of both dialogues in the config file would be great! I know many people would want to change the location of the windowed dialog screen from the bottom right to wherever else they wish, depending on how they've set up their HUD.

My idea is to have NPCs pop up via FTB Quests on the lower right side of the screen with the dialogue. Additionally, I'd like to utilize it to allow players to continue to interact in the world while this window pops up, so they can accept quests or go through dialogue options while adventuring. Having a way to prevent players from being able to close these pop-ups unless prompted by a command would be essential as well. Thanks for all your hard work on this mod!

commented

que

My visual example of how this could look in game

commented

I've discovered an issue that if a player is far away from an NPC, the dialogues won't pop up. I was wondering if we can have preset dialogues pop up even without the NPC being active in the world, so I can implement this system into singleplayer worlds for our solo modpack players?

Additionally, being able to summon an NPC that's player-specific would be great for servers. Right now, we can import presets into the world and set the NPC's custom UUID, which is great, but being able to reference that UUID for the player only would ensure that when we alter the NPC via commands, it doesnt modify every single entity with that UUID in the server.
For example: /easy_npc preset import_new world easy_npc:preset/humanoid/test.npc.nbt ~ ~ ~ @s

(The @s sets it to be player-specific, so whenever the questline references this entity, it only alters the player's specific entity)
You could create a new file path in the world files or local files for players once they summon (import_new) into a world with @s, creating a new NPC specific to that player that can be modified via commands without affecting everyone's identical NPCs. It would probably, realistically, have a new UUID (to not break the game) that would be auto-referenced with @s.
(example, changing it's default dialog for that player's specific entity without affecting all NPCs with the same UUID), so whenever @s is implemented into any command, it references that player's specific file path. Owners of servers would also be able to go into these file paths to view player's quest progress, theoretically. Which would be incredibly helpful with debugging. Essentially, NPCs would have two UUIDs, one to reference the entity type, and the other to reference the specific UUID created for the player's NPC.

Examples of how I'd implement these commands (and a few new ones I'm suggesting) to create a cohesive, interactive, player-specific questline:

Open initial dialog (without the NPC being present in the world yet) >>>
/easy_npc dialog open preset world easy_npc:preset/humanoid/questlinenpc.npc.nbt <dialog>{window:windowed_screen}
If we set a command in the NPC's actions as a /playsound command, it should automatically play the sound at the @initiator's location if the NPC does not exist in the world.
This could also prevent server lag, as it can lower the amount of NPCs present in the world, rendering only the dialog client-side, pretty much.

Import NPC specific to player (for later alterations to that NPC) >>>
/easy_npc preset import_new world easy_npc:preset/humanoid/questline.npc.nbt ~ ~ ~ @s

Move player-specific entity's home location >>>
/easy_npc navigation set home (custom entity UUID) ~ ~ ~ @s

Edit that player-specific NPC's equipment >>>
/easy_npc equipment set equipment set (custom entity UUID) @s

Open dialogue for player-specific NPC >>>
/easy_npc dialog open (entity UUID) <dialog>{window:windowed_screen} @s

Change default dialog for player-specific NPC >>>
/easy_npc dialog set default (entity UUID) <newdefaultdialog> @s

Add a close dialog command:
/easy_npc closedialog @player

I understand that having this many NPCs could potentially cause server lag and/or clutter, so it's important for questline developers to self delete NPCs after they're no longer needed or when a quest is done.

If another player tries to talk to (open dialog) another's player-specific NPC, it rejects them. "That's not your NPC" can pop up as a subtitle. This can prevent players from accessing questlines they shouldn't have access to.