# [Scenario Editor] Trigger effect “Modify Attribute” - Editing Population attribute is buggy

### GAME INFORMATION

• GAME BUILD #: 101.102.28520.0
• GAME PLATFORM: Steam
• OPERATING SYSTEM: Windows 10

### ISSUE EXPERIENCED

When using the trigger “Modify Attribute” to edit the unit’s Population attribute, when the result is a non-integer number, the game will treat it as zero.

Edit: Every time using Trigger effect Modify Attribute to edit the unit’s Population attribute, the game seems like will reset the value to 0 first, then execute the trigger. (can also see my comment #4)

(Note for those who don’t know: A unit needs a negative value of Population cost to require population space. a normal unit should be -1, Karambit Warrior is -0.5. While a building having positive value = gives population space, the house is 5. And we can’t put negative numbers or non-integers into the trigger so we need to do it mathematically.)

Example 1:

1. Set Longbowman’s population to 0
2. Subtract 1
3. Divide 2
• Expected result: Longbowman occupies 0.5 pop space (just like Karambit Warrior)
• Actual result: Longbowman occupies 0 pop space

Example 1.1:

1. Subtract Longbowman’s population by 1
• Expected result: (-1) - 1 = -2 = Longbowman occupies 2 pop space
• Actual result: Longbowman occupies 1 pop space

Example 1.2:

1. Subtract Longbowman’s population by 2
2. Subtract 2 again
• Expected result: (-1) - 2 - 2 = -5 = Longbowman occupies 5 pop space
• Actual result: Longbowman occupies 2 pop space

The only explanation I can come up with is that every time using Trigger effect Modify Attribute to edit the population, the game somehow resets the value to 0 first, then executes the effect.

So,
Example 1 is actually (0) / 2 = 0,
Example 1.1 actually (0) - 1 = -1,
Example 1.2 actually (0) - 2 = -2,
That explains all the results.

When using the trigger “Modify Attribute” to edit the building’s Population attribute, It’s a mess. Allow me to explain with examples:

Example 2:

1. Set Pavilion A population to 0
2. Add (x = any random positive integer number)
• Expected result: Pavilion A now provide x pop space.
• Actual result: Pavilion A now provide (x + 10) pop space, and when it is destroyed, the pop space drops by only x, extra 10 pop space is still available, even though I have zero buildings.

Example 3:

1. Set Pavilion A population to 0
3. Divide 2
• Expected result: 1 Pavilion A provide 5.5 pop space, 2 Pavilions provide 11 pop space
• Actual result: 2 Pavilions provide 64 pop space, and when either one/ both of them are destroyed, the pop space never drop.

I can’t figure out the logic behind it.

I guess it’s a form of software protection so it won’t have to handle non-integer numbers and prevent bugs, but still, I just want to make it similar to Karambit Warrior.

I heard that the “Population” attribute is not a real attribute, so if it’s a manufactured tool, I hope it gets fixed. It will be useful for custom scenario creators if done correctly.

### FREQUENCY OF ISSUE

• 100% of the time / matches I play (ALWAYS)

### REPRODUCTION STEPS

1. Get into the Scenario Editor
2. Using the trigger effect “Modify Attribute” to edit population attribute, try different numbers, or recreate the examples above. Can also download my scenario below.
3. Test the scenario

### EXPECTED RESULT

• The game should handle the Population attribute properly, negative value to require population space. positive value to give population space.
• Should not reset Population value to 0 without permission.
• Should be able to produce the correct result of math.
• When the building is destroyed, all of the population space it provided should be gone.

### IMAGE

Screenshot of Example 1 & Example 3:

• Expected Longbowman take 0.5 pop space, but take 0 instead
• Expected 2 Pavilions provide 11 pop space, but end up providing 64 pop space and never drop.

### GAME FILES (SAVE / RECORDING)

Pop test.aoe2scenario (1.6 KB)

Now I heard the new Georgians civ have a UT to make cavalry cost -15% population space, so each cavalry unit costs 0.85 pop space? proof that the game is capable of handling non-integer numbers, and It will be decent if we can do a similar thing in Scenario Editor!

hope it gets fixed soon…

Hey,

First off (not a fix just a remark) For Example 1: your manipulation doesn’t make sense to me. Why do you set the Population cost to 0 in the first place, and then substract one to expect 0.5 by dividing by 2?
Base is 1, keep it as such, and just divide it by 2, so it becomes 0.5.

Now about the bug, how I tested it:

• The current “Divide” option doesn’t actually “divide” but it “multiplies”.

• The “Add” and “Substract” options do absolutely nothing.

• The “Multiply” option actually multiplies any value by 0, rendering all results 0.

According to AoE2DE UGC Guide, the Population attribute needs to be a negative number to take pop space, and positive number give pop space. Check the data set with AGE, a normal unit’s population value is indeed -1, and a house is 5. (But again, “population” is not a real attribute, but let’s skip the detail)

We can’t put negative numbers or non-integers into trigger, so I subtract then divide. This method works fine with other attributes. such as Projectile Arc, Movement speed, etc

Why did I set the value to 0 at first - it’s just a way/habit for me to ensure the result value will be what I wanted, as sometimes I might not know the starting value. I do agree it seems unnecessary in this case.

Then I have done some quick tests again, and found another problem:

• Subtract a unit’s population by 1, expected (-1) - 1 = -2 = taking 2 pop spaces, but only cost 1 pop space.

• Subtract a unit’s population by 2, it take 2 pop spaces.

• Subtract a unit’s population by 2, then subtract 2 again, expected to take 4 pop spaces, but it still take only 2 pop spaces.

The only explanation I can come up with: Every time edit the population, the game somehow resets the value to 0 first, then executes the effect. That would also explain why Multiply and Divide not work anymore.

Still, I have no idea what happened to the buildings.

My take, just like the absent Mill in Castle Age in the editor, and most of these bugs are tied to the current build the devs use to make the next DLC, and it will hopefully get fixed in the upcoming patch. If not, we have to dress the list of all these to keep track.

So far I have:

• Replace Object effect: HP does not scale.
• Replace Object effect/Gaia units: HPs are affected by HP technologies, and scale/heal beyond HP limit.
• Mill is absent from the Buildings list, and already placed mills are replaced graphically by a Folwark.
• Beach terrain textures are bugged when placing water terrain, and stuck to default beach type, even when “None” is selected.
• Population Attribute is bugged
1 Like

Good news that this will be fixed next update! hooray!

Source: October PUP patch note

Praise the gods!

You can see this picture,the officials makes it so complex.But the answer you want for population.You can use the translation to read it.Please use more script call XS not to use modify the attribute,it only can use int not float,so rubbish!

2 Likes

Fortunately, I can read Chinese but the math gives me a headache. Never expect such complicated math for a simple feature.

The population is not bug,because you cannot use float in modify attribute,only int can be used.The number in game will be rounded while calculating so it will has tons of bugs.So many attributes such as moving speed or blast radius and so on only use float not int in the AGE but modify attribute cannot do it,
Give up the rubbish modify attribute and give a hug on script call (XS language) is the best way for you,man!

1 Like

It can, but you need to do something like set the value to 0 first, subtract 3, then divide 2, just to get -1.5

And it works on other attributes. I was once playing with the Projectile Arc, and the values were very small and negative, maybe like -0.2 or -0.05, and the game is totally capable of handling it, so I wonder why it can’t when it comes to population.

Still, the ideal solution will be just to allow us to put float and negative value into the trigger, hope it will be changed in future…

But sure I will take a look on XS, thank you!

1 Like

I have wrote some articles for how to use XS in AOE2DE,there is rare for someone can clearly explain the AGE and how XS makes wonderful effect that other trigger effects cannot do it,such as the real random number,class modifying,the former Burgundy Vineyard and so on. We hate the only int support in scenario editor,it has made us a big trouble for us.

1 Like

Sorry for digging up my old thread, I know this is definitely not an urgent bug that needs to be fixed immediately, but please put it on the list!