Determine if unit will make metal from UnitDef
Moderators: hoijui, Moderators
- Silentwings
- Posts: 3720
- Joined: 25 Oct 2008, 00:23
Re: Determine if unit will make metal from UnitDef
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.
Re: Determine if unit will make metal from UnitDef
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.
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.