• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Will this work for multiple players?

Status
Not open for further replies.
Level 8
Joined
Feb 23, 2020
Messages
255
Hello, as the title reads i wonder if this will work properly for multiple players or if it will cause problems.

  • Dialog1
    • Events
      • Unit - A unit Gains a level
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Set VariableSet LevelingHero = (Triggering unit)
      • Dialog - Clear Dialog
      • Dialog - Change the title of Dialog to Choose your attribu...
      • Dialog - Create a dialog button for Dialog labelled |cffff0000Strength ...
      • Set VariableSet Dialog_Str = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog labelled |cff00ff00Agility |...
      • Set VariableSet Dialog_Agi = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog labelled |cff8080ffIntellige...
      • Set VariableSet Dialog_Int = (Last created dialog Button)
      • Dialog - Show Dialog for (Owner of LevelingHero)
  • Choose1
    • Events
      • Dialog - A dialog button is clicked for Dialog
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Dialog_Str
        • Then - Actions
          • Hero - Modify Strength of LevelingHero: Add 1.
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Dialog_Agi
        • Then - Actions
          • Hero - Modify Agility of LevelingHero: Add 1.
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Dialog_Int
        • Then - Actions
          • Hero - Modify Intelligence of LevelingHero: Add 1.
        • Else - Actions
 
How many heroes does every player have ? It should work fine if we assume that the heroes gain a level at different times, but if it happens on the same time it will be problematic... (LevelingHero will get overwritten) That's why you have to index them.
  • Leve Up Dialog
    • Events
      • Unit - A unit Gain a level
    • Conditions
      • ((Triggering unit) is Un hero) Equal to TRUE
    • Actions
      • Set Integer = (Integer + 1)
      • Set Hero[Integer] = (Triggering unit)
      • Dialog - Clear Dialog
      • Dialog - Change the title of Dialog to Attributes
      • Dialog - Create a dialog button for Dialog labelled Strength
      • Set Dialog_Str[Integer] = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog labelled Agility
      • Set Dialog_Agi[Integer] = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog labelled Intelligence
      • Set Dialog_Int[Integer] = (Last created dialog Button)
      • Dialog - Show Dialog for (Owner of (Triggering unit))
  • Dialog Click
    • Events
      • Dialog - A dialog button is clicked for Dialog
    • Conditions
    • Actions
      • Set Recycle = (Recycle + 1)
      • -------- Strength --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Dialog_Str[Recycle]
        • Then - Actions
          • Hero - Modify Strength of Hero[Recycle]: Add 1
        • Else - Actions
      • -------- Agility --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Dialog_Agi[Recycle]
        • Then - Actions
          • Hero - Modify Agility of Hero[Recycle]: Add 1
        • Else - Actions
      • -------- Intelligence --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Dialog_Int[Recycle]
        • Then - Actions
          • Hero - Modify Intelligence of Hero[Recycle]: Ajouter 1
        • Else - Actions
      • -------- Reset Integers --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Recycle Equal to Integer
        • Then - Actions
          • Set Integer = 0
          • Set Recycle = 0
        • Else - Actions
This should work if each player has only ONE hero.
 
How many heroes does every player have ? It should work fine if we assume that the heroes gain a level at different times, but if it happens on the same time it will be problematic... (LevelingHero will get overwritten) That's why you have to index them.
  • Leve Up Dialog
    • Events
      • Unit - A unit Gain a level
    • Conditions
      • ((Triggering unit) is Un hero) Equal to TRUE
    • Actions
      • Set Integer = (Integer + 1)
      • Set Hero[Integer] = (Triggering unit)
      • Dialog - Clear Dialog
      • Dialog - Change the title of Dialog to Attributes
      • Dialog - Create a dialog button for Dialog labelled Strength
      • Set Dialog_Str[Integer] = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog labelled Agility
      • Set Dialog_Agi[Integer] = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog labelled Intelligence
      • Set Dialog_Int[Integer] = (Last created dialog Button)
      • Dialog - Show Dialog for (Owner of (Triggering unit))
  • Dialog Click
    • Events
      • Dialog - A dialog button is clicked for Dialog
    • Conditions
    • Actions
      • Set Recycle = (Recycle + 1)
      • -------- Strength --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Dialog_Str[Recycle]
        • Then - Actions
          • Hero - Modify Strength of Hero[Recycle]: Add 1
        • Else - Actions
      • -------- Agility --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Dialog_Agi[Recycle]
        • Then - Actions
          • Hero - Modify Agility of Hero[Recycle]: Add 1
        • Else - Actions
      • -------- Intelligence --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Dialog_Int[Recycle]
        • Then - Actions
          • Hero - Modify Intelligence of Hero[Recycle]: Ajouter 1
        • Else - Actions
      • -------- Reset Integers --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Recycle Equal to Integer
        • Then - Actions
          • Set Integer = 0
          • Set Recycle = 0
        • Else - Actions
This should work if each player has only ONE hero.

oooh okay i see, thank you very much mate! And yes, each player have 1 hero only. :)

Edit: So the dialog should be own to "Triggering unit", and not the "Hero[Integer]"?
I also have 2 dialogs when leveling up, the first one which looks like this: "Choose your attribute 2/2" then -> "Choose your attribute 1/2". Should i just repeat the steps again?
 
Last edited:
Edit: So the dialog should be own to "Triggering unit", and not the "Hero[Integer]"?
Yes, You can use "Triggering unit" since dialogs are displayed locally.
I also have 2 dialogs when leveling up, the first one which looks like this: "Choose your attribute 2/2" then -> "Choose your attribute 1/2". Should i just repeat the steps again?
You mean like 2 dialogs ? You pick an attribute then a second dialog pop out ? Yeah, I think you can repeat the steps but use different integers.
 
Yes, You can use "Triggering unit" since dialogs are displayed locally.

You mean like 2 dialogs ? You pick an attribute then a second dialog pop out ? Yeah, I think you can repeat the steps but use different integers.
Yes exactly. Okay i will try this out thank you! :)
 
Status
Not open for further replies.
Back
Top