HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Hero Arena Duel Sorter

02-15-2004, 06:52 PM#1
Lost_ally
Okay. Im looking at this and Im sure there is some way to do it, but I don't know it. I am assuming this involves arrays, but Im not sure.

Im making a Hero Arena with 4 teams. When the timer expires, I want one hero from each time that has the most kills, for their team. Not just kills though, HERO kills. It seems easy enough to work out how to send the hero with the most kills out of all there. (Which I have done.)

Therein lies my second problem. How do I get my killcounter not to count any kills but hero kills?Nevermind, fixed that! Still need help on first one, though.

If anyone could help me out soon, that would be greatly appreciated.:ggani:
02-15-2004, 08:13 PM#2
Lost_ally
I have a variable for every player...

If Player 1 kills a hero, P1Kills variable gets updated.

There are 3 players per team, and there are 4 teams.

I need one player from each team to be slected, and they need to be selected based on who has the highest score in there team.

Basically, Im thinking I need a way to compare:

P1Kills
P2Kills
P3Kills

Find the one with the highest value and pick their hero.

Obviously, do the rest in groups of three.

Im guessing there are other ways to do it, though.
02-15-2004, 09:50 PM#3
johnfn
uhhhhhhhhhhhhhhhh...... what exactly is the first question? IF its how to get the hero to come out, thats easy. But it does involve arrays, in fact two arrays that corresopnd to each other. You are going to need an array of unit variables, and an array of integers representing the score for the corresponding unit. confused? dont be! its like this:


Unit(15) (game says Dreadlord)

Score(15) (game gives the Dreadlords kills)

Then set it up so the game records the score into the right score variable. Then just unit- move the unit that corresponds to the score # to wherever they have to go.

I gotta go now, so this description is very rushed. just reply, or PM me if you need help.

bye



and btw, dont double post :ggani:
02-15-2004, 10:12 PM#4
Lost_ally
Sadly, thsi is still not quite what I am looking for, unless Im reading this wrong.

I udnerstand what you said. However.

There are four teams of three people each.

Every five minutes there is a duel. Since I am not actually comparing them to a set value, I dont know how to do this. I need ONE person from each team. Thus, four people. The one person is selected based on how many kills they have made. IE:

----Team 1

1Kills:5
2Kills:7
3Kills:2

----Team 2

4Kills:6
5Kills:9
6Kills:3

----Team 3

7Kills:4
8Kills:1
9Kills:7

----Team 4

10Kills:5
11Kills:7
12Kills:8

Now. When it is time to select the players for the duel, it is picking the highest integer out of groups of three. Following that, THIS is the players picked:

Team 1: Player 2

Team 2: Player 5

Team 3: Player 9

Team 4: Player 12

Its not what do with them AFTER the proper players/units are picked that I need help with. Its coding it so that they are sorted properly. If I read your method right, that would simply store scores for individiual units. I have done that. But how do I get the game to select the highest integer out of an array? Something like If: p1kills greater than p2kills and p3kills, then (actions for duel) else pause?

By the way, if it is confusing at all, that is what I WANT it to do, not what it IS doing.

Is it clearer, now?

EDIT: Here is what I have come up with:

If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(P1Kills Greater than P2Kills) and (P1Kills Greater than P3Kills)
Then - Actions
Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 1 (Red)) and do (Unit - Move (Picked unit) instantly to (Center of NorthDuel <gen>))
Else - Actions
Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 1 (Red)) and do (Unit - Pause (Picked unit))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(P2Kills Greater than P1Kills) and (P2Kills Greater than P3Kills)
Then - Actions
Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 2 (Blue)) and do (Unit - Move (Picked unit) instantly to (Center of NorthDuel <gen>))
Else - Actions
Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 2 (Blue)) and do (Unit - Pause (Picked unit))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(P3Kills Greater than P1Kills) and (P3Kills Greater than P2Kills)
Then - Actions
Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 3 (Teal)) and do (Unit - Move (Picked unit) instantly to (Center of NorthDuel <gen>))
Else - Actions
Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 3 (Teal)) and do (Unit - Pause (Picked unit))

Does it look workable?
02-16-2004, 12:31 AM#5
johnfn
Yup, i did misread your question. Lets try this again, shall we?

actually i believe there is an ezr way. Im not sure if it will actually become 5000x harder, but here goes:

You have the array thing like you were talking about. Then we do this:

for each integer A from 1 to (the # of hero units) do
if (kills_of_unit_ordered_by_unit_for_player_1(Integer A) is greater then the_current_high_kill_guy_in_points )then do (set variable - the_current_high_kill_guy_in_points to kills_of_unit_ordered_by_unit_for_player_1(Integer A))
it only looks long because the names of the variables are REALLY long. (its to make it understandable)

Now what i did here is sort through the four: if the one i sorted was higher then the current one i had picked as highest, then i replaced the highest one with the one i just sorted to (read that a few times, as im sure its confusing)


NOw we have the kills of the guy with the highest kills. Lets just pick him out by kills in our super double array as i was describing earlier



For Each integer A from 1 to (# of hero units) if (kills_of_hero_unit(integer A) equal to the_current_high_kill_guy_in_points then (unit - move kills_of_unit_ordered_by_unit_for_player_1(Integer A) to arena_area)


I believe thats what you want, the thing is that i probably mislabeled kills_of_unit_ordered_by_unit_for_player_1, i think it should be kills_of_unit_ordered_by_unit_for_player_1_to_player_3


im hoping thats what you want 8))
02-16-2004, 02:36 AM#6
Lost_ally
:hm:

Wow, that looks complicated. Seriously, in every instance of arrays I have seen they have looked immensely confusing, in a very tongue-twister type way.

Sadly, and I know I should have posted this, my idea DID work. Being the impatient fool I am, I decided to copy it and modify it to all four teams. (A process that took a lot of tedious, annoying work.)

Well, fortunately, it seems to be working. I do apologise for making you work on something I had already fixed. Though if it breaks I will definetly look back here.

Ah well, I suppose this is what happens when you teach yourself how to make triggers. >.< I started out with a TD, now Im doing a hero arena. All withotu looking at a single bloody tutorial! Yes, I'm an idiot!

Long story short, thanks. =)

~LordRayne, Lost_Ally's insane triggerer.

(The signup process is not working for me, so I am using his account for all trigger question posts.)