HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Help with item trigger..

07-29-2005, 12:00 PM#1
FinalTyrant
What I wanted to do was to make a system based off my leaderboard, the leaderboard only displays the amount of kills for each playing person (not including main computer players)

Now I have 2 items, one for Jedi and one for Sith (both are rewards for the most number of kills, kind of like a title) and I want it so the player with the most number of kills on whatever team they are on to be rewarded with this item that should be given to their hero.

So the player with the most kills on their own teams side (Jedi/Sith) recieves an item that is given to their hero.

BUT I also wanted it so if another player takes over in total amount of kills this player loses the item from their hero and it is given to the other player's hero with the most amount of kills.

SO in lamers term: I want the jedi and sith with the most kills to receive an item, but if a different Jedi or Sith takes the lead, the original leader loses the item, and the new leader gains it.

OR in simpler lamers term: Hero on each team with the most kills gets a special item. When a new person sur-passes the person currently in the lead, they get the item for their hero instead of the other guy.
07-29-2005, 03:12 PM#2
Anitarf
What about when two players are tied for the top position on their team? Do they both get to have the item, or none of them?
07-29-2005, 04:56 PM#3
Kalvorod
It seems to me that the item plays a very minor role in this problem.

Assuming that your leader board works, just do the following action:

when unit dies

if (killing player) is on (team sith)
AND kills of (killing player)is >= player 1
AND kills of (killing player)is >= player 2
AND kills of (killing player)is >= player 3
AND kills of (killing player)is >= player 4


Action: Give (Item of Sith) to (hero)owned by(killing player)

Or something like that.
Really not a problem, you just need to use condition statments
07-29-2005, 05:02 PM#4
Kalvorod
Infact a better way to do those conditions is like this:

if (dude on team(see above))
AND ( killing players kills> player 1
>>>OR Killing player=player 1)

This way it won't switch when there is a tie. It will only switch if the player has higher kill that all of the Sith, or if they are the same person as them selves.

You need this because if you use >= then it can switch if the person becomes equal in kills, and if you use > *only* then it wouldn't switch at all because you can never have more kills than you have(335kills is not greater than 335kills so you don't get the item)


Just use that as an outline to put your variables in( player group and kill counts)
07-30-2005, 02:52 PM#5
FinalTyrant
K thanks, but can you explain the trigger in more detail because the conditions you told me are confusing.


Like this:

-Events:
--A unit (dies)

-Conditions:
--etc etc
08-05-2005, 02:14 PM#6
Kalvorod
Well, sure, but don't always ask for people to spell it out for you. Sometimes people will help you only if you help yourself.

You'll notice that because I don't know how your map works, I can't explain everything, so I will do this only for player 1


Event: Generic unit _dies_
Condition:
Action:
If([owner of _killing unit_ ] is = Player 1)
Then:
>>If(
OR>>>kills (index player number of[owner of _killing unit_]) >SithMaster
>>>>owner of killing unit=sithMaster
Then: Give item to random unit owned by (owner of killing unit)
Set SithMaster=owner of killing unit



SithMaster is a player variable that stores who is the leader of the sith. The if statements check if the killing player is (1 on the sith) then checks if kills are greater than the sith master, or if the player already is the sithmaster.