• 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.

How to disable shared XP gain?

Status
Not open for further replies.
here is an example :
  • -------- Considered hero : UNIT, owned by PLAYER --------
  • Set INTEGER = 0
  • Set POINT = (Position of UNIT)
  • For each (Integer A) from 1 to 12, do (Actions)
    • Boucle - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in (Units within 1800.00 of POINT matching ((((Matching unit) is A hero) Egal Ã* TRUE) and ((Owner of (Matching unit)) Egal Ã* (Player((Integer A))))))) Supérieur Ã* 0
        • So - Actions
          • Set INTEGER = (INTEGER + 1)
        • Else - Actions
  • Hero - Make PLAYER Heroes gain (100.00 x (Real(INTEGER)))% experience from future kills
  • Custom script: call RemoveLocation(udg_POINT)
Sorry for the french stuff xD
 
Level 4
Joined
Jun 17, 2011
Messages
64
here is an example :
  • -------- Considered hero : UNIT, owned by PLAYER --------
  • Set INTEGER = 0
  • Set POINT = (Position of UNIT)
  • For each (Integer A) from 1 to 12, do (Actions)
    • Boucle - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in (Units within 1800.00 of POINT matching ((((Matching unit) is A hero) Egal Ã* TRUE) and ((Owner of (Matching unit)) Egal Ã* (Player((Integer A))))))) Supérieur Ã* 0
        • So - Actions
          • Set INTEGER = (INTEGER + 1)
        • Else - Actions
  • Hero - Make PLAYER Heroes gain (100.00 x (Real(INTEGER)))% experience from future kills
  • Custom script: call RemoveLocation(udg_POINT)
Sorry for the french stuff xD
i cant find
  • Set POINT = (Position of UNIT)
  • (Number of units in (Units within 1800.00 of POINT matching ((((Matching unit) is A hero) Egal Ã* TRUE) and ((Owner of (Matching unit)) Egal Ã* (Player((Integer A))))))) Supérieur Ã* 0
  • Hero - Make PLAYER Heroes gain (100.00 x (Real(INTEGER)))% experience from future kills
 
Level 17
Joined
Jan 21, 2010
Messages
2,111
i cant find
  • Set POINT = (Position of UNIT)
  • (Number of units in (Units within 1800.00 of POINT matching ((((Matching unit) is A hero) Egal Ã* TRUE) and ((Owner of (Matching unit)) Egal Ã* (Player((Integer A))))))) Supérieur Ã* 0
  • Hero - Make PLAYER Heroes gain (100.00 x (Real(INTEGER)))% experience from future kills
That should be under unit group
 
In fact, each time you use a position (like Move the unit at center of region REGION) (center of REGION is a position), it leaks; it means the point remains on the map, and the more there are points, the more it lags, so you create first a variable POINT (which is a position), you set it (there I set it as the position of the hero), then you use it in an action, and to finish you delete it (with Custom script: call RemoveLocation(udg_POINT) ). So the position is deleted and it wont create lag :). You must do this each time u use a position.
there are also other things that leak : Check this forum to know what leaks and how to avoid lag
 
Level 4
Joined
Jun 17, 2011
Messages
64
  • Exp Rate
    • Events
    • Conditions
    • Actions
      • Set Exp = 0
      • Set Point = (Position of Unit)
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Number of units in (Units within 1800.00 of TempPoint matching (((Matching unit) is A Hero) Equal to True))) Equal to 0) and ((Owner of (Matching unit)) Equal to (Player(Exp)))
            • Then - Actions
              • Set Exp = (Exp + 1)
            • Else - Actions
      • Hero - Make Player Heroes gain 1500.00% experience from future kills
      • Custom script: call RemoveLocation(udg_Point)
 
  • Exp Rate
    • Events
    • Conditions
    • Actions
      • Set Exp = 0
      • Set Unit = Your hero
      • Set Point = (Position of Unit)
      • Set Player = Owner of Unit
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Number of units in (Units within 1800.00 of Point matching (((Matching unit) is A Hero) Equal to True))) HigherThan 0) and ((Owner of (Matching unit)) Equal to (Player(Integer A)))
            • Then - Actions
              • Set Exp = (Exp + 1)
            • Else - Actions
      • Hero - Make Player Heroes gain (100x(Real(Exp))) experience from future kills
      • Custom script: call RemoveLocation(udg_Point)
This is better
You also need an event !! Or it will never be triggered :)
(like Every 3 seconds)
 
