FAForever Forums
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Login

    ACU's Being Counted as Naval Units

    Scheduled Pinned Locked Moved Modding & Tools
    5 Posts 3 Posters 520 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      Rama
      last edited by

      I have a script that is supposed to monitor if teams are building naval units, and spawn a response. For whatever reason, ACU's will begin being counted as naval units and trigger the response. This happens regardless if players are using vanilla ACUs or BlackOpsACUs.

      An example is in this replay, which triggers the naval response 18 minutes into gameplay.
      #22118629

      I confirmed it was the ACUs by running a script that would log and ping all units that had been added to the naval response monitor.

      I have since added exclusions for the ACUs, but they are still being counted as naval units. The script for the Naval Response is below.

      function MonitoringFunctionSeven() --Navy Counter
        local circle = ForkThread(function(self)
        repeat
          WaitSeconds(60)
          local totalT1Navy = CalculateTotalEnemyUnitsOfCategory(self, categories.MOBILE * categories.TECH1 * categories.NAVAL - categories.COMMAND - categories.SUBCOMMANDER - categories.CONSTRUCTION) 
          local totalExpNavy = CalculateTotalEnemyUnitsOfCategory(self, categories.MOBILE * categories.EXPERIMENTAL * categories.NAVAL  - categories.COMMAND - categories.SUBCOMMANDER - categories.CONSTRUCTION) 
          if totalExpNavy >= 1 then
            totalExpNavy = totalExpNavy - 1
          end	
          local totalT2Navy = CalculateTotalEnemyUnitsOfCategory(self, categories.MOBILE * categories.TECH2 * categories.NAVAL - categories.COMMAND - categories.SUBCOMMANDER - categories.CONSTRUCTION)
          local totalT3Navy = CalculateTotalEnemyUnitsOfCategory(self, categories.MOBILE * categories.TECH3 * categories.NAVAL - categories.COMMAND - categories.SUBCOMMANDER - categories.CONSTRUCTION)
          NavalPowerAI = 0
          NavalPowerAI = math.floor((totalExpNavy * 180) + (totalT3Navy * 60) + (totalT2Navy * 15) + (totalT1Navy * 3) + 0.5)	
        until GetGameTimeSeconds() > 20000 or won == true
        end)
      end
      
      1 Reply Last reply Reply Quote 0
      • JipJ
        Jip
        last edited by

        I'm not 100% convinced on the order of operations. Have you tried the following:

        local totalT1Navy = CalculateTotalEnemyUnitsOfCategory(
            self,
            (categories.MOBILE * categories.TECH1 * categories.NAVAL) -
            (categories.COMMAND + categories.SUBCOMMANDER + categories.CONSTRUCTION)
        )
        

        A work of art is never finished, merely abandoned

        R 1 Reply Last reply Reply Quote 0
        • R
          Rama
          last edited by

          Heh, I was just thinking of trying that. Will test it later. Any idea why ACUs would be counted as naval? Seems to occur after upgrading to T3.

          1 Reply Last reply Reply Quote 0
          • R
            Rama @Jip
            last edited by

            @jip

            So I screwed up my detection script, since I just reused some old code and missed changing a line. So ACUs were being falsely accused of the bug! Instead, it was the mobile SMD unit I added, and forgot to remove the naval tag.

            1 Reply Last reply Reply Quote 2
            • DDDXD
              DDDX
              last edited by

              I LOVE the CalculateTotalEnemyUnitsOfCategory! Wish I had known about it sooner. Very useful.

              1 Reply Last reply Reply Quote 0
              • First post
                Last post