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

APM Detector

Status
Not open for further replies.
Level 8
Joined
Jun 26, 2019
Messages
318
Hello all. I am thinking about the most advanced hardcore game. In the trigger system, or the JASS, how do you get the computers in game to detect the APM from all players with conditions and actions? Example.

If the computers detected 200+ APM from one of any players, or optional to be 4 of any players, or all players, then the computers will active the "hardcore" mode to get the computers to play harder as good as the players if they fight against computers.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,883
Make an Integer Array called APM and use it keep track of each player's apm.

Then make some triggers to detect "Actions" made by the Player (you would want to split this up into 2 triggers):

Events:
-Player X selects a unit/A unit is issued an order
Actions:
-Set PN = Player number of Triggering player/Owner of Triggering unit
-Set APM[PN] = APM[PN] + 1
-Wait 60 seconds
-Set APM[PN] = APM[PN] - 1

You would want to use local variables to keep track of PN after the Wait -> local udg_

Then from there you could add something like:
If APM[PN] >= 200 then "Activate hardcore mode"

Not sure what Activate hardcore mode entails but it could do something like turn on a bunch of triggers that add gold/lumber to the computers and give their heroes an increased experience rate.
 
Status
Not open for further replies.
Top