Calculate area covered with certain terrain type

Leazy

You can change this now in User CP.
Reaction score
50
Hello guys and merry christmas!

In my game I got a unit that changes terrain while walking, and I want to calculate the area in a region covered by this terrain after a certain time:

paintwars.png


So I want to calculate for exmaple (area covered with lordaeron dirt)/(total region area)

Thanks in advance!
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
You could simply use a variable. Whenever the terrain is changed, increase the value of the variable, and you can use that variable as the currently changed terrain area.
 

Leazy

You can change this now in User CP.
Reaction score
50
Yeah, good idea, but how do I get the maximum area to start with?
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
Since you're using preset regions, you could just count the number of tiles per region and use that.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top