• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Dialog trouble

Status
Not open for further replies.
Level 2
Joined
Jan 10, 2012
Messages
15
I've been spending alot of my time trying to add dialog that lets you pick the character you want, there is Nova and Raynor im trying to make a dialog trigger that will show there name and icon and when you click them they'll spawn at the begining of the map.

what i want is, lets say a dialog screen with 2 bottons next to eachother one with raynor's name and discription and the other with nova's name and discription. if anyone could help me i'd be thankful

(Helpers are always in the credits)
 
Level 2
Joined
Jan 14, 2012
Messages
6
I actually use a system simular

Code:
                Dialog - Display button 1 of size (220, 100) with text "Jim" at Center of screen with offset (100, -150)  (run <trigger for person here> when button is clicked)
                Dialog - Display button 2 of size (220, 100) with text "Nova" at Center of screen with offset (-100, -150)  (run <trigger for person here> when button is clicked)
                Dialog - Display image 1 of size (512, 512) with image Menu.tga using blend mode Normal at Center with (0, 0)

You will need some global integers arrays for Player Type.

Then for each trigger I have the following code

Code:
Nova Choice
    Events
    Local Variables
    Conditions
    Actions
        UI - Clear Subtitle Messages for (Player group((Triggering player)))
        UI - Display "You have picked Nova" for (Player group((Triggering player))) to Subtitle area
        Variable - Set Player Type[((Triggering player) - 0)] = 1

Code:
Jim Choice
    Events
    Local Variables
    Conditions
    Actions
        UI - Clear Subtitle Messages for (Player group((Triggering player)))
        UI - Display "You have picked Jim" for (Player group((Triggering player))) to Subtitle area
        Variable - Set Player Type[((Triggering player) - 0)] = 2

Then make a trigger than does whatever you need to do to them.
 
Last edited:
Level 2
Joined
Jan 10, 2012
Messages
15
i got the botton's and back ground created but im having a hard time with the variables arrays and triggers. this is what im trying to figure out. as you can see im pretty bad with triggers, im mostly a data editer and a terrianer so bare with me. :\


UI - Display "You have picked Jim" for (Player group((Triggering player))) to Subtitle area
Variable - Set Player Type[((Triggering player) - 0)] = 2
General - If (Conditions) then do (Actions) else do (Actions)
If
Player Type[(Triggering player)] == 2
Then
Else
General - If (Conditions) then do (Actions) else do (Actions)
If
Player Type[(Triggering player)] == 1
Then
Variable - Set Selection Jim = (Selection Jim + 1)
Variable - Set Selection Nova = (Selection Nova - 1)
Else
General - If (Conditions) then do (Actions) else do (Actions)
If
Player Type[(Triggering player)] == 0
Then
Variable - Set Selection Jim = (Selection Jim + 1)
Else
 
question:

Code:
        Variable - Set Player Type[((Triggering player) - 0)] = 1
        General - If (Conditions) then do (Actions) else do (Actions)
            If
                Player Type[(Triggering player)] == 2
            Then
            Else
        General - If (Conditions) then do (Actions) else do (Actions)
            If
                Player Type[(Triggering player)] == 1
            Then
                Variable - Set Selection Nova = (Selection Nova + 1)
                Variable - Set Selection Jim = (Selection Jim - 1)
                
            Else
        General - If (Conditions) then do (Actions) else do (Actions)
            If
                Player Type[(Triggering player)] == 0
            Then
                Variable - Set Selection Nova = (Selection Nova + 1)
            Else

you do Set Player Type[((Triggering player) - 0)] = 1, which means that Player Type[(Triggering player)] will be equal to 1, so in the end, there's no use for the if-then-elses since the value will always be 1 right??? and you also never used the local variable IntA
 
Level 2
Joined
Jan 14, 2012
Messages
6
Sorry I forgot to remove all my debugging bits edited the post and the counter as well I doubt this will be used.

Sniper do you know how to make a global variable if not it's very simple>

In the trigger editor press control + b then change the name to Player Type check array with a size of (however many players you want to play on your map) I set mine to 16 for just in case.

Also what you need now is a trigger than launches after x seconds.

This is a cut down version of what I use.

Code:
Map Init
    Events
        Timer - Elapsed time is 30 Game Time seconds // 30 can be any time
    Local Variables
        IntA = 0 <Integer>
        IntB = 0 <Integer>
    Conditions
    Actions
	            UI - Clear Subtitle Messages for (All players) //clears chat
                Dialog - Destroy all dialogs //removes UI
				
                General - For each integer IntA from 1 to 12 with increment 1, do (Actions)
                    Actions
                        General - If (Conditions) then do (Actions) else do (Actions)
                            If
                                Player Type[IntA] == 2
                            Then
                                Unit - Create 1 Jim for player IntA at (Random point in Spawn) facing 270.0 degrees (No Options) //spawn is region
                                Unit Selection - Select (Last created unit) for player IntA
                                Camera - Zoom camera for player IntA at (Position of (Last created unit)) from ((Real(Default Camera Distance)) + 0.0) to Default Camera Distance over 0.01 seconds
                            Else
							
                General - For each integer IntB from 1 to 12 with increment 1, do (Actions)
                    Actions
                        General - If (Conditions) then do (Actions) else do (Actions)
                            If
                                Player Type[(IntB] == 1
                            Then
                                Unit - Create 1 Nova for player IntB at (Random point in Spawn) facing 270.0 degrees (No Options) //spawn is region
                                Unit Selection - Select (Last created unit) for player IntB
                                Camera - Zoom camera for player IntB at (Position of (Last created unit)) from ((Real(Default Camera Distance)) + 0.0) to Default Camera Distance over 0.01 seconds
                            Else

What this does is after x seconds it'll spawn the players the chosen hero and remove the UI.
 
You might like my dialog creation template.

Example:
JASS:
void gt_GameClockDialogCreate_Func () {
    const int   lv_width    = 325;
    const int   lv_height   = 30;
    const int   lv_anchor   = c_anchorBottomLeft;
    const int   lv_offsetX  = 24;
    const int   lv_offsetY  = 280;
    const bool  lv_modal    = false;
    const string lv_bgImage = "Assets\\Textures\\blank.dds";
    
    // Clock Dialog
    gv_clockDialog = DialogCreate(lv_width, lv_height, lv_anchor, lv_offsetX, lv_offsetY, lv_modal);
    DialogSetImage(gv_clockDialog, lv_bgImage);
    DialogSetVisible(gv_clockDialog, gv_allPlayers, true);
    
    // Clock Time Elapsed Dialog Label
    gv_clockDialogLabel = DialogControlCreate(gv_clockDialog, c_triggerControlTypeLabel);
    DialogControlSetSize(gv_clockDialogLabel, gv_allPlayers, lv_width, lv_height);
    DialogControlSetPosition(gv_clockDialogLabel, gv_allPlayers, c_anchorLeft, 0, 6);
    DialogControlSetPropertyAsText(gv_clockDialogLabel, c_triggerControlPropertyText, gv_allPlayers, gv_timeElapsedText);
    DialogControlSetPropertyAsText(gv_clockDialogLabel, c_triggerControlPropertyTooltip, gv_allPlayers, StringToText("Indicates game time elapsed."));
    DialogControlSetVisible(gv_clockDialogLabel, gv_allPlayers, true);
}
 
Status
Not open for further replies.
Top