• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] At end of game, player with most gold wins.....

Status
Not open for further replies.
Level 1
Joined
May 15, 2007
Messages
88
I don't know how to make it like at the end of the game the player with the most money wins, please give me some help here....

Thank you.


Please say the easiest way to do it, I don't really know how to do it like people told further down, I'm no expert at this!

Edit: Fixed all double posts
 
Last edited:
Level 11
Joined
Jul 12, 2005
Messages
764
I don't have WE in front of me, but i can show you the way how to do it:

Set maxGold = 0
For each integer from 1 to 12
-Set curGold = Current gold of Player(Integer A)
-if curGold is greater than maxGold
--Set Winner = Player(Integer A)
--Set maxGold = curGold
Victory Winner blahblah

So you need two real (curGold, maxGold) and one player (Winner) variable.
 
Level 8
Joined
Jan 18, 2007
Messages
331
elles you can make a leaderboard and add 1 point to equal team for every gold they gain. then in the end just make a trigger that sorts out witch player that got the higest score. If you dont wath the teams to see the leaderbord just make a trigger: hide leaderbord. there=)
 
Level 1
Joined
May 15, 2007
Messages
88
Thanks, I'll try it soon, a bit busy now thought :)

EDIT:
I don't have WE in front of me, but i can show you the way how to do it:

Set maxGold = 0
For each integer from 1 to 12
-Set curGold = Current gold of Player(Integer A)
-if curGold is greater than maxGold
--Set Winner = Player(Integer A)
--Set maxGold = curGold
Victory Winner blahblah

So you need two real (curGold, maxGold) and one player (Winner) variable.





So what shall be the event, (And possibly condition) And action? After I have made the variables?

