← Back to team overview

widelands-dev team mailing list archive

Re: get a flag belonging to headquarters

 

On 20.07.2014, at 22:24, Tibor Bamhor <tiborb95@xxxxxxxxx> wrote:

> not in LUA, I need it for AI. I want to block fields within some radius around headquarters' flag - to prohibit buildings there. 
> 

Well, the answer is still contained though :). Have a look a lua_map.cc and get_buildings(). The way to get the information is through Player::get_building_statistics. 


> 
> 
> 2014-07-20 19:24 GMT+02:00 Holger Rapp <HolgerRapp@xxxxxxx>:
> 
> On 18.07.2014, at 13:14, Tibor Bamhor <tiborb95@xxxxxxxxx> wrote:
> 
> > Hi,
> >
> > I need to get a flag (or its coordinates) belonging to a headquarters on the very beginning of game.
> >
> > How should I do it?
> 
> In Lua?
> p1 = wl.Game().players[1]
> hq =  p1:get_buildings("headquarters")[1]
> print(hq.flag)
> 
> > Is it a headquarter a member of productionsites and type WAREHOUSE?
> 
> not a productionsite, but a warehouse.
> 
> 
> 

Attachment: smime.p7s
Description: S/MIME cryptographic signature


References