I know...Very vague...hopefully this will clarify:
If anyone has seen the Final Fantasy Starcraft 2 Mod map (could probably youtube it)...I am doing something similar to that (except I am using the mouse). I created a dialog box... a few dialog boxes actually... and when one of the boxes is clicked, lets say the attack button, I want to click a unit to attack.
Lets say I have Unit 1 as my hero and I click attack...then click Unit 2, which is the enemy. I want Unit 1 to rush up and attack Unit 2, then run back. I have the boxes created but am having a hard time figuring out how to get the cursor to change to a cross hair once the attack dialog box is clicked, and how the triggers distinguish whether I click the attack dialog or one of the other ones. ;/
Well as for how to change the cursor I dont know how you would do that.
BUT as for finding which dialog is clicked I do know.
When you create a dialog or a dialog item, you can then assign it to a dialog variable or a dialog item variable.
Then in a trigger you can test to see what dialog is being interacted with.
An Example: Here I create a "Dialog Item" it says dropbox but its accually a list (still have not changed the name since I changed it to a ListBox not Dropbox hehe) for a Dialog I have already created and set to the Dialog:Hero Selection Dialog[0]
Then I store this ListBox in the "Dialog:Item:Hero Selection:Dropbox" which is an array, so I set it to the first element in that array 0. The rest of that trigger adds a few list items to it each new item I add to the next element 1, 2, 3 etc in the array of items. Then later I can place a condition in a trigger to check if the dialog item being click, dbl click, or what ever is the same item.
Lol...I am having some flashbacks working with java back when I was a computer science major. This logic always made my head explode.
I am still messing with this thing... I assume you made the variables beforehand? Or maybe that code (above the if/then lines) is a giant variable? Forgive me for being a bit slow...I'm one of those guys who usually doesn't learn jack unless he gets to play with it first hand....both good and bad. :P
Regardless, thanks for your help! I'm off to a fun start with this thing.
EDIT: I was looking at the code wrong...lol. I think I figured out what you posted.
Lets say I have Unit 1 as my hero and I click attack...then click Unit 2, which is the enemy. I want Unit 1 to rush up and attack Unit 2, then run back. I have the boxes created but am having a hard time figuring out how to get the cursor to change to a cross hair once the attack dialog box is clicked, and how the triggers distinguish whether I click the attack dialog or one of the other ones. ;/
Dunno if this is purely obvious now but do something like this.
1 trigger for button clicking
Eventsdialog_btn_attackisclickedactionssetgv_attack?=truesendmessage"Click something to attack"
Now there might be a way you can add to the "btn_attack" actions that flashes your cursor or high lights it a different color to simulate a target is needed.
I know...Very vague...hopefully this will clarify:
If anyone has seen the Final Fantasy Starcraft 2 Mod map (could probably youtube it)...I am doing something similar to that (except I am using the mouse). I created a dialog box... a few dialog boxes actually... and when one of the boxes is clicked, lets say the attack button, I want to click a unit to attack.
Lets say I have Unit 1 as my hero and I click attack...then click Unit 2, which is the enemy. I want Unit 1 to rush up and attack Unit 2, then run back. I have the boxes created but am having a hard time figuring out how to get the cursor to change to a cross hair once the attack dialog box is clicked, and how the triggers distinguish whether I click the attack dialog or one of the other ones. ;/
Any help is greatly appreciated.
Well as for how to change the cursor I dont know how you would do that.
BUT as for finding which dialog is clicked I do know.
When you create a dialog or a dialog item, you can then assign it to a dialog variable or a dialog item variable.
Then in a trigger you can test to see what dialog is being interacted with.
An Example: Here I create a "Dialog Item" it says dropbox but its accually a list (still have not changed the name since I changed it to a ListBox not Dropbox hehe) for a Dialog I have already created and set to the Dialog:Hero Selection Dialog[0]
Then I store this ListBox in the "Dialog:Item:Hero Selection:Dropbox" which is an array, so I set it to the first element in that array 0. The rest of that trigger adds a few list items to it each new item I add to the next element 1, 2, 3 etc in the array of items. Then later I can place a condition in a trigger to check if the dialog item being click, dbl click, or what ever is the same item.
But how do I know what is selected in the list box you might wonder, well
So if HeroIndex = 4 and the Selected list item is 4 then I know what item was selected. The first List Item being at an index of 1 :)
Hope this helps some .... if not sorry to have taken ur time :)
Lol...I am having some flashbacks working with java back when I was a computer science major. This logic always made my head explode.
I am still messing with this thing... I assume you made the variables beforehand? Or maybe that code (above the if/then lines) is a giant variable? Forgive me for being a bit slow...I'm one of those guys who usually doesn't learn jack unless he gets to play with it first hand....both good and bad. :P
Regardless, thanks for your help! I'm off to a fun start with this thing.
EDIT: I was looking at the code wrong...lol. I think I figured out what you posted.
EDIT #2: Yeah I did. Lol. Thanks again!
Dunno if this is purely obvious now but do something like this. 1 trigger for button clicking
1 trigger for selecting unit
Now there might be a way you can add to the "btn_attack" actions that flashes your cursor or high lights it a different color to simulate a target is needed.