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

Building Exp

Status
Not open for further replies.
Level 2
Joined
Sep 1, 2011
Messages
20
I was wondering, how to set a specific unit that kills a building to be the only one to gain experience? Example being Unit on Player Red side kills something and the hero owned by Red is the only one to gain the exp.
 
Level 8
Joined
Dec 9, 2009
Messages
397
Do you want only buildings to give xp like that or all things that give xp?

Not sure if it'll work but if you want all things to only give xp to killing unit set the radius for giving exp to 1
Not sure if it's based on position of killing unit or of killed unit

otherwise you'd have to trigger all exp

Hero - give exp to unit
 
Level 8
Joined
Jul 3, 2011
Messages
251
Yes, as Ultimatony said you will need to trigger all exp.

By default exp is hard coded to be shared, it is impossible to avoid this to my knowledge without remaking it.

You can disable exp in gameplay constants, then everytime a unit dies you can trigger the exp units gain, then distribute it to nearby units if you want.
 
  • hmmm
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A structure) Equal to True
    • Actions
      • Hero - Add 666 experience to (Killing unit), Show level-up graphics
or even better

  • hmmm
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A structure) Equal to True
    • Actions
      • Custom script: call AddHeroXP( GetKillingUnit(), 666, true )
 
Level 2
Joined
Sep 1, 2011
Messages
20
Umm

Well i get the concept of the triggers shown; in the map Vampirism, it does this for only two heroes, follow? That is what i am trying to do with the trigger - A Unit Dies. If anything else is unclear please do not hesitate to ask.
 
Level 8
Joined
Dec 9, 2009
Messages
397
use Hero - Disable experience gain for (Picked unit)
for the unit you don't want to gain xp normally,
then trigger exp for just him.
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
Here's how to add exp depending on structre type:

  • Untitled Trigger 030
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set hash = (Last created hashtable)
      • Set ut = Farm
      • Custom script: call SaveInteger(udg_hash,udg_ut, 0, 100)
      • Set ut = Barracks
      • Custom script: call SaveInteger(udg_hash, udg_ut, 0, 200)
  • Untitled Trigger 031
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) belongs to an enemy of (Owner of (Killing unit))) Equal to True
      • ((Triggering unit) is A structure) Equal to True
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Killing unit)) Equal to Paladin
          • (Unit-type of (Killing unit)) Equal to Blademaster
    • Actions
      • Custom script: call AddHeroXP(GetKillingUnit(), LoadInteger(udg_hash, GetUnitTypeId(GetTriggerUnit()), 0), true)
 
Status
Not open for further replies.
Top