• 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.

Table Help

Status
Not open for further replies.

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,287
I wrote some stuff in chat about this...
[16-34-45] :user: Dr Super Good: fasterdavid, you use triggers
[16-34-55] :user: Dr Super Good: variable to keep track of the score
[16-35-22] :user: Dr Super Good: a leaderboard for the score display
[16-35-40] :user: Dr Super Good: trigger "unit enters region" event
[16-35-44] :user: Dr Super Good: for the scoring
[16-36-01] :user: Dr Super Good: add some conditions to make sure it is an appropiate unit (eg not an ability dummy, or summon or something)
[16-36-20] :user: Dr Super Good: in the scoring trigger, after adding the score you test if it is equal to 10
[16-36-51] :user: Dr Super Good: if so, then run your "win" actions, which can either be to give people victory/defeat, or to reset everything etc

You will need 1 initialization trigger.
This trigger initializes the leaderboard/multiboard and variables as required. Due to the nature of the boards you might need to run this after map initialization (eg at 0.00 or 0.01 seconds after map start).

You will need N triggers for scoring where N is the number of rects (GUI regions) you want to score in. You could outsource the scoring functionality from each into a JASS function or another trigger using variables to pass arguments (GUI friendly).

The scoring functionality is to increment by 1 some score variables based on the owner of the entering unit. If it is per player use the player index as the index to the array. If it is per team then you will need to select an index based on which team the player is in.

After incrementing score you check if it is equal to or greater than 10. If so you win the appropriate players and lose the others. If you support rematches you can instead reset everything by clearing the current game state and re-initializing all triggers and trigger state.
 
Level 11
Joined
Jan 23, 2015
Messages
788
make a Score variable (integer) with array number - the number of players ingame, and then set that variable to Score + 1 every time a unit owned by a player enters the region,, and after that action, set the value for the owner of the unit to the Score variable, then check if Score is equal to 10, if it is, end the game..
first you need a leaderboard for this, create a leaderboard, and set all players in it, with Score as their value and label their name...
 
Status
Not open for further replies.
Top