• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

need help

Status
Not open for further replies.
Level 18
Joined
Mar 7, 2005
Messages
824
i wanted to make a leaderboard and a killsystem, but i dont know realy how to do it, so here my Question:
I want that u get for every 5 kills 1 gold. so that when u for example kill 25 units u have 5 gold, u know. and for the leaderboard it should be work normaly for each kill one point on leaderboard, so when u kill 25 units u have a number of 25 on the leaderboard... thx in advance :)
 
Level 6
Joined
Mar 25, 2005
Messages
304
okay. creating the leaderboard is actually easier than most people think. and the kill thing should be quite easy. this however, requires more than one trigger (you probably figured that out by yourself anyhow). So here is the first step. Create two interger variables for each player and name them like "PlayerXKill"/"PlayerXTotalKill", and insert the number of the player where X is. (EX: Player 1(red) will be Player1Kill) After you create the variables, create this trigger:

Event: elapsed gametime is 5 seconds(or whatever you want the event to be, but i believe leaderboards cannot be displayed at map initialization)
Condition: none
Action:
Leaderboard - Create (and name the leaderboard)
Leaderboard - Add Player (And add each players on the leaderboard and make labels (what their name will be. it can simply be player number) and make the values PlayerXTotalKills, corresponding to each player.)
Leaderboard - Show/Hide (set to show the last created leaderboard.)

the function of this trigger is to initially start a leaderboard. after you create that trigger, create this trigger for the kills updated.

Event: Unit - A unit dies
Condition: None
Action:
If/Then/Else/Multiple Functions:
-Condition: Player Comparison - set it to:(Owner of the Killing Unit equals Player Red)
-Then Actions:
--If/Then/Else/Multiple Fuctions: (embed another if/then function)
---Condition: Integer Comparison - Player1Kill is less than 5
---Then Action:
----Set Variable - Set Player1Kill = Player1Kill+1 (Do this by function: arithmetics)
----Set Variable - Set Player1TotalKill = Player1TotalKill+1
---Else Action:
----Set Variable - Set Player1Kill = 0
----Set Variable - Set Plyaer1Kill = Player1Kill+1
----Player Property - Add 1 gold to Player 1's current gold
----Set Variable - Set Player1TotalKill = Player1TotalKill+1

***Repeat this whole action shown above for each player***

That's the second trigger. The purpose of this trigger is to give 1 gold per five kills using PlayerXKill integer, and to keep track of all the kills with PlayerXTotalKills. Hope I didn't lose you yet. Here's the final trigger:

Event: A Unit Dies
Condition: None
Action:
Wait 2 Seconds
Leaderboard - Change Player Value: Change the value of player 1 in last created leaderboard to Player1TotalKill (And repeat this action for each player)

The point of the last one was to update the kills, and is triggered when an unit is killed. I have not tested any of this, but I think they should work fine. If there's problems, post a message here, or PM me. Good luck
-Blue
 
Level 18
Joined
Mar 7, 2005
Messages
824
Thy for your help, but i was thinking about it by myself and found another way with the kills (every 5 kills is 1 gold) so i have made an trigger with easy funktion, and it works also gread, but mainly thanks for the leaderboard i havent used this before. But i have made a map long ago and somebody helped me by the multiboard but i still forget how it works so your help was very upseful for me :) If you want you can be a Beta tester in my map ( its a "copy" of the starcraft map: Starship Troopers, with the wc3 engine) Shortly starship troopers in 3d instead of 2d ^^ :)
 
Level 18
Joined
Mar 7, 2005
Messages
824
i thin i dont really need to PM you, because i have uploaded my beta on the side. its the starship troopers map, and its a beta version. it means you surely can play it but it could be buggy i hope not, but i cant promise you that. Whatever try it, it makes fun :) (but i know the long dl from b.net is hard, but for those who have dsl3mb or more it will be a good map ;))
 
Status
Not open for further replies.
Top