• 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 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?
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
set victorious = red
set victorious score = 0

loop 1 - 12
if victorious score < scorepoints[player]
set victorious = player, victorious score = scorepoints[player]
endif
endloop
 
Level 12
Joined
Jun 1, 2009
Messages
576
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....
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
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.
 
Level 12
Joined
Sep 11, 2011
Messages
1,176
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.
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
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.
Top