widelands-dev team mailing list archive
-
widelands-dev team
-
Mailing list archive
-
Message #02943
Re: ships + notifications
Good to hear you managed :)
I don't know the internals of the ships myself, maybe somebody else can
help.
21/10/2014 16:52, sgrìobh Tibor Bamhor:
> Thanks, but today I have some spare time and looked at this a bit and
> made a progress.
>
> So now AI can receive notification of types:
> - ship gained
> - port spot found
> - expedition waiting
>
> After some problems, AI can now build ports (I mean starting port),
> shipyard, start expedition, receive notifications of found spots and
> decide about building a port. And it this point it fails - it creates a
> stacked territory around planned port but nothing is done then. I have
> to investigate the internals ship.* more thoroughly. Or if anybody has
> an idea...
>
> Tibor
>
> 2014-10-20 16:36 GMT+02:00 Fòram na Gàidhlig <fios@xxxxxxxxxxxxxxxxxxx
> <mailto:fios@xxxxxxxxxxxxxxxxxxx>>:
>
> I can have a look at this next week and create some notifications
> for you.
>
> You should be able to create one for the "Expedition ready" and "Port
> Space found" messages wihtout too much trouble though. Just send it
> when the message is sent to the user. You can steal the code from the
> notification I created for the "out of resources" messages. Copy the
> code into a new Notification class and then create one when the message
> is sent.otification classes themselves aren't complicated if you
> Frankenstein them.
>
>
>
> 20/10/2014 13:15, sgrìobh Tibor Bamhor:
> > Hi,
> >
> > I started some works on seafaring in AI, so far AI can build port,
> > shipyards and keeps building ships.
> >
> > But AI just is not informed when new ship is created.
> >
> > What I need should be very similar to notifications about immovables,
> > typically buildings, when they are acquired, or lost; the code is
> here:
> >
> >
> http://bazaar.launchpad.net/~widelands-dev/widelands/trunk/view/head:/src/logic/immovable.cc#L1387
> >
> >
> > AI should receive not only information, but the object itself and
> store
> > it in own list (vector).
> >
> > So can somebody help me with creating such notifications?
> >
> > I am not familiar with seafaring, but I wonder are there messages
> for a
> > player when new ship is built or lost? It seems to me there are none.
> >
> > Other thoughts on seafaring: Ship "remembers" found port spots, so AI
> > will not need immediate notification when such spot is found,
> probably....
> >
> > Also I read about "expedition ready" notification, probably this one
> > would be useful for AI too.
> >
> > Any feedback is welcomed... :)
> >
> > Tibor
> >
> >
> >
> >
> > _______________________________________________
> > Mailing list: https://launchpad.net/~widelands-dev
> > Post to : widelands-dev@xxxxxxxxxxxxxxxxxxx
> <mailto:widelands-dev@xxxxxxxxxxxxxxxxxxx>
> > Unsubscribe : https://launchpad.net/~widelands-dev
> > More help : https://help.launchpad.net/ListHelp
> >
> >
> >
> > No virus found in this message.
> > Checked by AVG - www.avg.com <http://www.avg.com> <http://www.avg.com>
> > Version: 2014.0.4765 / Virus Database: 4040/8420 - Release Date:
> 10/20/14
> >
>
> _______________________________________________
> Mailing list: https://launchpad.net/~widelands-dev
> Post to : widelands-dev@xxxxxxxxxxxxxxxxxxx
> <mailto:widelands-dev@xxxxxxxxxxxxxxxxxxx>
> Unsubscribe : https://launchpad.net/~widelands-dev
> More help : https://help.launchpad.net/ListHelp
>
>
> No virus found in this message.
> Checked by AVG - www.avg.com <http://www.avg.com>
> Version: 2014.0.4765 / Virus Database: 4040/8431 - Release Date: 10/22/14
>
Follow ups
References