The function xsGetObjectCount() has a range that is too large and the information obtained is inaccurate

:arrow_forward: GAME INFORMATION

:point_down: These details are CRITICAL; DO NOT skip them or your issue may not be reviewed.

  • GAME BUILD #: All versions
  • GAME PLATFORM: Steam
  • OPERATING SYSTEM: Windows 10

:arrow_forward: ISSUE EXPERIENCED

:point_down: DESCRIBE THE ISSUE IN DETAIL (below). LIMIT TO ONE BUG PER THREAD.
xsGetObjectCount() can get the quantity in time when the unit is generated, but when the unit dies, it needs to wait for the death animation to finish playing before losing the quantity. This is a great lie

:arrow_forward: FREQUENCY OF ISSUE

:point_down: How often does the issue occur? CHOSE ONE; DELETE THE REST!

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

:arrow_forward: REPRODUCTION STEPS

:point_down: List CLEAR and DETAILED STEPS we can take to reproduce the issue ourselves… Be descriptive!

Here’s the steps to reproduce the issue:

  1. Place a house
  2. Use the script to call the following code
    The purpose of this code is to always detect whether you own a house, and if you do, it will always send a message
    void get_number()
    {
    int a=xsGetObjectCount(1,70);
    if(a>=1)
    {
    ############################ }
    }
    3.Test map, DEL house, observation information shows that it will continue until the house collapses completely

:arrow_forward: EXPECTED RESULT

:point_down: What was SUPPOSED to happen if the bug you encountered were not present?

This issue made the detection very unstable, and I had to compromise and remove or set the death animation to 0, which hindered further development of the game

:arrow_forward: IMAGE

:point_down: ALWAYS attach a PICTURE (.jpg, .png, .gif) or VIDEO (.mp4, YouTube link) that highlights the problem.
Part of the code is blocked, I can only send out images:
)KTSV21T%U40JP0O_LA%NJH

:arrow_forward: GAME FILES (SAVE / RECORDING)

:point_down: Attach a SAVE GAME (.aoe2spgame) or GAME RECORDING (.aoe2record) of the match where you encountered the issue. Link it below if using an external file service.