I'm workin om my RPG (My Rpg don't realy have a name for it yet) and I have a question.
I've just started working with the SC2 Editor done some triggering and data editing and seems to go all fine...
But I was wondering what the best way is to make a Dialog and use it over and over again but then with other buttons.
Little Example:
"If you click on quest giver 1 the Quest dialog will show with buttons 1-3.
When you click on quest giver 2 the same Quest dialog will show but then with buttons 4-6."
What is the best way to make that happen with the least lag, because there are gonna be several quest givers around and I will have to make loads of dialogs. I've seen some things with records but I don't know if that is the solution.
There are two key variable types for this: Dialog and Dialog Item
The Dialog is the container and you can store 1 dialog in a variable and show it to or hide it from specific players. You don't need a Dialog for each player.
Dialog Items are the elements within the dialog, e.g. buttons and images. You can make an array for this or you can simply make variables for each dialog item, depending on what you're comforable with and what you need.
In your case you will need to collapse or expand the space between buttons, depending on the number of buttons (options) you want to be shown. There's a condition to check whether a specific Dialog Item is enabled or disabled.
If the dialog is likely to be used or definately will be used, you should create it on map initialization and then show/hide it as needed for the desired players. Otherwise you may wait with doing so until (or if) it is needed.
I kinda already know this, but is using a Dialog Item Variable the only way to put more than 50 buttons in one dialog shown 1 by one? Or are there better ways to save buttons at the start of the game and use them for later?
There are no methods for fetching the contents of a dialog, except for list items. Ergo, you have to use global variables for the Dialog Items.
I don't understand what you mean by "shown 1 by one"?
You should create the dialog items, store them in global variables and hide them all. When, for instance, your unit interacts with an NPC, you show the buttons and other dialog elements you need (one by one) for the specific player or players.
I assume this is what you are asking for.. Correct me if I'm wrong.
Store all your quest information in records. You can get away with just using 1 dialog and 3 buttons.
Your stuct records should have the following:
Unit (This is your quest giver)
Quest ID array with X values where X is the maximum number of quests any quest giver can give. (In your case it looks like its 3.)
Each quest ID would be linked to a struct that contains all your quest information:
Quest name, Quest description and so on.
Bind each of your quest givers to a struct (structs and records are the same, struct is the proper name).
Each struct entry corresponds to 1 quest giver. So if you click on the first one, it will search all your available structs for the one that has your quest giver stored inside.
This is what your trigger should do.
Event: Quest giver clicked.
Actions: Search for the struct that has that particular quest giver stored inside, return the index of that struct.
Use the struct index to callback the Quest ID's for that quest giver, then apply all the images and stuff to your dialog items to reflect the quests that should be shown for that particular quest giver.
This should be done on a player by player basis. Only change buttons for the EventPlayer(). So that it works differently for all the players.
I'm workin om my RPG (My Rpg don't realy have a name for it yet) and I have a question. I've just started working with the SC2 Editor done some triggering and data editing and seems to go all fine... But I was wondering what the best way is to make a Dialog and use it over and over again but then with other buttons.
Little Example:
"If you click on quest giver 1 the Quest dialog will show with buttons 1-3.
When you click on quest giver 2 the same Quest dialog will show but then with buttons 4-6."
What is the best way to make that happen with the least lag, because there are gonna be several quest givers around and I will have to make loads of dialogs. I've seen some things with records but I don't know if that is the solution.
Thanks in Advance =3
@patrickwobben: Go
There are two key variable types for this: Dialog and Dialog Item
The Dialog is the container and you can store 1 dialog in a variable and show it to or hide it from specific players. You don't need a Dialog for each player.
Dialog Items are the elements within the dialog, e.g. buttons and images. You can make an array for this or you can simply make variables for each dialog item, depending on what you're comforable with and what you need.
In your case you will need to collapse or expand the space between buttons, depending on the number of buttons (options) you want to be shown. There's a condition to check whether a specific Dialog Item is enabled or disabled.
If the dialog is likely to be used or definately will be used, you should create it on map initialization and then show/hide it as needed for the desired players. Otherwise you may wait with doing so until (or if) it is needed.
Dialog Designer: http://forums.sc2mapster.com/resources/project-workplace/14457-dialog-designer-beta-3/
Dialog Basics Tutorial: http://forums.sc2mapster.com/resources/tutorials/17969-dialogs-really-great-looking-dialogs-part-1/
The search bar is an awesome feature! ;)
I kinda already know this, but is using a Dialog Item Variable the only way to put more than 50 buttons in one dialog shown 1 by one? Or are there better ways to save buttons at the start of the game and use them for later?
P.S. The Dialog Designer link seeems interesting
@patrickwobben: Go
There are no methods for fetching the contents of a dialog, except for list items. Ergo, you have to use global variables for the Dialog Items.
I don't understand what you mean by "shown 1 by one"?
You should create the dialog items, store them in global variables and hide them all. When, for instance, your unit interacts with an NPC, you show the buttons and other dialog elements you need (one by one) for the specific player or players.
@patrickwobben: Go
I assume this is what you are asking for.. Correct me if I'm wrong.
Store all your quest information in records. You can get away with just using 1 dialog and 3 buttons.
Your stuct records should have the following:
Each quest ID would be linked to a struct that contains all your quest information:
Bind each of your quest givers to a struct (structs and records are the same, struct is the proper name).
Each struct entry corresponds to 1 quest giver. So if you click on the first one, it will search all your available structs for the one that has your quest giver stored inside.
This is what your trigger should do.
Use the struct index to callback the Quest ID's for that quest giver, then apply all the images and stuff to your dialog items to reflect the quests that should be shown for that particular quest giver.
This should be done on a player by player basis. Only change buttons for the EventPlayer(). So that it works differently for all the players.
Yeh that's kinda what I'm looking for. That u don't have to use more than 3-5 buttons. I think I have to take look further into that.
Thx FuzzYD and Kafoso for the tips =3
@patrickwobben: Go
Welcome :) Happy to help.