Hi. I've recently learned to create dialogs and dialog items. I created a dialog button that spawns 4 Zealots when clicked, and destroys the dialog. Now I've been trying to create multiple buttons for that dialog, such as one that spawns 3 Stalkers when clicked, and destroying the dialog as well.
The problem is that when I try to test the map, both buttons spawn the stalker and the zealot, instead of just one, and it shows this error:
Scri: Trigger Error in 'gt_ZealotSpawn1_Func': Could not get 'triggerControl' from parameter in 'DialogControlGetDialog' (value:2)? Near line 113 in gt_ZealotSpawn1_Func() in MapScript.galaxy
First make sure that Variable A is of type Dialog Item. Then, when setting it, look in the functions section, and you will find Last Created Dialog Item.
Dialog Item Used is a trigger event. Create a new trigger, and go to the section that looks like a red flag. Add a new event, and find Dialog Item Used. The act ions in the trigger will only be run when that event occurs, and Used Dialog Item will give you the dialog item that triggered the event.
Unit - Create 3 Stalker for player 1 at Point 001 using default facing (No Options)
When I tested the map I was able to create Zealots, but when I tried to create Stalkers, it still made Zealots.
EDIT 2: After I changed Variable A and B to Dialog Item, both buttons create 4 Zealots and 3 Stalkers again...
EDIT 3: I got it to work after finding
General - If (Conditions) then do (Actions) else do (Actions)
I suppose I am bad at finding things...
Thanks for everyone's help!
Hi. I've recently learned to create dialogs and dialog items. I created a dialog button that spawns 4 Zealots when clicked, and destroys the dialog. Now I've been trying to create multiple buttons for that dialog, such as one that spawns 3 Stalkers when clicked, and destroying the dialog as well. The problem is that when I try to test the map, both buttons spawn the stalker and the zealot, instead of just one, and it shows this error:
Scri: Trigger Error in 'gt_ZealotSpawn1_Func': Could not get 'triggerControl' from parameter in 'DialogControlGetDialog' (value:2)? Near line 113 in gt_ZealotSpawn1_Func() in MapScript.galaxy
Can anyone help me with this?
u have to make a global variable and set it to each button when u create the dialog
in your "when dialog item used" trigger can compare dialog item used to the variable, if they match u know thats the button that was clicked.
since im not being lazy anymore heres the example code:
half of this should look familar, this is what ur dialog creator should look like
this is what ur dialog item used should have
How do I find "(Last created dialog item)" in the Set Variable A = ?
And what is "dialog item used" and how do I find it?
Sorry if I seem extremely bad at using the map editor.
@PaperRemote: Go
First make sure that Variable A is of type Dialog Item. Then, when setting it, look in the functions section, and you will find Last Created Dialog Item.
Dialog Item Used is a trigger event. Create a new trigger, and go to the section that looks like a red flag. Add a new event, and find Dialog Item Used. The act ions in the trigger will only be run when that event occurs, and Used Dialog Item will give you the dialog item that triggered the event.
What conditions and actions am I supposed to put in the Dialog Item Used trigger?
EDIT: I realized that I already had 2 of those triggers and didn't notice it...
In Conditions I put:
Within Bounds - 0 <= 1 <= 1
In Actions I put:
Dialog - Destroy (Dialog containing (Used dialog item))
Unit - Create 4 Zealot for player 1 at Point 001 using default facing (No Options)
And the other one was:
Conditions:
2 <= 3 <= 3
Actions:
Dialog - Destroy (Dialog containing (Used dialog item))
Unit - Create 3 Stalker for player 1 at Point 001 using default facing (No Options)
When I tested the map I was able to create Zealots, but when I tried to create Stalkers, it still made Zealots.
EDIT 2: After I changed Variable A and B to Dialog Item, both buttons create 4 Zealots and 3 Stalkers again...
EDIT 3: I got it to work after finding General - If (Conditions) then do (Actions) else do (Actions) I suppose I am bad at finding things... Thanks for everyone's help!
ya u are hahaha, but u will never have an issue finding those particular things again. took me awhile my first time also
your conditions are abit weird, i suggest using the ones ive provided at some point. but if it works lets not poke it and break.
@SoulTaker916: Go
I changed the condition to used Dialog Item == Viariable A
So it should be easier now ^^