HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

somefin diffewent

08-19-2002, 11:38 PM#1
iceslushee
how would i go about having a leader board that shows an amount of hostiles in a region and minus 1 every time u kill 1? I want it to appear when u go into a certain region and dissapear if u leave but keep the leaderboard number to the current amount of enemies in the region.. Is this even possible with a leader board cos i have no idea on the subject
08-20-2002, 12:45 AM#2
dataangel
It's possible. Now read the FAQ and look at other maps that have leaderboards and come back.
08-20-2002, 01:03 AM#3
Ari
Quote:
Originally posted by iceslushee
how would i go about having a leader board that shows an amount of hostiles in a region and minus 1 every time u kill 1? I want it to appear when u go into a certain region and dissapear if u leave but keep the leaderboard number to the current amount of enemies in the region.. Is this even possible with a leader board cos i have no idea on the subject

Well, I have no experience with leaderboards, but I think I can help with the rest of the problem. Granted, this *isn't* the most elegant answer, I'm sure, and hopefully somebody else can tell you the *real* way to do it, but this'll work, I think:

The first thing you need, the way I'm thinking, is to be able to keep track of all units in play. Create an array of units (or even better, one for each player and neutrals), and each time a unit is created, up your index value (ie, (integer) "red_unit_number) by one, and set (unit array) "red_units [red_unit_number]" to be the last created unit.

Depending on when your units are created, you either want to do this at initialization or using the "unit finishes training a unit" event (though I haven't used that event yet).

When this is done, you will have a way of tracking all units in play.

Now, in a for loop, check each unit of a color (from 1 to [whatevr the final red_unit_number was]) in turn to see if it is in a region (that's the bool condition "unit is in region") When you're asked to name a unit, pick, say, red_units[integer A]. If yes, than add one to a tally of enemy units in a region. If no, do nothing.

Repeat for each enemy color.

I hope this helps, but let me know if you ahve an y questions.
08-20-2002, 12:24 PM#4
SuperIKI
Well, if you do it that way, it'll take ages... :o
You need no array, there's a function that can count units in a unit group ( e.g. all units in a certain region).
Just display the return value of that function.
11-07-2002, 06:04 AM#5
iceslushee
actually i saw this in sharky's latest diablo2 map but i noticed that it appeared at the start of the game
11-08-2002, 05:51 AM#6
DemonicSoul
you lost me after "Well," lol

anyways u gotta set up a leaderboard then, when a unit dies, belonging to neutral hostile, in that region, set the leaderboard value to the number of units in that region (since one died it is -1..or will it count dead ones too?) for unit exists in region, its a boolean condition