Set CurGold = (Real((Integrer((Real(((Matching player) Current Gold)))))) ?


Or should I put something else at matching player?

And I find leaderboards pretty hard :S
 
Last edited by a moderator:
Level 5
Joined
Jun 23, 2004
Messages
126
Hm...the way I use:

Code:
Integer Variable - HighestGold (Default 0)
Player Variable - Winner

  • Whos Da Winner?
  • Events
    • Time - Elapsed Time is 600.00 seconds
  • Actions
    • For Loop Integer A 1-12
      • Set HighestGold = Max( HighestGold, Player Property((Convert Player Index To Player(For Loop Integer A)), Current Gold))
      • If (All Conditions are true) Then do (Then Actions) Else do (Else Actions)
        • If - Conditions
          • (Player Property((Convert Player Index to Player(For Loop Integer A)), Current Gold) = HighestGold)
        • Then - Actions
          • Set Winner = Convert Player Index to Player (For Loop Integer A)
        • Else - Actions
    • Victory - Convert Player Index to Player (Winner)
Obviously the Event is up to you. And if you want multiple players to be able to win, (tie) go with something more like this.

  • Actions
    • For Loop Integer A 1-12
      • Set HighestGold = Max( HighestGold, Player Property((Convert Player Index To Player(For Loop Integer A)), Current Gold))
    • For Loop Integer A 1-12
      • If (All Conditions are true) Then do (Then Actions) Else do (Else Actions)
        • If - Conditions
          • (Player Property((Convert Player Index to Player(For Loop Integer A)), Current Gold) = HighestGold)
        • Then - Actions
          • Victory - Convert Player Index to Player (Convert Player Index to Player(For Loop Integer A))
        • Else - Actions
 
Level 1
Joined
May 15, 2007
Messages
88
Hm...the way I use:

Code:
Integer Variable - HighestGold (Default 0)
Player Variable - Winner

  • Whos Da Winner?
  • Events
    • Time - Elapsed Time is 600.00 seconds
  • Actions
    • For Loop Integer A 1-12
      • Set HighestGold = Max( HighestGold, Player Property((Convert Player Index To Player(For Loop Integer A)), Current Gold))
      • If (All Conditions are true) Then do (Then Actions) Else do (Else Actions)
        • If - Conditions
          • (Player Property((Convert Player Index to Player(For Loop Integer A)), Current Gold) = HighestGold)
        • Then - Actions
          • Set Winner = Convert Player Index to Player (For Loop Integer A)
        • Else - Actions
    • Victory - Convert Player Index to Player (Winner)
Obviously the Event is up to you. And if you want multiple players to be able to win, (tie) go with something more like this.

  • Actions
    • For Loop Integer A 1-12
      • Set HighestGold = Max( HighestGold, Player Property((Convert Player Index To Player(For Loop Integer A)), Current Gold))
    • For Loop Integer A 1-12
      • If (All Conditions are true) Then do (Then Actions) Else do (Else Actions)
        • If - Conditions
          • (Player Property((Convert Player Index to Player(For Loop Integer A)), Current Gold) = HighestGold)
        • Then - Actions
          • Victory - Convert Player Index to Player (Convert Player Index to Player(For Loop Integer A))
        • Else - Actions


There are for example no For Loop Integer A 1-12 in my editor :S
 
Level 11
Joined
Jul 12, 2005
Messages
764
It's "For each integer, do multiple actions".

Perhaps, you should read the rules, read tutorials, play around with the editor, and do not ask us to make every noobish trigger you can't make for yourself after 3 days of modding...

Nix_GR said I'm black-hearted. I think I'm just honest..
 
Level 1
Joined
May 15, 2007
Messages
88
BTW Yes, I'm using frozen throne.

I'm sorry.... :( But I have actually modded for some weeks now, it's just that everyone can't be good at everything, and integers is something that I simply SUX on :p And all those guides etc I find just don't got that part which I need (And I think my editor got bugs :S becuase there is NO FRIGGING TRIGGERING PLAYER AT CHAT STRING)


And think a bit before becoming halfway offensive... As I said, not everyone can be good at everything, I bet theres something in that editor you don't know all that well(At least have some problems with) either, or am I right? ;)
 
Last edited:
Level 11
Joined
Jul 12, 2005
Messages
764
Yes you're right.. For example, now i don't know how to use the advantages of the NewGen World Editor yet, that has many interesting new jass features that i've never heared of. But i don't start threads like "How to use structs?", or "What are libraries?"... (But i guess you don't even know what im talking about..) I try to gather as many info from the guides and readmes as i can, and try to figure things out myself.
You see the difference?
 
Level 1
Joined
May 15, 2007
Messages
88
Yes, but anyway, you are a bit more experienced than me too ;) (And I really don't need über advanced stuff at the maps I'm making ATM :p) But everyone got to be newb at a time, right?



And after all, I don't really find toolbox's trigger schematics looking like a noobish trigger..... I don't get it at all :S GRAH IT HURTSSS IN MY EYES!


I don't get this: ....
*Player Red* types a chat string containing X as an exact match.

I Don't get the *Player red*(Or all other presets(But lets not care about presets)) To read *Triggering player* I only got 3 options apart from presets, *Owner of unit*, *Owner of item*, *Conversion - Convert Player Index To player*
If it got to be some of the above, it got to be convert, BUT WHY DIDN'T BLIZZARD JUST PUT IN A STUPID TRIGGERING PLAYER OPTION LIKE ON MANY OTHER TRIGGERS! GAH!
It's getting frustrating that I sometimes have to use advanced and other options(Like that I didn't find how to add numbers to a variable, so instead I added one and one coin to player 12's coins and counted that XD)

EDIT:
ZOMG THIS IS GETTING FRUSTRATING :O
I don't get what to use when, integers, variables, reals, units etc :S
I'm reading guides but they just do it so frigging advanced :mad:
 
Last edited by a moderator:

Rui

Rui

Level 41
Joined
Jan 7, 2005
Messages
7,550
Please do NOT double-post. There is an Edit Post button. Use it to edit your posts.

This thread has been moved from the World Editor Help Zone to the Triggers (GUI) Forum. A redirection link has been left in the original forum to provide a conection between the original place and the new location of this thread. This redirection link will expire in 24 hours.
 
Status
Not open for further replies.
Top