HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Need Help with "Race selection" system/trigger

04-05-2007, 04:52 AM#1
The Curse
Ive been trying to make a map with 4 races for players to choose from, and tried different methods to make a "selection system."

Well let me just state this right away, I am fairly new at triggers, and an utter newb with JASS. But I can manage to utilize JASS by, erm, not sure...turn trigger to pure text option? Or just try to dig up some old tutorials on this forum.

First I tried using dialogs and set each dialog variable to appropriate players so that every time a specific one is clicked the game will know who did it.

Something like this:
Trigger:
-set dialogbutton[1] = Player 1 select race 1
Collapse -show player 1 dialogbutton[1]
-if dialogbutton[1] is clicked then do etc. for triggering player
-set dialogbutton[2] = Player 2 select race 1
-show player 2 dialogbutton[2]
-if dialogbutton[2] is clicked then do etc. to triggering player

Which, unfortunately, when I grab a second comp and test it...the dialog only pops up for Player 1. Could it be an error that I missed due to rush? I think it isn't because I looked it over several times... Or is it something I wrote that the game couldnt understand? Can somebody redo this kinda trigger in a similiar fashion and tell me why it possibly didnt work?

After the dialog failure I tried doing it the classic way: Human Orc Undead Night Elf auto-selection at start. Via something like this:

Trigger:
If all conditions are true then do
If:
-player 1's race = Human
Then:
-Create [unit's name here] at [region]
Else:
-Do nothing

That seems to work perfectly well. The downside of having to painstakingly do it for every player, repeating 4 times each (since I have 4 races for them to choose from), I can easily put up with. However, this makes it unoriginal...since my races arent necessarily the one that Blizzard made.

Ex: My races = Aliens
Blizzard's = erm...

Can anybody help me devise a new system that will work for race selection? I apologize if someone already made a topic about this =/ but im not an excavation machine. Thanks if you do.

Note that the trigger system thing that this forum has doesnt really express what I tried to say =/ but im not a data storage facility either so its not accurate.
04-05-2007, 06:09 AM#2
BoNe
Ok theres 2 triggers that should work, reply if they don't work.

Trigger:
Show Builder Dialogs
Collapse Events
Time - Elapsed game time is 0.00 seconds
Conditions
Collapse Actions
Dialog - Clear Dialog_RaceSelect
Dialog - Create a dialog button for Dialog_RaceSelect labelled Aliens
Set DialogButton_Aliens = (Last created dialog Button)
Wait 0.01 seconds
Dialog - Create a dialog button for Dialog_RaceSelect labelled Blah
Set DialogButton_Blah1 = (Last created dialog Button)
Wait 0.01 seconds
Player Group - Pick every player in (All Players)) and do (Dialog - Show Dialog_BuilderSelect for (Picked player))

Trigger:
Choose Race Dialogs
Collapse Events
Dialog - A dialog button is clicked for Dialog_RaceSelect
Conditions
Collapse Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Clicked dialog button) Equal to DialogButton_Aliens
Collapse Then - Actions
Game - Display to (All Players)) the text: ((Name of (Triggering player)) + has chosen a Alien builder!)
Unit - Create 1 Alien for (Triggering player) at (Center of Blah <gen>) facing Default building facing degrees
Collapse Else - Actions
Dialog - Hide Dialog_RaceSelect for (Triggering player)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Clicked dialog button) Equal to DialogButton_Blah1
Collapse Then - Actions
Game - Display to (All Players)) the text: ((Name of (Triggering player)) + has chosen a Blah1 builder!)
Unit - Create 1 Blah1 for (Triggering player) at (Center of Blah <gen>) facing Default building facing degrees
Collapse Else - Actions
Dialog - Hide Dialog_RaceSelect for (Triggering player)

Hope that helps.
04-06-2007, 01:21 AM#3
The Curse
The editor doesnt seem to be understanding the "triggering player" function as observed:

Trigger:
Dialog_RaceSelect
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Clicked dialog button) Equal to DialogButton_Blah1
Then - Actions
Game - Display to (All Players)) the text: ((Name of (Triggering player)) + has chosen Aliens!)
Unit - Create 1 Alien for (Triggering player) at (Center of AlienStartingLocation <gen>) facing Default building facing degrees
Else: Dialog - Hide Dialog_RaceSelect for (Triggering player)

the text in-game only pops up as has chosen Aliens!, clearly it doesnt understand the function "triggering player."

The units werent created for the "triggering player" either.

Also are there any ways to make this work for a multiplayer map? The triggers you showed only work with single-player i think.

GUI is a pain i think i'd start trying to learn JASS but pure text generally confuses me... =/ i heard its easier though.

Thanks for your help.
04-06-2007, 03:13 AM#4
BoNe
It should work. If you want post your map here and i'll fix it for you.