Determine if unit will make metal from UnitDef - Page 2

Determine if unit will make metal from UnitDef

Here is where ideas can be collected for the skirmish AI in development

Moderators: hoijui, Moderators

User avatar
Silentwings
Posts: 3720
Joined: 25 Oct 2008, 00:23

Re: Determine if unit will make metal from UnitDef

Post by Silentwings »

Ok, done. Each metal maker has a GameRulesParam called unitName_mm_capacity and the conversion ratio is called unitName_mm_ratio. Here unitName is the name from the unitDef. If nil, assume 0. These numbers are constants.
byronwall
Posts: 3
Joined: 12 Nov 2014, 04:15

Re: Determine if unit will make metal from UnitDef

Post by byronwall »

One more item related to this question. I went ahead and added in the code I need for the AI to build metal makers. The question is: how does the metal maker code work for a game that is AI only? I am curious because it looks like my AIs are building metal makers but not getting any of the resultant metal from them. There is normally plenty of energy for them to do the conversion.

I went ahead a played a game against my AI and noticed that the only indication I am getting metal is by checking the metal income. It looks correct for me. When I do the same thing in a game that is all AI, I do not observe the income changing any with metal makers built.

Is there something I am missing? I have the AI turn the maker on (setOn) after it is finished so I believe it should work.
Post Reply

Return to “AI”