HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

give 50% of exp gained to another hero....

02-22-2004, 03:08 AM#1
Mandrilx
How do I make it so that a hero thats far away in the map gains 50% of the exp that another hero gains?
02-22-2004, 03:57 AM#2
dexllgamer
I thought of a way.

Units:
HeroA = hero attacking in the field
HeroB = hero gaining 50% of experince

Variables: both integers both starting at 0
ExperienceA = before kill
ExperienceB = after kill


Event:
unit dies
Condition:
killing unit was HeroA
Action:
set variable: ExperienceB = (experience of HeroA)
add ((ExperienceB - ExperienceA) X .5) experience to HeroA
set variable: ExperinceA = ExperienceB

With this trigger when the attacking hero makes a kill it takes its experience after the kill subtracts the experience from before the kill then multiplys that amount by .5 to give you half the xperience earned to the other hero.

Wow, i thought it would be messier than that. Pretty neat actually.

Hopefully the next person will tell me my solution is crap.

Peace.
02-22-2004, 06:22 AM#3
Mandrilx
holy shit dude, thx... just modified it a bit (reduced into 2 variables!:ggani: ) and worked like a charm, thx.

edit: nvm, ur way works better... silly me
02-22-2004, 07:02 AM#4
ThyFlame
Well, the trigger itself doesn't ever give heroB exp, and it appears to give heroA 150% exp (the base exp is given out automatically, correct?)

Or should this add ((ExperienceB - ExperienceA) X .5) experience to HeroA

be add ((ExperienceB - ExperienceA) X .5) experience to HeroB
02-22-2004, 12:23 PM#5
Arohk
go to gameplay constants and set,

global exp sharing [yes]
02-22-2004, 03:56 PM#6
Mandrilx
Quote:
Originally posted by ThyFlame
Well, the trigger itself doesn't ever give heroB exp, and it appears to give heroA 150% exp (the base exp is given out automatically, correct?)

Or should this add ((ExperienceB - ExperienceA) X .5) experience to HeroA

be add ((ExperienceB - ExperienceA) X .5) experience to HeroB


since you cant multiple by .5, just divided by 2... works perfectly for me.

Quote:
Originally posted by Arohk
go to gameplay constants and set,

global exp sharing [yes]


this woudnt work for me, I needed the exp shared only for 2 heros, not the heros of every player.
02-22-2004, 04:01 PM#7
Hunter0000
Quote:
Originally posted by dexllgamer

set variable: ExperinceA = ExperienceB


AHHH noooo not this. This is bad... never do this...

As far as I remeber this made two varables ALWAYS = eachother do this:
set variable: ExperinceA = ExperienceB + 0

that should avoid any problems, even just to be safe
02-22-2004, 04:08 PM#8
Mandrilx
Quote:
Originally posted by Hunter0000
AHHH noooo not this. This is bad... never do this...

As far as I remeber this made two varables ALWAYS = eachother do this:
set variable: ExperinceA = ExperienceB + 0

that should avoid any problems, even just to be safe



excuse my ignorance, but what problems could it cause?
02-22-2004, 04:15 PM#9
ThyFlame
Quote:
Originally posted by Mandrilx
since you cant multiple by .5, just divided by 2... works perfectly for me.



this woudnt work for me, I needed the exp shared only for 2 heros, not the heros of every player.




Er, I more meant that HeroA (hero fighting in the field) gets 100% exp from killing it, then another 50% via triggers, while HeroB got nothing.

Unless the roles are reversed.
02-22-2004, 05:01 PM#10
Mandrilx
hmmm no, should give 50% of the experience of each kill by hero a to hero b.