• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Dialog System v2.1.0

This bundle is marked as pending. It has not been reviewed by a staff member yet.
Requires version 1,31 or newer.

A simple dialog system created by me, to provide you with easy and comfortable dialogs.
(This system starts a separate dialog only for the target player, not one for all!)

I'm open for any feedback and suggestions.


System API

Patch Notes

Default Imports Explanation

Example Function

Custom UI

Contact Information


Warcraft 3 Functions API (These functions may be used just like a normal warcraft 3 function)
function Dialog_Add takes string DialogID, string Action returns integer
  • Basic function of dialog system. It is necessary to add Dialog Actions to a dialog.
  • DialogID is used to identify the dialog you add a action to.
  • The returned integer is the action slot of the added action. It can be used with Dialog_Remove to remove it again.
  • Example Usage: call Dialog_Add("YourDialog", "Change Text Your Text")
function Dialog_Remove takes string DialogID, integer Slot returns nothing
  • Basic function of dialog system. It can be used to remove Dialog Actions from a dialog.
  • Example Usage: call Dialog_Remove("YourDialog", 2)
function Initiate_Dialog takes integer pID, string DialogID returns boolean
  • Basic function of dialog system. It is used to start a dialog. Important to know here is that Dialog Actions added with Dialog_Add while active dialog will not be part of that active dialog.
  • pID refers to the player id and ranges from 0 to 23. It tells the system for which player the dialog should start.
  • The returned boolean is either true or false, based on if dialog was inititated successfully.
  • Example Usage: call Initiate_Dialog(0, "YourDialog")
function IsDialog takes integer pID returns boolean
  • Basic function of dialog system. It is used to check if a player is currently in a dialog.
  • The returned boolean is either true or false, based on if the player with the number 'pID' is in a dialog or not.
  • Example Usage: call IsDialog(0)
function Choice_Add takes string id, string content, boolean isEnabled, string FollowUp returns boolean
  • Basic function of dialog system. It is used to create choice buttons that can be used inside Dialog Actions with Multiple Choice.
  • The returned boolean is either true or false, based on if the choice button was created successfully.
  • ExampleUsage: call Choice_Add("YourChoiceButton", "This is the button text", true, "YourDialog2")
function Get_Last_Choice takes integer pID returns string
  • Basic function of dialog system. It can be used to check the id of the last choice button a player pressed.
  • The returned string is the id of the last choice button.
  • ExampleUsage: call Get_Last_Choice(0)
function print takes string hwat returns nothing
  • Basic function of chat system. It works exactly like BJDebugMsg(), just that it sends the the string in the custom chat.
  • Example Usage: call print("Your debug message")
function Get_Game_Time takes nothing returns real
  • Basic function of chat system. It is mainly used by chat system to tell how much time elapsed since game start, but can also be used by user.
  • The returned real is the actual time that elapsed since game started in seconds.
  • Example Usage: call Get_Game_Time()
function Set_Chat_Color takes integer pID, string HexCode returns boolean
  • Basic function of chat system. It can be used to change a players color in chat. The HexCode must be 6 chars long and may only use hex chars (0123456789ABCDEF).
  • The returned boolean is either true or false, based on if the chat color of the player could be changed. (Reason for false boolean is most likely incorrect HexCode)
  • Example Usage: call Set_Chat_Color(0, "4E2A04")
function Get_Chat_Color takes integer pID returns string
  • Basic function of chat system. It is mainly used by chat system to tell which color a player should have in chat, but can also be used by user.
  • The returned string is the HexCode of target player color in chat.
  • Example Usage: call Get_Chat_Color(0)
function Set_Input_Key takes integer pID, string key returns boolean
  • Advanced function of dialog system. The input key is normally already defined in config, but can also be changed any time for each user locally.
  • The returned boolean is either true or false, based on if input key was changed successfully.
  • Allows pID = -1 to apply change for all players
  • Example Usage: call Set_Input_Key(0, "y")
function Get_Input_Key takes integer pID returns string

  • Advanced function of dialog system. It is mainly used by dialog system to check player input key during input wait, but can also be used by user.
  • The returned string is the input key of Player(pID).
  • Example Usage: call Get_Input_Key(0)
function Set_Skip_Key takes integer pID, string key returns boolean
  • Advanced function of dialog system. The skip key is normally already defined in config, but can also be changed any time for each user locally.
  • The returned boolean is either true or false, based on if skip key was changed successfully.
  • Allows pID = -1 to apply change for all players
  • Example Usage: call Set_Skip_Key(0, "x")
function Get_Skip_Key takes integer pID returns string
  • Advanced function of dialog system. It is mainly used by dialog system to check player skip key during input wait, but can also be used by user.
  • The returned string is the skip key of Player(pID).
  • Example Usage: call Get_Skip_Key(0)
function Set_Skip_Speed takes integer pID, real multiplier returns boolean
  • Advanced function of dialog system. The skip speed is normally already defined in config, but can also be changed any time for each user locally.
  • The returned boolean is either true or false, based on if skip speed was changed successfully.
  • Allows pID = -1 to apply change for all players
  • ExampleUsage: call Set_Skip_Speed(0, 10.)
function Get_Skip_Speed takes integer pID returns real
  • Advanced function of dialog system. It is mainly used by dialog system to check player skip speed while a skip is in process, but can also be used by user.
  • The returned real is the current skip speed of Player(pID).
  • ExampleUsage: call Get_Skip_Speed(0)
function Set_Global_Speed takes integer pID, real multiplier returns boolean
  • Advanced function of dialog system. The global speed is normally already defined in config, but can also be changed any time for each user locally.
  • The returned boolean is either true or false, based on if global speed was changed successfully.
  • Allows pID = -1 to apply change for all players
  • ExampleUsage: call Set_Global_Speed(0, 1.)
function Get_Global_Speed takes integer pID returns real
  • Advanced function of dialog system. It is mainly used by dialog system to check player global speed during any time handling, but can also be used by user.
  • The returned real is the current global speed of Player(pID).
  • ExampleUsage: call Get_Global_Speed(0)
