HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

What is wrong with these Dialog Triggers?

01-17-2007, 09:24 PM#1
sgtteflon
Ok, what is wrong with these dialog triggers? Basically, I am trying to create a allies-type dialog driven submenu for 12 players to make/break alliances, share units, etc. WITHOUT having to create a dozen seperate instances of the same dialog (which is tedious and time consuming). The method I came up with was to attach a unique place in a single array to every possible permutation of a given dialog event (so the same dialog array has a dozen places for making an alliance with player 1 - one instance for each player).

Unfortunately, when I call these dialogs in game WC3 locks up. Can anyone see what the problem is?

This is the initialization trigger...

Trigger:
For each (Integer A) from 1 to 12, do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Player((Integer A))) slot status) Equal to Is playing
Collapse Then - Actions
Dialog - Change the title of Relations[(Integer A)] to Manage Relations Wi...
Collapse Player Group - Pick every player in (All players matching ((((Matching player) controller) Equal to User) and ((Matching player) Not equal to (Player((Integer A)))))) and do (Actions)
Collapse Loop - Actions
Dialog - Create a dialog button for Relations[(Integer A)] labelled (Colored Text Preset - Gold (c| Included) + (Name of (Picked player)))
Set RelationsButton[((Player number of (Picked player)) + (12 x ((Integer A) - 1)))] = (Last created dialog Button)
Dialog - Create a dialog button for Relations[(Integer A)] labelled Cancel
Collapse For each (Integer B) from 1 to 12, do (Actions)
Collapse Loop - Actions
Dialog - Change the title of Player[((Integer A) + (12 x ((Integer B) - 1)))] to ((Name of (Player((Integer A)))) + : Choose An Action)
Dialog - Create a dialog button for Player[((Integer A) + (12 x ((Integer B) - 1)))] labelled Offer Alliance
Set AllyButton[((Integer A) + (12 x ((Integer B) - 1)))] = (Last created dialog Button)
Dialog - Create a dialog button for Player[((Integer A) + (12 x ((Integer B) - 1)))] labelled Declare War
Set UnallyButton[((Integer A) + (12 x ((Integer B) - 1)))] = (Last created dialog Button)
Dialog - Create a dialog button for Player[((Integer A) + (12 x ((Integer B) - 1)))] labelled Offer Surrender
Set SurrenderButton[((Integer A) + (12 x ((Integer B) - 1)))] = (Last created dialog Button)
Dialog - Create a dialog button for Player[((Integer A) + (12 x ((Integer B) - 1)))] labelled Appoint Military Co...
Set CommanderButton[((Integer A) + (12 x ((Integer B) - 1)))] = (Last created dialog Button)
Dialog - Create a dialog button for Player[((Integer A) + (12 x ((Integer B) - 1)))] labelled Cancel
Collapse Else - Actions
Do nothing

And this is the call dialog trigger...

Trigger:
Foreign Relations
Collapse Events
Unit - A unit Finishes casting an ability
Collapse Conditions
(Ability being cast) Equal to Foreign Relations
Collapse Actions
Dialog - Show Relations[(Player number of (Owner of (Casting unit)))] for (Owner of (Casting unit))

While I was typing this, I think I remembered an old bug where you couldnt assemble dialogs on map initialization, but you had to wait a second or so of game-time. I'm not sure if I am right about that, and if it really is that simple, I will be pissed. But I'm gonna post this while I go to test that, just in case you guys can spot another problem, or that is not it.

Thanks!
01-17-2007, 09:30 PM#2
sgtteflon
Ok, it was that simple. Just had to move the assembly triggers out of the map initialization trigger and into game-time 1 second trigger.