HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Dialog box stats

07-05-2005, 02:52 PM#1
PirateBill
Hey, I got some help for this trigger and I have everything right I believe, but when I get a hero to level up. the box appears without buttons. Heres the trigger:


Code:
Events
Unit - A unit Gains a level
Conditions
Actions
Set UnitVariableName = (Leveling Hero)
Set StatPointsRemaining[(Player number of (Owner of UnitVariableName))] = StatPointsRemaining[ (Player number of (Owner of UnitVariableName))] + 5
Dialog - Show DialogVariableName for (Owner of UnitVariableName)
Dialog - Change the title of DialogVariableName to (Select Stat Points - + ((String(StatPointsRemaining[(Player number of (Owner of UnitVariableName))])) + points remaining))
Dialog - Create a dialog button for DialogVariableName labelled Strength
Set DialogButtonVariableName[1] = (Last created dialog Button)
Dialog - Create a dialog button for DialogVariableName labelled Agility
Set DialogButtonVariableName[2] = (Last created dialog Button)
Dialog - Create a dialog button for DialogVariableName labelled Intelligence
Set DialogButtonVariableName[3] = (Last created dialog Button) 

Second trigger


Code:
Events
Dialog - A dialog button is clicked for DialogVariableName
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Clicked dialog button) Equal to DialogButtonVariableName[1]
Then - Actions
Hero - Modify Strength of UnitVariableName: Add 1
Set StatPointsRemaining[(Player number of (Owner of UnitVariableName))] = (StatPointsRemaining[(Player number of (Owner of UnitVariableName))] - 1)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Clicked dialog button) Equal to DialogButtonVariableName[2]
Then - Actions
Hero - Modify Agility of UnitVariableName: Add 1
Set StatPointsRemaining[(Player number of (Owner of UnitVariableName))] = (StatPointsRemaining[(Player number of (Owner of UnitVariableName))] - 1)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Clicked dialog button) Equal to DialogButtonVariableName[3]
Then - Actions
Hero - Modify Intelligence of UnitVariableName: Add 1
Set StatPointsRemaining[(Player number of (Owner of UnitVariableName))] = (StatPointsRemaining[(Player number of (Owner of UnitVariableName))] - 1)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
StatPointsRemaining[(Player number of (Owner of UnitVariableName))] Greater than or equal to 1
Then - Actions
Dialog - Show DialogVariableName for (Owner of UnitVariableName)
Else - Actions
Dialog - Hide DialogVariableName for (Owner of UnitVariableName) 


Here's my variables:

DialogButtonVariableName - Dialog Button array [1]

DialogVariableName - Dialog (default)

StatPointsRemaining - Integer array [8] (8 ppl max in map)

UnitVariableName - unit


Any help would be great. Thanks
-Bill
07-05-2005, 04:27 PM#2
Limb_Smasher
Quote:
Originally Posted by PirateBill
Events
Unit - A unit Gains a level
Conditions
Actions
Set UnitVariableName = (Leveling Hero)
Set StatPointsRemaining[(Player number of (Owner of UnitVariableName))] = StatPointsRemaining[ (Player number of (Owner of UnitVariableName))] + 5
Dialog - Show DialogVariableName for (Owner of UnitVariableName)
Dialog - Change the title of DialogVariableName to (Select Stat Points - + ((String(StatPointsRemaining[(Player number of (Owner of UnitVariableName))])) + points remaining))
Dialog - Create a dialog button for DialogVariableName labelled Strength
Set DialogButtonVariableName[1] = (Last created dialog Button)
Dialog - Create a dialog button for DialogVariableName labelled Agility
Set DialogButtonVariableName[2] = (Last created dialog Button)
Dialog - Create a dialog button for DialogVariableName labelled Intelligence
Set DialogButtonVariableName[3] = (Last created dialog Button)

Ok i think you problem lies within this trigger. as you said nothing comes up. now im my map i to have dialog boxes, and i was comparing mine to yours and i found that the only difference was that the line "Dialog - Show DialogVariableName for (Owner of UnitVariableName)" was before you made the buttons. So i believe youre showing the players just this
Code:
Events
 Unit - A unit Gains a level
Conditions
Actions
 Set UnitVariableName = (Leveling Hero)
 Set StatPointsRemaining[(Player number of (Owner of UnitVariableName))] = StatPointsRemaining[ (Player number of (Owner of UnitVariableName))] + 5
 Dialog - Show DialogVariableName for (Owner of UnitVariableName)
so If i were you, id move that action to the end and then try it.
07-05-2005, 08:16 PM#3
PirateBill
K, I did move it down and it worked ^_^ Now when i click a stat button, the box goes away and I can only add 1 stat per level. It should keep the box up until the points are used up. Any ideas why? If not, is there a demo map of this somewhere? I saw a map called dialogtest but the links were broken... just my luck. :\
Thanks
-Bill
07-05-2005, 11:28 PM#4
Zandose
Please post your triggers in the code tags. It helps alot.
Code:
Triggers
07-05-2005, 11:38 PM#5
Tim.
Insert a .01 wait time between the if/then/else for:
Code:
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
StatPointsRemaining[(Player number of (Owner of UnitVariableName))] Greater than or equal to 1
Then - Actions
Dialog - Show DialogVariableName for (Owner of UnitVariableName)
Else - Actions
Dialog - Hide DialogVariableName for (Owner of UnitVariableName) 
07-05-2005, 11:43 PM#6
weaaddar
dialog box method is really ugly. I suggest using Attributer SA as it is much more attractive interface method.