function Set_Text_Speed takes integer pID, real multiplier returns boolean
  • Advanced function of dialog system. The text speed is normally already defined in config, but can also be changed any time for each user locally.
  • The returned boolean is either true or false, based on if text speed was changed successfully.
  • Allows pID = -1 to apply change for all players
  • ExampleUsage: call Set_Text_Speed(0, 4.)
function Get_Text_Speed takes integer pID returns real
  • Advanced function of dialog system. It is mainly used by dialog system to check player text speed during Change Text action, but can also be used by user.
  • The returned real is the current text speed of Player(pID).
  • ExampleUsage: call Get_Text_Speed(0)
function Set_AutoP_Speed takes integer pID, real multiplier returns boolean
  • Advanced function of dialog system. The auto play speed is normally already defined in config, but can also be changed any time for each user locally.
  • The returned boolean is either true or false, based on if auto play speed was changed successfully.
  • (1 + (Last Text Length * 0.03)) * (1 / Auto Play Speed) seconds.)
  • Allows pID = -1 to apply change for all players
  • ExampleUsage: call Set_AutoP_Speed(0, 1.)
function SavePVar takes integer pID, string ref, string content returns boolean
  • Advanced function of dialog system. It is used to save variables for one specific player that can be used inside Dialog Actions with <!ref>.
  • The returned boolean is either true of false, based on if the variable was saved successfully.
  • Note: If you want the variable to be for example a real, just type "2.5"
  • ExampleUsage: call SavePVar(0, "Your Player Variable", "The content of your player variable")
function LoadPVar takes integer pID, string ref, returns string
  • Advanced function of dialog system. It is mainly used by dialog system to check player variables, but can also be used by user.
  • The returned string is the string stored inside that variable.
  • ExampleUsage: call LoadPVar(0, "Your Player Variable")
function SaveGVar takes string ref, string content returns nothing
  • Advanced function of dialog system. It is used to save variables for all players that can be used inside Dialog Actions with <?ref>.
  • Note: If you want the variable to be for example a real, just type "2.5"
  • ExampleUsage: call SaveGVar("Your Global Variable", "The content of your global variable")
function LoadGVar takes string ref, returns string
  • Advanced function of dialog system. It is mainly used by dialog system to check global variables, but can also be used by user.
  • The returned string is the string stored inside that variable.
  • ExampleUsage: call LoadGVar("Your Global Variable")
function Set_Choice_Enabled takes integer pID, string id, boolean isEnabled returns nothing
  • Advanced function of dialog system. It can be used to enable and disable choice buttons for a player.
  • ExampleUsage: call Set_Choice_Enabled(0, "YourChoiceButton", true)
function Is_Choice_Enabled takes integer pID, string id returns boolean
  • Advanced function of dialog system. It is mainly used by dialog system to check if a choice button is enabled or disabled, but can also be used by user.
  • The returned boolean is either true or false, based on if the choice button is enabled or not.
  • ExampleUsage: call Is_Choice_Enabled(0, "YourChoiceButton")
function Set_Auto_Play takes integer pID, boolean isEnabled returns boolean
  • Advanced function of dialog system. It is mainly used by dialog system to change to auto play on button press, but can also be used by user for self-made buttons.
  • The returned boolean is either true or false, based on if auto play was started successfully.
  • ExampleUsage: call Set_Auto_Play(0, true)
function Is_Auto_Play takes integer pID returns boolean
  • Advanced function of dialog system. It is mainly used by dialog system to check if auto play is active or not,but can also be used by user.
  • The returned boolean is either true or false, based on if auto play is enabled or not.
  • ExampleUsage: call Is_Auto_Play(0)
function Set_Auto_Skip takes integer pID, boolean isEnabled returns boolean
  • Advanced function of dialog system. It is mainly used by dialog system to change to auto skip on button press, but can also be used by user for self-made buttons.
  • The returned boolean is either true or false, based on if auto skip was started successfully.
  • ExampleUsage: call Set_Auto_Skip(0, true)
function Is_Auto_Skip takes integer pID returns boolean
  • Advanced function of dialog system. It is mainly used by dialog system to check if auto skip is active or not,but can also be used by user.
  • The returned boolean is either true or false, based on if auto skip is enabled or not.
  • ExampleUsage: call Is_Auto_Skip(0)
function Repeat_Current takes integer pID returns nothing
  • Advanced function of dialog system. It is mainly used by dialog system to repeat last sound on button press, but can also be used by user for self-made buttons.
  • ExampleUsage: call Repeat_Current(0)
function Set_Clock_Visible takes integer pID, boolean state returns boolean
  • Advanced function of dialog system. The clock visibility is normally already defined in config, but can also be changed any time for each user locally.
  • The returned boolean is either true or false, based on if clock visibility was changed successfully.
  • Allows pID = -1 to apply change for all players
  • ExampleUsage: call Set_Clock_Visible(0, true)
function Is_Clock_Visible takes integer pID returns boolean
  • Advanced function of dialog system. It is mainly used by dialog system to check if the clock is visible or not, but can also be used by user.
  • The returned boolean is either true or false, based on if the clock is visible or not.
  • ExampleUsage: call Is_Clock_Visible(0)
function Set_Idle_Time takes integer pID, real idletime returns boolean
  • Advanced function of dialog system. The time after the mouse hides is normally already defined in config, but can also be changed any time for each user locally.
  • Settings idletime to 0 will disable mouse hide.
  • The returned boolean is either true or false, based on if the change was successfully or not.
  • Allows pID = -1 to apply change for all players
  • ExampleUsage: call Set_Idle_Time(0, 5.)
function Allow_Right_Click takes integer pID, boolean isAllowed returns boolean
  • Advanced function of dialog system. If right click is allowed to hide dialog box is normally already defined in config, but can also be changed any time for each user locally.
  • The returned boolean is either true or false, based on if the change was successfully or not.
  • Allows pID = -1 to apply change for all players
  • ExampleUsage: call Allow_Right_Click(0, true)
