guys how too share xp just like in warcraft 3 ? For instance in warcraft 3, One hero alone around the kill area will get Full Xp, If 2 heros are around the kill area the xp will be shared between both equally. so how to do this guys?
Here is my experience trigger on my map.
If there is a easier way to do this then what I got, love to hear about it.
Global Variable Total Experience (Real [4])
Global Variable Experience (Real)
Always running trigger
I have trigger move region Player 1 to closest unit owned by Player 1 every .01 game seconds
<<have this action listed 4 times for players 1 - 4; have a huge region called Shared Exp>>
Trigger: Give Exp
Event: Any unit dies
Local Variable: # of units
Condition: Triggering player == hostile
Action:
move region Exp Range to position of triggering unit
set variable Experience = triggering unit property Maximum Life
If: point - region Player 1 is in region Shared Exp
Then: # of unit = # of units + 1
<<repeat this If statement for each player>>
Set variable Experience = Experience / # of units
If: point - region Player 1 is in region Shared Exp
Then: Total Experience [1] = Total Experience [1] + Experience
<<repeat this If statement for each player>>
set variable Experience = 0
<<I haven't got to test this yet since I'm still in the process of creating puzzle areas and terrain on my map.>>
There is actually a comparison "distance between units", so rather than doing it with regions, you could do something like this:
Variables:
Global Array of Unit "Hero Array"
Global Variable "Number of Heroes"
Local Variable "Hero"
Actions:
Pick each Integer
For each Integer
Conditions:
Comparison: Get Relationship
Comparison: Distance Between Points
Any Unit dies
- > For each Integer "Hero" from 1 to "Number of Heroes" do
- - > If player (killing player) treats player (Owner of Hero Array[Hero]) as ally == true
&&
- - > If player (Owner of Triggering unit) treats player (Owner of Hero Array[Hero]) as enemy == true
&&
- - > If distance between (Position of (Triggering unit)) and (Position of (Hero Array[Hero])) <= 10
Then
- - >Give Experience
e.g. I used the give experience effect mentioned above and made the experience received depending on the amount of kills the triggering unit had, which would look like this:
Pick each Integer from 0 to ((Triggering Unit) kills (current)) and do
- > Execute Give Experience on Hero Array[Hero] from Player (Owner of Hero Array[Hero]
guys how too share xp just like in warcraft 3 ? For instance in warcraft 3, One hero alone around the kill area will get Full Xp, If 2 heros are around the kill area the xp will be shared between both equally. so how to do this guys?
Xp is Experience points
@Jinxxx123: Go
http://forums.sc2mapster.com/development/tutorials/1646-data-create-a-wc3-like-experience-sharing-system/
Here is my experience trigger on my map.
If there is a easier way to do this then what I got, love to hear about it.
Global Variable Total Experience (Real [4])
Global Variable Experience (Real)
Always running trigger
I have trigger move region Player 1 to closest unit owned by Player 1 every .01 game seconds
<<have this action listed 4 times for players 1 - 4; have a huge region called Shared Exp>>
Trigger: Give Exp
Event: Any unit dies
Local Variable: # of units
Condition: Triggering player == hostile
Action:
move region Exp Range to position of triggering unit
set variable Experience = triggering unit property Maximum Life
If: point - region Player 1 is in region Shared Exp
Then: # of unit = # of units + 1
<<repeat this If statement for each player>>
Set variable Experience = Experience / # of units
If: point - region Player 1 is in region Shared Exp
Then: Total Experience [1] = Total Experience [1] + Experience
<<repeat this If statement for each player>>
set variable Experience = 0
<<I haven't got to test this yet since I'm still in the process of creating puzzle areas and terrain on my map.>>
Inside the Veterancy behavior you'll find Share Filters to share experience. I'm not sure how dependable it is, but that's what you're looking for.
As far as manually adding experience, you can use this sort of system:
Pick each player in YourPlayerGroup and do (Actions)
Catalog - Set value of Effects "GiveExperience" "XP" for player Picked Player to "1"
Environment - Execute Add Experience on xHero[Picked Player] from player Picked Player
There is actually a comparison "distance between units", so rather than doing it with regions, you could do something like this:
Variables:
Global Array of Unit "Hero Array"
Global Variable "Number of Heroes"
Local Variable "Hero"
Actions:
Pick each Integer
For each Integer
Conditions:
Comparison: Get Relationship
Comparison: Distance Between Points
Any Unit dies
- > For each Integer "Hero" from 1 to "Number of Heroes" do
- - > If player (killing player) treats player (Owner of Hero Array[Hero]) as ally == true
&&
- - > If player (Owner of Triggering unit) treats player (Owner of Hero Array[Hero]) as enemy == true
&&
- - > If distance between (Position of (Triggering unit)) and (Position of (Hero Array[Hero])) <= 10
Then
- - >Give Experience
e.g. I used the give experience effect mentioned above and made the experience received depending on the amount of kills the triggering unit had, which would look like this:
Pick each Integer from 0 to ((Triggering Unit) kills (current)) and do
- > Execute Give Experience on Hero Array[Hero] from Player (Owner of Hero Array[Hero]