• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

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 64
Joined
Aug 10, 2018
Messages
6,539
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