Level 4
Joined
Jun 17, 2011
Messages
64
it froze the game after 3 sec
this is what i have now
  • Exp Rate
    • Events
      • Time - Elapsed game time is 3.00 seconds
    • Conditions
    • Actions
      • Set Exp = 0
      • Set Unit = Hero
      • Set Point = (Position of Unit)
      • Set Player = (Owner of Unit)
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Number of units in (Units within 1800.00 of TempPoint matching (((Matching unit) is A Hero) Equal to True))) Equal to 0) and ((Owner of (Matching unit)) Equal to (Player(IntegarA)))
            • Then - Actions
              • Set Exp = (Exp + 1)
            • Else - Actions
      • Hero - Make Player Heroes gain (100.00 x (Real(Exp)))% experience from future kills
      • Custom script: call RemoveLocation(udg_Point)
 
Level 11
Joined
Dec 5, 2009
Messages
846
Set Unit = Hero Who's Hero? is that a variable? or what is it?

((Number of units in (Units within 1800.00 of TempPoint matching (((Matching unit) is A Hero) Equal to True))) Equal to 0) and ((Owner of (Matching unit)) Equal to (Player(IntegarA)))

The temp point??? i can't see it set there.


Offtopic; Dude im serious about that quote
''Jass is like taking the long, treacherous, and exhausting path up the mountain, while GUI is like taking the catapult''






Just kidding, isn't it awesome ? :)
 
Level 4
Joined
Jun 17, 2011
Messages
64
Set Unit = Hero Who's Hero? is that a variable? or what is it?

((Number of units in (Units within 1800.00 of TempPoint matching (((Matching unit) is A Hero) Equal to True))) Equal to 0) and ((Owner of (Matching unit)) Equal to (Player(IntegarA)))

The temp point??? i can't see it set there.


Offtopic; Dude im serious about that quote
''Jass is like taking the long, treacherous, and exhausting path up the mountain, while GUI is like taking the catapult''
Hero is a variable. unless it is suppose to be a hero
 
Level 11
Joined
Dec 5, 2009
Messages
846
Well you could make a Hero variable with some arrays. and you put hero[1] = Hero owned by red
hero[2] = hero owned by blue etc for a easy way, but there more ways on doing this. I can maybe look later on this trigger.
 
the hero type for the variable?
It's unit :)
also in monster master rpg everyone gets exp (when near by) but it splits between your monsters not the other players.
Try to ask the maker; plus, the map might be unprotcted.
Btw, I advise you to first learn the basics of triggering, you'll be able to make everything by urself (and save a lot of time)
 
Do you know a good place to learn the basics i know a little but it ends up failing.
Actually, I think forums where u can learn stuff are just made to help u in a specific situation. I learnt almost everything by myself, which is very satisfying, but also faster as u remember much better. It's just an advice; Otherwise , check the forums of the Hive, I'm sure u ll find basics on triggering
 
Level 11
Joined
Dec 5, 2009
Messages
846
When i started to learn, i watched mass threads from ppl that needs help. And i learned so much from that.
Guess what. I got bored this fine evening and i had nothing to do so i made the trigger for you :)

Here are the Triggers
  • CoolDown
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Trigger - Turn on Xp Trigger <gen>

  • Xp Trigger
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • Set Index = (Index + 1)
      • Set Integer[Index] = 0
      • Set Point[Index] = (Position of (Attacked unit))
      • Set UnitGroup[Index] = (Units within 500.00 of Point[Index] matching ((((Matching unit) is A Hero) Equal to True) and (((Matching unit) belongs to an ally of (Owner of (Attacking unit))) Equal to True)))
      • Unit Group - Pick every unit in UnitGroup[Index] and do (Actions)
        • Loop - Actions
          • Set Integer[Index] = (Number of units in UnitGroup[Index])
          • Hero - Make (Owner of (Picked unit)) Heroes gain (100.00 x (Real(Integer[Index])))% experience from future kills
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Index Equal to 1000
        • Then - Actions
          • Set Index = 0
        • Else - Actions
      • Custom script: call RemoveLocation(udg_Point[udg_Index])
      • Custom script: call DestroyGroup(udg_UnitGroup[udg_Index])
      • Trigger - Turn off (This trigger)
And here's the map. I hope this is how you like it. And if there's any bugs please let me know :)
 

Attachments

  • Share Xp.w3x
    18.8 KB · Views: 39
Status
Not open for further replies.
Top