HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Dialog Player

07-13-2004, 12:22 AM#1
RedDragonsSon
ok yall here is my prob and any help would be greatly appreciated... thanks!

i made a dialog appear that has 2 choices, yes and no. i want to make it so that when a certain player clicks the dialog yes it will move a certain unit but when a different player clicks yes i want it to move a different unit.

i dont want to make more than 1 dialog variable cause i got enough as it is...
ne ideas?
07-13-2004, 12:58 AM#2
johnfn
You have to save each button of the dialog to a variable. Then you have to have an event detecting when a button is pressed, and then a condition to check which one (button) it was. Then just do you action accordingly.

Should work.
07-13-2004, 01:20 AM#3
RedDragonsSon
ya man... i know all that but how do i make it check which player clicked the button?
07-13-2004, 03:54 AM#4
Panto
Although it didn't used to, I think that "Triggering Player" can be used to get the one who clicked the button. I assume you know how to move to different units depending on which player triggered it.
07-13-2004, 05:48 AM#5
BlueSpine
Too bad, you have to have two variables. Deal with it.

Create a Dialog Variable called MainDialog.
Create a Dialog Button Variable (Array) called DialogButton(2)

Trigger One: Creating the Dialog
Code:
Events: 
	Your Input
	[color=Lime]If possible make it it a Unit - Enters Region Event, allowing a selection of the player in the Actions.[/color]
Conditions: 
	Your Input
Actions:
	
	Dialog - Clear MainDialog [color=Lime]This is only required if this Dialog will appear more than once.[/color]
	Dialog - Change the title of MainDialog to "Your Input"
	Dialog - Create a dialog button for MainDialog labelled Yes
	Set DialogButton(1) = (Last created dialog Button)
	Dialog - Create a dialog button for MainDialog labelled No
	Set DialogButton(2) = (Last created dialog Button)			
	Dialog - Show MainDialog for (Owner of (Entering Unit))
Now say when Player 1 (Red) presses Yes, the trigger must be as follows:

Code:
Events:
	Dialog - A dialog button is clicked for MainDialog
Conditions:
	(Clicked dialog button) Equal to Yes
	:::Player Comparsion::: (Triggering player) Equal to Player 1 (Red)
Actions:
	Your move Actions.

Create copies of the second trigger for every other player.

Tada.
07-13-2004, 05:52 AM#6
Panto
Alternatively, you could assign units to a unit array indexed by player number, and have only one second trigger.