I've hit a bit of a boggle. I've created a dialog window, with a pull down dialog item. What I'm trying to achieve is to check and see whats been selected in the pull down, and bring up dialog window that corresponds with it.
For instances I have a shop with two categories: Weapons, Armor. Both of these are selectable from the Pulldown menu. I have two items (a sword, and a shield). How do I have the editor check to see which category is selected in the pulldown?
Events
Dialog - Any Dialog Item is Changed Selection by Player Any Player
Local Variables
Conditions
(Selected list item of (Used dialog item) for (Picked player)) == 2
Actions
Dialog - Select item 3 of (Last created dialog item) for (Player group((Picked player))) <--May not be needed!
Trigger - Run Trigger (Check Conditions, Don't Wait until it finishes) <-- Tell this to bring up your dialog
See if that event/condition does the trick, then organize it how you want.
when you make the box you can do a pick integer loop to populate it.
NOW, when you want to check it use the (Integer) term "Selected List Item". This will return an integer depending on which list item is active. Subtract 1 if you are converting to text (due to arrays starting at 0 and list indexes starting at 1) and voila!
Example:
Event: Dialog - Any Dialog Item is used by {player number here} with even type Changed Selection
Action: Debug - Display list_item[((Selected list item of {listbox name here} for {player number here}) - 1)] as debug output using Type 1, and Do display it in the game window
/endEx
if you created you pulldown with the variables initialized in your map initialization trigger, then when the box is changed to Entry 3, the debug will output "Entry 3".
From here out, only use the variable when you want to display the name. In comparing or deciding if something should be done based on the active entry, stick with the selected list item index.
this may have been a bit here and there. For any help or explanation, click my name and send an email.
I've hit a bit of a boggle. I've created a dialog window, with a pull down dialog item. What I'm trying to achieve is to check and see whats been selected in the pull down, and bring up dialog window that corresponds with it.
For instances I have a shop with two categories: Weapons, Armor. Both of these are selectable from the Pulldown menu. I have two items (a sword, and a shield). How do I have the editor check to see which category is selected in the pulldown?
Maybe try:
Events
Dialog - Any Dialog Item is Changed Selection by Player Any Player
Local Variables
Conditions
(Selected list item of (Used dialog item) for (Picked player)) == 2
Actions
Dialog - Select item 3 of (Last created dialog item) for (Player group((Picked player))) <--May not be needed!
Trigger - Run Trigger (Check Conditions, Don't Wait until it finishes) <-- Tell this to bring up your dialog
See if that event/condition does the trick, then organize it how you want.
Instead of one trigger per selection, I'd get rid of the condition and instead use a switch statement. Then you can put everything into one trigger.
Easiest way is to have a text array variable.
list_items[0] = "Entry 1"
list_items[1] = "Entry 2"
list_items[2] = "Entry 3"
list_items[3] = "Entry 4"
list_items[4] = "Entry 5"
when you make the box you can do a pick integer loop to populate it.
NOW, when you want to check it use the (Integer) term "Selected List Item". This will return an integer depending on which list item is active. Subtract 1 if you are converting to text (due to arrays starting at 0 and list indexes starting at 1) and voila!
Example:
Event: Dialog - Any Dialog Item is used by {player number here} with even type Changed Selection
Action: Debug - Display list_item[((Selected list item of {listbox name here} for {player number here}) - 1)] as debug output using Type 1, and Do display it in the game window
/endEx
if you created you pulldown with the variables initialized in your map initialization trigger, then when the box is changed to Entry 3, the debug will output "Entry 3".
From here out, only use the variable when you want to display the name. In comparing or deciding if something should be done based on the active entry, stick with the selected list item index.
this may have been a bit here and there. For any help or explanation, click my name and send an email.