• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[General] How to make a quest will give exprience to all players?

Status
Not open for further replies.
Level 7
Joined
Jun 14, 2009
Messages
235
Do you mean give experience to all the heroes/units owned by all players? You could just put them into a group, and give them exp that way.

  • Quest Exp
    • Events
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Heroes and do (Actions)
        • Loop - Actions
          • Hero - Add 1000 experience to (Picked unit), Show level-up graphics
Or you could select each player, then select each unit owned by them that is a hero and do the same, which would not require a specific hero group.
 
Level 7
Joined
Jun 14, 2009
Messages
235
Like I said, you could just make a game wide exp boost for all heroes owned by all players, adding some conditions in as needed. I think this would work.

  • Quest Exp
    • Events
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Unit Group - Pick every unit in (Units owned by (Picked player) matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
            • Loop - Actions
              • Set Temp_Group = (Units owned by (Picked player) matching (((Matching unit) is A Hero) Equal to True))
              • Unit Group - Pick every unit in Temp_Group and do (Actions)
                • Loop - Actions
                  • Hero - Add 1000 experience to (Picked unit), Show level-up graphics
              • Custom script: call DestroyGroup(udg_Temp_Group)
 
Level 26
Joined
Mar 19, 2008
Messages
3,140
Your trigger leaks and could be simpler usings jass function for destroying groups.
I'm also not sure about that player force, if it does not create another leak someway.
  • Quest Exp
    • Events
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units owned by (Picked player) matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
            • Loop - Actions
              • Custom script: set bj_wantDestroyGroup = true
              • Unit Group - Pick every unit in (Units owned by (Picked player) matching (((Matching unit) is A Hero) and do (Actions)
                • Loop - Actions
                  • Hero - Add 1000 experience to (Picked unit), Show level-up graphics
 
Level 7
Joined
Jun 14, 2009
Messages
235
Your trigger leaks and could be simpler usings jass function for destroying groups.
I'm also not sure about that player force, if it does not create another leak someway.
  • Quest Exp
    • Events
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units owned by (Picked player) matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
            • Loop - Actions
              • Custom script: set bj_wantDestroyGroup = true
              • Unit Group - Pick every unit in (Units owned by (Picked player) matching (((Matching unit) is A Hero) and do (Actions)
                • Loop - Actions
                  • Hero - Add 1000 experience to (Picked unit), Show level-up graphics

He didn't put them int a group, and seemed to want a trigger that applied to all heroes owned by all players. Also I believe that All Players does not leak. But yes, I forgot about that way, been like 5 months.

http://www.hiveworkshop.com/forums/triggers-scripts-269/things-leak-35124/
Note: (All Players) does not leak, and destroying it can result in problems
 
Status
Not open for further replies.
Top