Industrial Centre Scope Conditions

Creation, discussion, and balancing of game content such as techs, buildings, ship parts.

Moderators: Oberlus, Committer

Post Reply
Message
Author
User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13603
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Industrial Centre Scope Conditions

#1 Post by Geoff the Medio »

I noticed a bunch of error messages in the AI logs like this

Code: Select all

2012-09-23 12:36:52,105 ERROR AI : Variable<double>::Eval unrecognized object property: RootCandidate.Population
I traced this to the scope condition of the Industrial Centre building, which uses the marco [[INFRA_CONDITION_INFRA]] which evaluates to

Code: Select all

INFRA_CONDITION_INFRA
'''Construction low = RootCandidate.Population * [[INFRA_PRODUCTION_PER_POP]] / ([[INFRA_PRODUCTION_PER_INFRA]])'''
This causes the error message because there's no test that selects only planet earlier in the enclosing And condition, so the scope evaluation is testing the Population of buildings located on planets that match the other conditions in the scope. Whenever such a macro is used, the script should have a Planet condition earlier in the And condition, to exclude buildings and avoid this error message. It looks like a few other buildings use this macro, or similar macros, which are assuming only planets (or only objects with certain other meters) are previously selected.

Post Reply