• 🏆 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!

Help With Creating An EXP System

Status
Not open for further replies.
Level 7
Joined
Dec 20, 2007
Messages
124
Okay so an EXP system came into my head. Though it takes a lot of indexing and my coding powers are not sufficient to make it. It goes like this.

XP Gained = (Total Damage Done By Player / Spawn Total Damage Received) x Spawn Default XP Given

Wherein:

XP Gained - The XP gained by the heroes when the spawn dies.

Total Damage Done By Player - The total damage done by a player to the spawn.

Spawn Total Damage Received - The total damaged received by the spawn.

Spawn Default XP Given - A default integer for total XP given by a unit-type.

Also I want a condition wherein the hero must be in 1500 range within the spawn or the Hero wont receive any XP (Hero still acquires XP even when dead)

_______________________________________

As far as I can tell maybe it would work like

1. The spawn has an index when it enters the map.

2. When the spawn is damaged, the damage is then stored to an index for the owner of the damaging unit which is linked to the index of the spawn.

3. When the spawn dies a trigger checks for the heroes present within 1500 range and distributes the XP according to the formula above.

I wanted to try using arrays but I don't think the cap 8000 would be big enough since I won't be able to figure out recycling the arrays which are already empty.
 
Level 11
Joined
Sep 12, 2008
Messages
657
hmm..
use the AutoIndex script,
which automaticly gives units that enter map an unique id,
and removes their id when they leave map die/etc.
then you do w/e.
and btw, thats a wrong way,
since the best option is to get/set stuff using unit id.
then basicly, footman = 10 exp, peasent = 15 exp, and so on.
alot easier then what you sayd,
and how do you apply unused indexes to a new index?
loop to check if theres a index when the unit is null, then set new index as it,
and if nothing is empty, just make a new 1.
 
Status
Not open for further replies.
Top