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

I require some CP System help!

Status
Not open for further replies.
Level 2
Joined
Jan 12, 2014
Messages
6
Hello

So I've been working on this map and I have had problems with creating a Control Point system for a long time. The Control Point system I am using now works BUT it causes lag in the map every time when the income timer starts over and it gives the players gold.

attachment.php


attachment.php


attachment.php


From what I've read this set "bj_wantDestroyGroup = true" is supposed to stop the lagging / leaking. Am I missing something? Also I don't mind if you recommend a different Control Point system but I will need instructions how to do it (Use pictures if you can).

Thanks for your time and If you manage to help me, I will gladly give you credit!
 
Level 2
Joined
Jan 12, 2014
Messages
6
  • Income 60g
    • Events
      • Time - Income expires
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Unit-type of (Matching unit)) Equal to Control Point 60g/min) and ((Owner of (Matching unit)) Equal to (Picked player)))) and do (Actions)
            • Loop - Actions
              • Player - Add 60 to (Picked player) Current gold
Don't the pictures work for you or did you just want the trigger like this?
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
Yes, it's better to post triggers this way, as it's not either too big (as in big resolution) or with low details as most pictures are (and I don't need to load the picture :) )

I don't know what could be causing the lag (only if there was a problem with neutral players, as these do count in "all players" as well).
The causes that came to my mind may be:
a) It could be that this trigger, in conjunction with some other trigger may cause lag.

b) Other option may be that it makes too much function calls. Right now the loop runs 16 x "Number of Control Point 60g/min" units (There are 16 players in "All players).

c) It may also be that you pick all units in playeable map area 16 times and filter them... if there are way too many unit, it may take a while to filter them all.



There are ways to simplify this trigger:
a) Just pick Every unit in map (where matching unit-type = 60g/min) and add 60 gold to (owner of (picked unit)). Don't iterate through All players as you do now, as it's not needed.

b) Make unit group variable (for example "CP_group") and upon map initialization add all Control Point units in it. Then you will just iterate through constant unit group, instead of creating new one over and over. Of course, using this way you must not destroy the group, else you won't be able to use it again.

Personally, I would stick with method b.
 
Status
Not open for further replies.
Top