function Edit_Button takes framehandle frame, code action, string name returns boolean
  • Advanced function of dialog system. It is used by default in config to create the default dialog system ui buttons, but can also be used any time to create your own buttons.
  • The returned boolean is either true or false, based on if the button was created successfully or not.
  • ExampleUsage: call Edit_Button(YourFrameHandle, YourActionFunction, TextOfTextButtons)
function Set_Repeat_Button takes framehandle frame returns nothing
  • Advanced function of dialog system. It is used by default in config to define which button should be enabled/disabled based on available sound file, but can also be used change the button anytime.
  • ExampleUsage: call Set_Repeat_Button(YourFrameHandle)

Dialog Action API (These functions may be used with Dialog_Add as "Action" Parameter)

  • Change Background

    • takes string Background
    • Example Usage: call Dialog_Add("YourDialog", "Change Background Default")
  • Change BGM

    • takes string Music, integer milliseconds [Experimental, might desync]
    • Example Usage 1: call Dialog_Add("YourDialog", "Change BGM Example Music|10")
    • Example Usage 2: call Dialog_Add("YourDialog", "Change BGM Example Music")
  • Stop BGM

    • takes nothing [Experimental, might desync]
    • Example Usage: call Dialog_Add("YourDialog", "Stop BGM")
  • Add NPC

    • takes string NPC, real Speed, string Side
    • Example Usage: call Dialog_Add("YourDialog", "Add NPC Graf Zeppelin|1|Left")
  • Remove NPC

    • takes string NPC, real Speed, string Side
    • Example Usage: call Dialog_Add("YourDialog", "Remove NPC Graf Zeppelin|1|Left")
  • Change NPC Instant

    • takes string NPC, string Side
    • Example Usage: call Dialog_Add("YourDialog", "Change NPC Instant Graf Zeppelin|Left")
  • Change Speaker

    • takes string NPC
    • Example Usage: call Dialog_Add("YourDialog", "Change Speaker Graf Zeppelin")
  • Change Text

    • takes string Text, string Sound
    • Example Usage 1: call Dialog_Add("YourDialog", "Change Text text|Example Voice")
    • Example Usage 2: call Dialog_Add("YourDialog", "Change Text text")
  • Input Wait

    • takes boolean LeftMouseAllowed
    • Example Usage 1: call Dialog_Add("YourDialog", "Input Wait false")
    • Example Usage 2: call Dialog_Add("YourDialog", "Input Wait")
  • Time Wait

    • takes real Seconds
    • Example Usage: call Dialog_Add("YourDialog", "Time Wait 5")
  • Change Time

    • takes real hours, real minutes
    • Example Usage 1: call Dialog_Add("YourDialog", "Change Time 20|40")
    • Example Usage 2: call Dialog_Add("YourDialog", "Change Time 20")
  • Change InputK

    • takes string key
    • Example Usage: call Dialog_Add("YourDialog", "Change InputK y")
  • Change SkipK

    • takes string key
    • Example Usage: call Dialog_Add("YourDialog", "Change SkipK x")
  • Change SkipS

    • takes real speed
    • Example Usage: call Dialog_Add("YourDialog", "Change SkipS 10.0)
  • Set TextS

    • takes real speed
    • Example Usage: call Dialog_Add("YourDialog", "Set TextS 4.0)
  • Save Variable

    • takes string ref, var content, boolean global (global defaults to false)
    • Example Usage 1: call Dialog_Add("YourDialog", "Save Variable speed|4.0|true")
    • Example Usage 2: call Dialog_Add("YourDialog", "Save Variable ikey|y")
    • How to load default variable: <.ref>
    • How to load player variable: <!ref>
    • How to load global variable: <?ref>
  • Text Input

    • takes string ref, boolean global (global defaults to false)
    • Example Usage 1: call Dialog_Add("YourDialog", "Text Input name")
    • Example Usage 2: call Dialog_Add("YourDialog", "Text Input name|true")
    • The examples would store the confirmed text input value into variable "name"
  • Multiple Choice

    • takes string Option 1, string Option 2, string Option 3, string Option 4, string Option 5
    • Example Usage 1: call Dialog_Add("YourDialog", "Multiple Choice btn1|btn2|btn3")
    • Example Usage 2: call Dialog_Add("YourDialog", "Multiple Choice btn1|btn2")
  • Choice State

    • takes string id, boolean isEnabled
    • Example Usage 1: call Dialog_Add("YourDialog", "Choice State testbtn1|true")
    • Example Usage 2: call Dialog_Add("YourDialog", "Choice State testbtn2|false")
How Multiple Choice works:
How Multiple Choice works:
How Multiple Choice works:

  • Create Choice Buttons with Choice_Add()
  • If you want for example only 3 options, just stop after option 3. [Maximum amount is 5]
  • Last selected choice will always be stored in: Get_Last_Choice()
  • Explanation how "Follow Up" works:
    • When Follow Up exists: Dialog will have a transition to the dialog id that is named in dialog follow up.
    • When Follow Up DO NOT exists: Dialog will continue normally.
File Pathings:

File Pathings:
File Pathings:

  • Important Info for NPC Sprite:
    "UI\\Dialog\\NPCs\\" + NPC + ".blp"

  • Important Info for Background:
    "UI\\Dialog\\Backgrounds\\" + Background + ".blp"

  • Important Info for Framework (Dialog Box, Dialog Buttons & Dialog Arrow):
    "UI\\Dialog\\Framework\\" + ... + ".blp"

  • Important Info for Sounds:
    "UI\\Dialog\\Sounds\\" + Sound + ".mp3"

  • Important Info for Music:
    "UI\\Dialog\\Music\\" + Music + ".mp3"

  • Import Info for Font:
    "UI\\Font\\" + Font
Additional Info:

Additional Info:
Additional Info:

  • You can press right-click to hide/show Dialog Box & Dialog Buttons during dialog.
  • Input Wait allows any letter in english alphabet (a - z) ; LeftMouseAllowed defaults to true.
  • If mouse is idle for 5 seconds it will hide. (configurable)
  • You can color you text like this: <#663399>colored text<#>
v1.00

  • Release Version
v1.01

  • Added Voice option to "Change Text" [optional]
v1.02

  • Added Left Mouse support to "Input Wait" [optional ; default: true]
v1.10

  • Separated Main, Test Map & Configuration
  • Completely New Dialog UI created by me
  • System now supports up to 9 custom buttons (5 image buttons, 4 text buttons)
  • Added "Leave" button as preview for new custom buttons and option to leave the test map
v1.11

  • Fixed Right-Click, it now hides UI properly again
  • You can use Last_Choice(Player Number) to get last choice of multiple choice event
  • Added "Change BGM" [Experimental, might desync in multiplayer]
  • Added "Stop BGM" [Experimental, might desync in multiplayer]
  • Test Map now works for 24 player slots (you gotta increase slots yourself.)
  • Removed UI\Font\Main_Font.otf
  • Removed war3mapMisc.txt
  • Moved the systems main script from header to category named "Main"
v1.12

  • Mouse now hides after 5 seconds of idle during dialog (can be changed in configuration)
v1.20

  • Plenty bug fixes
  • New Halloween Themed UI and Example Dialog (Happy Halloween)
  • Changed NPC Default Resolution to 800x1080
v2.0.0 [NOTE: VERSIONS BEFORE 2.0.0 ARE NO LONGER COMPATIBLE WITH THIS VERSION!]

  • Changed default design back to normal
  • Changed the default button optically
  • Better structured system folder
  • All Systems also have explainations in their comment now! (included .fdf explaination)
  • Added Chat in top left corner
  • Added print() to give out debug messages in chat
  • Added Get_Game_Time() to get current playtime
  • Added Set_Chat_Color(<integer> Player ID, <string> hexcode)
  • -> returns boolean
  • Added Get_Chat_Color()
  • -> returns hexcode
  • Added Option to change Font of chat in config.
  • Added Input Button Info at bottom left corner (automatically adapts to assigned Input Wait and Skip Shortcut)
  • Added Clock at top right corner, to represent game time during dialog (Can be removed in config)
  • Added "Change Time" (This function allows to change time during dialog)
  • -> Do know that it will change time for all players, cause it would desync otherwise.
  • Added Skip Shortcut (Skip just fast forwards and ignores input waits, it do not skips a whole dialog in an instant.)
  • -> Waits at Multiple Choice events for player choice before continue skipping
v2.0.1

  • Increased chat x-size from 0.2667 to 0.5
  • The buttons 1-1, 1-2, 1-3, 1-4, 1-5 are now separate textures again
  • Fixed a bug that caused Skip Button not to work when game was waiting for Input Key already
  • Input Wait no longer takes input key
  • Added Change InputK to change the Input Key during dialog
  • Added Set_Input_Key to change the Input Key outside dialog
  • Added Get_Input_Key to get the Input Key outside dialog
  • Added Change SkipK to change the Skip Key during dialog
  • Added Change SkipS to change the Skip Speed during dialog
  • Added Set_Skip_Key to change the Skip Key outside dialog
  • Added Get_Skip_Key to get the Skip Key outside dialog
  • Added Set_Skip_Speed to change the Skip Speed outside dialog
  • Added Get_Skip_Speed to get the Skip Speed outside dialog
  • Added Global speed factor (Formula: Action Speed * Global Speed * (Skip Speed) ; Skip Speed in brackets cause it only applies during skip)
  • Added Set_Global_Speed to change the Global Speed outside dialog
  • Added Get_Global_Speed to get the Global Speed outside dialog
v2.0.2

  • Change Text now only takes string Text and string Sound
  • Added Set TextS to change the Text Speed during dialog
  • Added Set_Text_Speed to change the Text Speed outside dialog
  • Added Get_Text_Speed to get the Text Speed outside dialog
  • Added colored text markdown (<#663399>colored text<#>)
v2.0.3

  • Added possible usage of player variables for "Dialog_Add" (Ex: <!speed>)
  • Added possible usage of global variables for "Dialog_Add" (Ex: <?speed>)
  • Added SavePVar(<integer> pID, <string> ref, <string> content)
  • Added LoadPVar(<integer> pID, <string> ref)
  • Added SaveGVar(<string> ref, <string> content)
  • Added LoadGVar(<string> ref)
  • Added Save Variable to save variables during dialog
v2.0.4

  • Added default variable type to access states during dialog (<.speed>)
  • Added <.ptime> to get current play time (time elapsed since game start)
  • Added <.gtime> to get current game time (time of day, see top right clock)
  • Added <.ikey> to get current input key
  • Added <.skey> to get current skip key
  • Added <.sspd> to get current skip speed
  • Added <.gspd> to get current global speed
  • Added <.tspd> to get current text speed
  • Added <.choice> to get last choice
  • Added <.background> to get current background
  • Added <.music> to get current background music
  • Last_Choice() was renamed to Get_Last_Choice()
v2.0.5

  • Added Choice_Add to create choice buttons before using them (allows easier configuration)
  • Choice Buttons now have to be created first with Choice_Add(id, content, isEnabled, follow up)
  • Changed "Multiple Choice", it now only takes Choice ID (as before up to 5)
  • Added "Choice State" to enabled and disable Choice Buttons inside dialog
  • Added Set_Choice_Enabled and Is_Choice_Enabled to set and get state of choice buttons outside dialog
v2.0.6

  • Added Text Input to create text input fields during dialog (Text Input takes variable and optional global boolean)
  • Moved Chat a bit on x & y axis so it no longer cuddles the wall
v2.1.0

  • Fixed Text Input Field, the Edit Cursor now properly adapts to font size
  • Added Auto Play feature. (Auto Play time wait on input wait equals (1 + (Last Text Length * 0.03)) * (1 / Auto Play Speed) seconds.)
  • Note: Last Text Length is calculated with the actual text length you see on screen.
  • Added Set_Auto_Play to change auto play state outside of dialog
  • Added Is_Auto_Play to check auto play state outside of dialog
  • Added Set_AutoP_Speed to change auto play speed outside of dialog.
  • Added <.aspd> to get current auto play speed
  • Added Set_Auto_Skip to change auto skip state outside of dialog
  • Added Is_Auto_Skip to check auto skip state outside of dialog
  • Added Repeat_Current to play current sound file (if available) again
  • Increased Font Size of both Speaker and Text
  • Increased Speaker & Text Frame Size on x-axis
  • Rounded some numbers in Dialog.fdf file
  • Replaced button 1-1, 1-2, 1-3, 1-4, 1-5
  • Turned around the order of all button 1-x
  • Assigned Auto Play to button 1-1 in test map
  • Assigned Auto Skip to button 1-2 in test map
  • Assigned Repeat to button 1-3 in test map
  • Disabled Button 1-4 in test map since theres no configuration yet
  • Assigned Hide Dialog Box to button 1-5
  • Button 1-1, 1-2, 1-3, 1-4, 1-5 are now individually disabled if they dont have any function
  • Added Set_Clock_Visible and Is_Clock_Visible to show/hide the clock and check if its visible
  • Added Set_Idle_Time to change the time after that mouse hides when inactive
  • Added Allow_Right_Click to change the if right-click ui hide is allowed or not
  • Following functions can now be given the pID '-1' to apply the change for all players:
    • Allow_Right_Click
    • Set_Idle_Time
    • Set_Clock_Visible
    • Set_Input_Key
    • Set_Skip_Key
    • Set_Skip_Speed
    • Set_Global_Speed
    • Set_Text_Speed
    • Set_AutoP_Speed
  • Added Edit_Button to be able to change buttons any time. (Automatically detects if frame is "Button" or "Gluetextbutton")
  • Added Set_Repeat_Button to change the button that is meant to repeat sound (this is only for the enable/disable handling!)
  • Changed default value of LeftMouseAllowed for Input Wait to false for now until i find a way to make clicks dont go through buttons
  • Added 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 to allowed oskey converts (function String2Key)
[REQUIRED]
UI\CustomUI.toc -> Loads the UI\Dialog\Dialog.fdf file
UI\Chat\Chat.fdf -> Defines the frames used by chat system
UI\Dialog\Dialog.fdf -> Defines the frames used by dialog system
UI\Dialog\Framework\Main.blp -> Defines the static dialog interface
UI\Dialog\Framework\Clock.blp -> Defines the clock at the top right
UI\Dialog\Framework\Dialog Arrow.blp -> Defines how the Input Wait Arrow look
UI\Dialog\Framework\Button 1-x_Default.blp -> Defines how the button 1-1, 1-2, 1-3, 1-4, 1-5 look
UI\Dialog\Framework\Button 1-x_Pushed.blp -> Defines how the button 1-1, 1-2, 1-3, 1-4, 1-5 look
UI\Dialog\Framework\Button 1-x_Disabled.blp -> Defines how the button 1-1, 1-2, 1-3, 1-4, 1-5 look
(1-x represents the numbers 1-1, 1-2, 1-3, 1-4, 1-5.)
UI\Dialog\Framework\Button 2_Default.blp -> Defines how the button 2-1, 2-2, 2-3, 2-4 look
UI\Dialog\Framework\Button 2_Pushed.blp -> Defines how the button 2-1, 2-2, 2-3, 2-4 look
UI\Dialog\Framework\Button 2_Disabled.blp -> Defines how the button 2-1, 2-2, 2-3, 2-4 look
UI\Dialog\Framework\Button 3_Default.blp -> Defines how the multiple choice buttons look
UI\Dialog\Framework\Button 3_Pushed.blp -> Defines how the multiple choice buttons look
UI\Dialog\Framework\Button 3_Disabled.blp -> Defines how the multiple choice buttons look
UI\Dialog\Framework\Text Input.blp -> Defines how the text input field look
UI\Font\NotoSans-Regular.ttf

[OPTIONAL]
UI\Dialog\Backgrounds\Default.blp -> The background used in test map dialog example [Source]
UI\Dialog\NPCs\Tutorial Girl.blp -> The sprite used by left-sided NPC in test map dialog example [Original Artist]
UI\Dialog\NPCs\SomeoneMoreInteresting.blp -> The sprite used by right-sided NPC in test map dialog example [Source]
UI\Dialog\Music\Default.mp3 -> The example music file used in test map dialog example [Source]


To start example dialog type 'Dialog' ingame.
JASS:
// Test Map functions

function Exit_Game takes nothing returns nothing

    call RemovePlayer(GetTriggerPlayer(), PLAYER_GAME_RESULT_NEUTRAL)
    if GetLocalPlayer() == GetTriggerPlayer() then
        call EndGame(true)
    endif

endfunction

function Auto_Play_Button takes nothing returns nothing
local integer pID = GetPlayerId(GetTriggerPlayer())
local boolean Auto_Play_Active = not Is_Auto_Play(pID)
local framehandle Auto_Skip_Frame = BlzGetFrameByName("Dialog Menu Button 1-2", 0)
local framehandle Repeat_Frame = BlzGetFrameByName("Dialog Menu Button 1-3", 0)
local string Repeat_Check = LoadStr(Hashtable, GetHandleId(Player(pID)), StringHash("Current Sound File"))
local framehandle Hide_UI_Frame = BlzGetFrameByName("Dialog Menu Button 1-5", 0)

    call Set_Auto_Play(GetPlayerId(GetTriggerPlayer()), Auto_Play_Active)
    if GetLocalPlayer() == Player(pID) then
        call BlzFrameSetEnable(Auto_Skip_Frame, not Auto_Play_Active)
        call BlzFrameSetEnable(Hide_UI_Frame, not Auto_Play_Active)
    endif
    if Auto_Play_Active then
        if GetLocalPlayer() == Player(pID) then
            call BlzFrameSetEnable(Repeat_Frame, not Auto_Play_Active)
        endif
    else
        if Repeat_Check != null and Repeat_Check != "" then
            if GetLocalPlayer() == Player(pID) then
                call BlzFrameSetEnable(Repeat_Frame, not Auto_Play_Active)
            endif
        endif
    endif

    set Auto_Skip_Frame = null
    set Repeat_Frame = null
    set Hide_UI_Frame = null

endfunction

function Auto_Skip_Button takes nothing returns nothing
local integer pID = GetPlayerId(GetTriggerPlayer())
local boolean Auto_Skip_Active = not Is_Auto_Skip(pID)
local framehandle Auto_Play_Frame = BlzGetFrameByName("Dialog Menu Button 1-1", 0)
local framehandle Repeat_Frame = BlzGetFrameByName("Dialog Menu Button 1-3", 0)
local string Repeat_Check = LoadStr(Hashtable, GetHandleId(Player(pID)), StringHash("Current Sound File"))
local framehandle Hide_UI_Frame = BlzGetFrameByName("Dialog Menu Button 1-5", 0)

    call Set_Auto_Skip(GetPlayerId(GetTriggerPlayer()), Auto_Skip_Active)
    if GetLocalPlayer() == Player(pID) then
        call BlzFrameSetEnable(Auto_Play_Frame, not Auto_Skip_Active)
        call BlzFrameSetEnable(Hide_UI_Frame, not Auto_Skip_Active)
    endif
    if Auto_Skip_Active then
        if GetLocalPlayer() == Player(pID) then
            call BlzFrameSetEnable(Repeat_Frame, not Auto_Skip_Active)
        endif
    else
        if Repeat_Check != null and Repeat_Check != "" then
            if GetLocalPlayer() == Player(pID) then
                call BlzFrameSetEnable(Repeat_Frame, not Auto_Skip_Active)
            endif
        endif
    endif

    set Auto_Play_Frame = null
    set Repeat_Frame = null
    set Hide_UI_Frame = null

endfunction

function Repeat_Current_Button takes nothing returns nothing

    call Repeat_Current(GetPlayerId(GetTriggerPlayer()))

endfunction

function Close_UI_Button takes nothing returns nothing

    call Change_Dialog_Box_State(GetPlayerId(GetTriggerPlayer()))

endfunction

function Dummy_Dialog takes nothing returns nothing
local integer pID = GetPlayerId(GetTriggerPlayer())

    call Initiate_Dialog(pID, "Intro")

endfunction

function Test_Map takes nothing returns nothing
local trigger t
local integer pID = 0

    // Choice_Add(id, content, isEnabled, followUp)
    call Choice_Add("ChoiceA", "I want to use the input button <#ff7f00>a<#>.", true, "inputA")
    call Choice_Add("ChoiceJ", "I want to use the input button <#ff7f00>j<#>.", false, "inputJ")
    call Choice_Add("ChoiceY", "I would like to keep it as it is.", true, "inputY")

    // Dialog_Add(id, dialog action)
    call Dialog_Add("Intro", "Save Variable latertw|3.5|true")
    call Dialog_Add("Intro", "Change InputK y")
    call Dialog_Add("Intro", "Add NPC Tutorial Girl|1|Left")
    call Dialog_Add("Intro", "Change Speaker <#add8e6>Tutorial Girl")
    call Dialog_Add("Intro", "Change Text Oh, hello there. Whats your name?")
    call Dialog_Add("Intro", "Text Input name")
    call Dialog_Add("Intro", "Change Text Nice to meet you <!name>, seems like you are interested in knowing how this system works, right?")
    call Dialog_Add("Intro", "Input Wait")
    call Dialog_Add("Intro", "Change Text Lets get a swap to a better looking place first.")
    call Dialog_Add("Intro", "Input Wait")
    call Dialog_Add("Intro", "Change Background Default")
    call Dialog_Add("Intro", "Change Text ...")
    call Dialog_Add("Intro", "Input Wait")
    call Dialog_Add("Intro", "Change Text How I did this you ask?")
    call Dialog_Add("Intro", "Input Wait")
    call Dialog_Add("Intro", "Change Text You simply do the action <#ff7f00>Change Background Default<#>, it switches the background to <#ff7f00>UI\\Dialog\\Backgrounds\\Default.blp<#>.")
    call Dialog_Add("Intro", "Input Wait")
    call Dialog_Add("Intro", "Change Text Its a bit quiet here, dont you think so? Lets get some sounds.")
    call Dialog_Add("Intro", "Input Wait")
    call Dialog_Add("Intro", "Change BGM Default")
    call Dialog_Add("Intro", "Change Text To do this I used <#ff7f00>Change BGM Default<#>, it switches the music to <#ff7f00>UI\\Music\\Default.blp<#>.")
    call Dialog_Add("Intro", "Input Wait")
    call Dialog_Add("Intro", "Change Text You gotta do this and that and that and there you go, you finished your stuff easily and fast.")
    call Dialog_Add("Intro", "Change Text Whoops, forgot to put a break there.\nUse <#ff7f00>Input Wait<#> to make the game wait for the current input key\n(Can be changed with <#ff7f00>Change InputK<#>)")
    call Dialog_Add("Intro", "Input Wait")
    call Dialog_Add("Intro", "Change Text Lets give it a try, choose any of the choice buttons, and i will switch the input button to your choice.")
    call Dialog_Add("Intro", "Save Variable entryspd|2.5")
    call Dialog_Add("Intro", "Multiple Choice ChoiceA|ChoiceJ|ChoiceY")

    call Dialog_Add("inputA", "Save Variable btn|a")
    call Dialog_Add("inputA", "Change Speaker <#add8e6>Tutorial Girl")
    call Dialog_Add("inputA", "Change Text You want me to change it to <#ff7f00><!btn><#>? Fine, there you go.")
    call Dialog_Add("inputA", "Change InputK <!btn>")
    call Dialog_Add("inputA", "Input Wait")
    call Dialog_Add("inputA", "Change Text Lets get someone else in this conversation, since you never answer it is getting quite monotone.")
    call Dialog_Add("inputA", "Input Wait")
    call Dialog_Add("inputA", "Change Text Add NPC SomeoneMoreInteresting")
    call Dialog_Add("inputA", "Add NPC SomeoneMoreInteresting|<!entryspd>|Right")
    call Dialog_Add("inputA", "Input Wait")
    call Dialog_Add("inputA", "Change Text Oh, did i say that out loud? Sorry, didnt meant it like that.")
    call Dialog_Add("inputA", "Input Wait")
    call Dialog_Add("inputA", "Change Speaker <#FFD700>Tasyen")
    call Dialog_Add("inputA", "Change Text huh?")
    call Dialog_Add("inputA", "Input Wait")
    call Dialog_Add("inputA", "Change Speaker <#add8e6>Tutorial Girl")
    call Dialog_Add("inputA", "Change Text Oh, ups. Wrong Person.")
    call Dialog_Add("inputA", "Input Wait")
    call Dialog_Add("inputA", "Remove NPC SomeoneMoreInteresting|<!entryspd>|Right")
    call Dialog_Add("inputA", "Change Text You can remove them any time again with <#ff7f00>Remove NPC<#>. In this case I used <#ff7f00>Remove NPC SomeoneMoreInteresting<#>.")
    call Dialog_Add("inputA", "Input Wait")
    call Dialog_Add("inputA", "Time Wait <?latertw>")
    call Dialog_Add("inputA", "Change Text You thought the system freezed? Dead wrong, I just decided to mimik you.\n(<#ff7f00>Time Wait <?latertw><#> waits <?latertw> real time seconds.)")
    call Dialog_Add("inputA", "Input Wait")
    call Dialog_Add("inputA", "Change Text Thats it for the tutorial, you never answer, and i have honestly better stuff to do. Goodbye.")
    call Dialog_Add("inputA", "Input Wait")
    call Dialog_Add("inputA", "Change Speaker  ")
    call Dialog_Add("inputA", "Remove NPC Tutorial Girl|1.5|Left")
    call Dialog_Add("inputA", "Choice State ChoiceJ|true")
    call Dialog_Add("inputA", "Choice State ChoiceA|false")
    call Dialog_Add("inputA", "Change Text Press <!btn> or left-click to end the dialog... (PS: This choice is now disabled, and choice 2 (j) is now enabled)")
    call Dialog_Add("inputA", "Input Wait")
    call Dialog_Add("inputA", "Stop BGM")

    call Dialog_Add("inputJ", "Save Variable btn|j")
    call Dialog_Add("inputJ", "Change Speaker <#add8e6>Tutorial Girl")
    call Dialog_Add("inputJ", "Change Text You want me to change it to <#ff7f00><!btn><#>? Fine, there you go.")
    call Dialog_Add("inputJ", "Change InputK <!btn>")
    call Dialog_Add("inputJ", "Input Wait")
    call Dialog_Add("inputJ", "Change Text Lets get someone else in this conversation, since you never answer it is getting quite monotone.")
    call Dialog_Add("inputJ", "Input Wait")
    call Dialog_Add("inputJ", "Change Text Add NPC SomeoneMoreInteresting")
    call Dialog_Add("inputJ", "Add NPC SomeoneMoreInteresting|<!entryspd>|Right")
    call Dialog_Add("inputJ", "Input Wait")
    call Dialog_Add("inputJ", "Change Text Oh, did i say that out loud? Sorry, didnt meant it like that.")
    call Dialog_Add("inputJ", "Input Wait")
    call Dialog_Add("inputJ", "Change Speaker <#FFD700>Tasyen")
    call Dialog_Add("inputJ", "Change Text huh?")
    call Dialog_Add("inputJ", "Input Wait")
    call Dialog_Add("inputJ", "Change Speaker <#add8e6>Tutorial Girl")
    call Dialog_Add("inputJ", "Change Text Oh, ups. Wrong Person.")
    call Dialog_Add("inputJ", "Input Wait")
    call Dialog_Add("inputJ", "Remove NPC SomeoneMoreInteresting|<!entryspd>|Right")
    call Dialog_Add("inputJ", "Change Text You can remove them any time again with <#ff7f00>Remove NPC<#>. In this case I used <#ff7f00>Remove NPC SomeoneMoreInteresting<#>.")
    call Dialog_Add("inputJ", "Input Wait")
    call Dialog_Add("inputJ", "Time Wait <?latertw>")
    call Dialog_Add("inputJ", "Change Text You thought the system freezed? Dead wrong, I just decided to mimik you.\n(<#ff7f00>Time Wait <?latertw><#> waits <?latertw> real time seconds.)")
    call Dialog_Add("inputJ", "Input Wait")
    call Dialog_Add("inputJ", "Change Text Thats it for the tutorial, you never answer, and i have honestly better stuff to do. Goodbye.")
    call Dialog_Add("inputJ", "Input Wait")
    call Dialog_Add("inputJ", "Change Speaker  ")
    call Dialog_Add("inputJ", "Remove NPC Tutorial Girl|1.5|Left")
    call Dialog_Add("inputJ", "Change Text Press <!btn> or left-click to end the dialog...")
    call Dialog_Add("inputJ", "Input Wait")
    call Dialog_Add("inputJ", "Stop BGM")

    call Dialog_Add("inputY", "Save Variable btn|y")
    call Dialog_Add("inputY", "Save Variable btn2|c")
    call Dialog_Add("inputY", "Save Variable spd|5.0")
    call Dialog_Add("inputY", "Change Speaker <#add8e6>Tutorial Girl")
    call Dialog_Add("inputY", "Change SkipK <!btn2>")
    call Dialog_Add("inputY", "Change SkipS <!spd>")
    call Dialog_Add("inputY", "Change Text You want me to keep <#ff7f00><!btn><#>? Fine.\n(Skip Button was changed to <#ff7f00><!btn2><#> and Skip Speed was changed to <#ff7f00><!spd><#> for test purpose)")
    call Dialog_Add("inputY", "Input Wait")
    call Dialog_Add("inputY", "Change Text Lets get someone else in this conversation, since you never answer it is getting quite monotone.")
    call Dialog_Add("inputY", "Input Wait")
    call Dialog_Add("inputY", "Change Text Add NPC SomeoneMoreInteresting")
    call Dialog_Add("inputY", "Add NPC SomeoneMoreInteresting|<!entryspd>|Right")
    call Dialog_Add("inputY", "Input Wait")
    call Dialog_Add("inputY", "Change Text Oh, did i say that out loud? Sorry, didnt meant it like that.")
    call Dialog_Add("inputY", "Input Wait")
    call Dialog_Add("inputY", "Change Speaker <#FFD700>Tasyen")
    call Dialog_Add("inputY", "Change Text huh?")
    call Dialog_Add("inputY", "Input Wait")
    call Dialog_Add("inputY", "Change Speaker <#add8e6>Tutorial Girl")
    call Dialog_Add("inputY", "Change Text Oh, ups. Wrong Person.")
    call Dialog_Add("inputY", "Input Wait")
    call Dialog_Add("inputY", "Remove NPC SomeoneMoreInteresting|<!entryspd>|Right")
    call Dialog_Add("inputY", "Change Text You can remove them any time again with <#ff7f00>Remove NPC<#>. In this case I used <#ff7f00>Remove NPC SomeoneMoreInteresting<#>.")
    call Dialog_Add("inputY", "Input Wait")
    call Dialog_Add("inputY", "Time Wait <?latertw>")
    call Dialog_Add("inputY", "Change Text You thought the system freezed? Dead wrong, I just decided to mimik you.\n(<#ff7f00>Time Wait <?latertw><#> waits <?latertw> real time seconds.)")
    call Dialog_Add("inputY", "Input Wait")
    call Dialog_Add("inputY", "Change Text Thats it for the tutorial, you never answer, and i have honestly better stuff to do. Goodbye.")
    call Dialog_Add("inputY", "Input Wait")
    call Dialog_Add("inputY", "Change Speaker  ")
    call Dialog_Add("inputY", "Remove NPC Tutorial Girl|1.5|Left")
    call Dialog_Add("inputY", "Change Text Press <!btn> or left-click to end the dialog...")
    //call Dialog_Add("inputY", "Change Text <.ptime>, <.gtime>, <.ikey>, <.skey>, <.sspd>, <.gspd>, <.tspd>, <.choice>, <.background>, <.music>, <.aspd>") // can be used if you wanna check the default values.
    call Dialog_Add("inputY", "Input Wait")
    call Dialog_Add("inputY", "Stop BGM")

    

    // Test Map Trigger for the dummy dialog
    loop
        exitwhen pID > 23
            // Dialog System Related
            if GetPlayerController(Player(pID)) == MAP_CONTROL_USER then
                set t = CreateTrigger()
                call TriggerRegisterPlayerChatEvent(t, Player(pID), "Dialog", true)
                call TriggerAddAction(t, function Dummy_Dialog)
                set t = null
            endif
            // Chat System Related
            if GetPlayerName(Player(pID)) == "Zoson" then
                call Set_Chat_Color(pID, "c1f9a2")
            endif
        set pID = pID + 1
    endloop

endfunction

// Use Dialog_Remove("test", Slot) to remove a dialog action from dialog "test" (-> moves all others with bigger slot number down by one slot number) [-> Dialog Slot is returned by Dialog_Add]

Explain_1.png
Explain_2.png


If you have any problems or questions related to this system,
feel free to ask me on discord under the name Niklas#0786.

*If you're an artist and don't want your content to be used, please contact me and I will remove it.



Contents

Dialog System v2.1.0 (Map)

Level 6
Joined
Apr 30, 2017
Messages
17
It is awesome to have this feature in Warcraft III.

I think this could be improved by adding Back, History, Skip, and Auto features. It is not really necessary but it will make this system better than the one Warcraft III provides.

Thanks for your feedback, will consider adding those features in future updates.
 
Please separate the test map function and the core code function into at least two separate triggers (at least the demo function should be in a trigger). The current setup will make newbies paste the test code by accident.

This is some interesting stuff though, pretty sure Tasyen would be interested to have a look into this UI usage.
 
Level 6
Joined
Apr 30, 2017
Messages
17
Please separate the test map function and the core code function into at least two separate triggers (at least the demo function should be in a trigger). The current setup will make newbies paste the test code by accident.

This is some interesting stuff though, pretty sure Tasyen would be interested to have a look into this UI usage.

Thanks for the info, will do that in the next version~
 
Level 6
Joined
Apr 30, 2017
Messages
17
Attached the photoshop file for the updated UI to simplify edits.
(Disclaimer: The UI was not made in photoshop, so it is possible that there's some stuff wrong in the .psd file)
 

Attachments

  • UI Photoshop.psd
    710.8 KB · Views: 270
Its a day we've all been waiting for! Finally the tga porn pictures in some loaps can be preluded with captivating dialogue.

Watch out for the map reviewers who'd check these kinds of maps though. On a side note, definitely a nice way to hide your stash of passionate-hugging.

Will attach a review later.
 
Level 6
Joined
Apr 30, 2017
Messages
17
While fixing bugs i decided to directly make a halloween themed dialog + ui for the system, hoping that this give a better understand how the system works.
Attached you find the photoshop file of it.
(Disclaimer: The UI was not made in photoshop, so it is possible that there's some stuff wrong in the .psd file)
 

Attachments

  • UI (Halloween).psd
    13.9 MB · Views: 279
Level 6
Joined
Apr 30, 2017
Messages
17
As always before, attached you find the photoshop file that can be used to easily change parts of the user interface.
(Disclaimer: The UI was not made in photoshop, so it is possible that there's some stuff wrong in the .psd file)
 

Attachments

  • 32722578.psd
    12.9 MB · Views: 295
Added "Requires version 1,31 or newer." beforehand. Also fixed up the table in System API. Spelling errors are presumably fixed.

Now for the actual review,

Hmm .. the way the Dialog System runs feels like you're playing an entirely different game. With a little bit of refinement on
the user's end, the illusion of playing another game is definitely well kept intact. Nicely done!

I haven't really gone in-depth with this one as I should've, but here are some, if not one, points to address:
  • Function Name Declaration: Although the casing of the function names themselves are quirky as they are, some of these function names are kind of generic. This may run the risk of name collisions, though the quirkiness of the function names will definitely reduce the chances of this occurring.

  • Encapsulation: I think this system would benefit from enclosure within a library, but it is not an urgent suggestion in this case.
 
Top