Saturday, April 14, 2012

I need help with a trigger issue!

[:1]Hello! Here is my problem: I am new to mapmaking, but I want to create a map in which a two sets of dialog boxes appear. First option will ask you the type of worker you want: Option 1 and Option 1. Then, a second dialog box appears and asks you to choose 1 from 8 races. Now, my problem is this: I don't know how to create the triggers in such a way that when you choose for example Option 1 and Tauren as race, to ONLY get Option 1 worker of that race. Instead, I get both workers from the same race and I don't want that. I don't know if this makes sense but here are my triggers.

TRIGGERS:

Attacker Worker North

Events

Dialog - A dialog button is clicked for Dialog_box

Conditions

(Clicked dialog button) Equal to Dialog_buttons[1]

Actions

If (All Conditions are True) then do (Then Actions) else do (Else Actions)

If - Conditions

(Clicked dialog button) Equal to Dialog_buttons[1]

Then - Actions

Trigger - Run Race Selection of Attack Worker North <gen> (checking conditions)

Trigger - Remove Defense Worker North <gen> from the trigger queue

Trigger - Remove Race Selection of Defense Worker North <gen> from the trigger queue

Else - Actions



Race Selection of Attack Worker North

Events

Dialog - A dialog button is clicked for Race_Dialogue_Box

Conditions

Actions

For each (Integer A) from 1 to 8, do (Actions)

Loop - Actions

If (All Conditions are True) then do (Then Actions) else do (Else Actions)

If - Conditions

(Clicked dialog button) Equal to Race_Dialogue_Buttons[(Integer A)]

((Triggering player) is an ally of Player 1 (Red)) Equal to True

Then - Actions

Unit - Create 1 Attack_Workers[(Integer A)] for (Triggering player) at (Center of North Side Starting Region <gen>) facing 90.00 degrees

Selection - Select (Last created unit) for (Triggering player)

Else - Actions



Defense Worker North

Events

Dialog - A dialog button is clicked for Dialog_box

Conditions

(Clicked dialog button) Equal to Dialog_buttons[2]

Actions

If (All Conditions are True) then do (Then Actions) else do (Else Actions)

If - Conditions

(Clicked dialog button) Equal to Dialog_buttons[2]

Then - Actions

Trigger - Run Race Selection of Defense Worker North <gen> (checking conditions)

Trigger - Remove Attacker Worker North <gen> from the trigger queue

Trigger - Remove Race Selection of Attack Worker North <gen> from the trigger queue

Else - Actions



Race Selection of Defense Worker North

Events

Dialog - A dialog button is clicked for Race_Dialogue_Box

Conditions

Actions

For each (Integer B) from 1 to 8, do (Actions)

Loop - Actions

If (All Conditions are True) then do (Then Actions) else do (Else Actions)

If - Conditions

(Clicked dialog button) Equal to Race_Dialogue_Buttons[(Integer B)]

((Triggering player) is an ally of Player 1 (Red)) Equal to True

Then - Actions

Unit - Create 1 Defense_Workers[(Integer B)] for (Triggering player) at (Center of North Side Starting Region <gen>) facing 90.00 degrees

Selection - Select (Last created unit) for (Triggering player)

Else - Actions

Sorry if I posted it the wrong way, but I do not know how else to post it. Thank you in advance for the assistance.

No comments:

Post a Comment