FLWL / aoe2-ai-module

Library to extend AI scripting capabilities in Age of Empires 2.
GNU Lesser General Public License v2.1
16 stars 6 forks source link

Positional arguments? #12

Open Overconfidence opened 3 years ago

Overconfidence commented 3 years ago

Hi! I'm trying to figure out how to get villagers to gather resources and I treid using a couple of commands that resulted in the same error: TypeError: init() takes 1 positional argument but 3 were given

The commands I tried to use were: action.UpRetaskGatherers() action.UpFilterStatus() action.UpFindResource()

Are these commands not implemented yet, or did I make a mistake somewhere?

I checked the airef website for commanding villagers to gather resources, but didn't find one that seemed promising. Is it complicated to control villagers or did I just overlooked a command?

01010100b commented 3 years ago

To make villagers gather resources using the built-in system you set strategic numbers food-gatherer-percentage etc. UpRetaskGatherers simply runs a retasking check, you should never have to do this manually. The commands UpFilterStatus and UpFindResource definitely work, as I am using these myself. I think your problem is unfamiliarity with the underlying scripting system, feel free to join the AI scripters discord: https://discord.gg/sGWMgGtQp9 As for the specific errors you're getting, I wouldn't know, I never encountered these - the commands work though, so there's something you're doing wrong.