• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

Trigger Help

Status
Not open for further replies.
Level 12
Joined
Jun 1, 2009
Messages
576
Guys i making score system for my map and i have problem:

I have integer varible named "ScorePoints" it is array.
In this varible are saved points of all 12 players.....Now we coming to problem.

In the end of game i want to make trigger which can calculate which player have most points and claim him victorius....Can someone post trigger here?
 
set victorious = red
set victorious score = 0

loop 1 - 12
if victorious score < scorepoints[player]
set victorious = player, victorious score = scorepoints[player]
endif
endloop
 
I looking this and maybe i am wrong but looks like that trigger checks which player have enough points for victory...but i need trigger which finds which of 12 players have bigest score (most points)....

Example:

player 1 score = 10
player 2 score= 5
player 3 score = 8
player 4 score= 10
........................
this score is saved in integer array called "PlayerPoints" [player number]

So i need simple trigger which calculate which player have bigest amout of points in this integer..


I hope that you understand what i writed.....Also guys pls post trigger here....
 
I looking this and maybe i am wrong but looks like that trigger checks which player have enough points for victory...but i need trigger which finds which of 12 players have bigest score (most points)....

Example:

player 1 score = 10
player 2 score= 5
player 3 score = 8
player 4 score= 10
........................
this score is saved in integer array called "PlayerPoints" [player number]

So i need simple trigger which calculate which player have bigest amout of points in this integer..


I hope that you understand what i writed.....Also guys pls post trigger here....

thats exactly what i told you to do.
 
here

  • set victorious = red
  • set victorious score = 0
  • loop 1 - 12
  • if victorious score < scorepoints[player]
  • set victorious = player, victorious score = scorepoints[player]
  • endif
  • endloop
why are you so cold ? xDDD

  • Set victorious = Player 1 (Red)
  • Set victorious score = 0
  • For each integer Variable from 1 to 12 do multiple actions
    • Loop - Actions
      • If all conditions are true then do actions else do actions
        • If - Conditions
          • victorious score Less than scorepoints(Variable)
        • Then - Actions
          • Set victorious = Player(Variable)
          • Set victorious score = scorepoints(Variable)
        • Else - Actions
Variable is an 'Integer Variable'
Victorious is a 'Player Variable'
Victorious Score is an 'Integer Variable'

now you need to add your End the game event for those actions.
 
why are you so cold ? xDDD

  • Set victorious = Player 1 (Red)
  • Set victorious score = 0
  • For each integer Variable from 1 to 12 do multiple actions
    • Loop - Actions
      • If all conditions are true then do actions else do actions
        • If - Conditions
          • victorious score Less than scorepoints(Variable)
        • Then - Actions
          • Set victorious = Player(Variable)
          • Set victorious score = scorepoints(Variable)
        • Else - Actions
Variable is an 'Integer Variable'
Victorious is a 'Player Variable'
Victorious Score is an 'Integer Variable'

now you need to add your End the game event for those actions.

lol like he learns by copying triggers.
 
Status
Not open for further replies.
Back
Top