1. Find your way through the deepest dungeon in the 18th Mini Mapping Contest Poll.
    Dismiss Notice
  2. A brave new world lies beyond the seven seas. Join the 34th Modeling Contest today!
    Dismiss Notice
  3. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
Hive 3 Remoosed BETA - NOW LIVE. Go check it out at BETA Hive Workshop! Post your feedback in this new forum BETA Feedback.
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Will this work for multiple players?

Discussion in 'World Editor Help Zone' started by Xzere, May 12, 2020.

Tags:
  1. Xzere

    Xzere

    Joined:
    Feb 23, 2020
    Messages:
    152
    Resources:
    0
    Resources:
    0
    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
     
  2. Warseeker

    Warseeker

    Joined:
    Feb 18, 2014
    Messages:
    3,154
    Resources:
    2
    Maps:
    2
    Resources:
    2
    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.
     
  3. Xzere

    Xzere

    Joined:
    Feb 23, 2020
    Messages:
    152
    Resources:
    0
    Resources:
    0
    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: May 12, 2020
  4. Warseeker

    Warseeker

    Joined:
    Feb 18, 2014
    Messages:
    3,154
    Resources:
    2
    Maps:
    2
    Resources:
    2
    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.
     
  5. Xzere

    Xzere

    Joined:
    Feb 23, 2020
    Messages:
    152
    Resources:
    0
    Resources:
    0
    Yes exactly. Okay i will try this out thank you! :)