[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [bos-dev] accessors of BW
- To: bos-dev@xxxxxxxx
- Subject: Re: [bos-dev] accessors of BW
- From: Jimmy Salmon <jsalmon3@xxxxxxxxx>
- Date: Wed, 26 Mar 2008 15:03:30 -0700 (PDT)
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: bos-dev-outgoing@xxxxxxxx
- Delivered-to: bos-dev@xxxxxxxx
- Delivery-date: Wed, 26 Mar 2008 18:03:37 -0400
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Message-ID; b=zZUPtMfd/Vt36FUTM7olb+wz5QPMZ1rPes21u3+BWYu/v4JlDOg/lNPfs7BzC7dTke0aOTwsqR9Be9RlSf+UcAYFVNpuH3m8O4PtUf71+i6/T+FbnIgfd2f+n2vAOcLzZDSa+GDh5l2ngnnJXOTY8yc/2y/EEr5ovi1lnlAAk2M=;
- Reply-to: bos-dev@xxxxxxxx
- Sender: owner-bos-dev@xxxxxxxx
As Feb said, the easiest way would be to write your code in Lua but if that's not an option you can modify the function InitLua in engine/stratagus/script.cpp to load the Lua IO module then pass information through files.
----- Original Message ----
From: Francois Beerten <francois.beerten@xxxxxxxxxxx>
To: bos-dev@xxxxxxxx
Sent: Wednesday, March 26, 2008 2:43:34 PM
Subject: Re: [bos-dev] accessors of BW
Bram Neijt wrote:
> First of, I'm not a Boswars developer, so there is probably a much
> easier way of doing this. But while you are waiting on the right
> answer, this might help.
>
> If you can do file io in lua[1], you could probably use a fifo [2]:
> create a fist-in-first-out file on disk and use lua the AI to write
> status information to that file and read commands from a fifo.
> Then have your program do the same.
>
> My 2 cents ;-)
> Bram
>
> [1] http://lua-users.org/wiki/FileInputOutput
> [2] man mkfifo
>
> On Wed, Mar 26, 2008 at 9:37 PM, Charles Clercq
> <charles.clercq@xxxxxxxxx> wrote:
>
>> Hi guys,
>>
>> I'm new in the mail list, so I hope my question won't be out of subject.
>>
>> For a project at school we have to develop a "black box" software which take
>> in "IN" some informations of the game (number of unit of the enemy/of us,
>> building ...), and in OUT some actions to do in the game (create
>> guys/buildings, path finding, ...). In fact this is an AI in live.
>> The first idea was to use the Lua functions, which seem to be really easy
>> to use and enough complete. The problem is that we can't take the
>> informations of the game, and give them to our application by Lua (like a
>> socket).
>> So my question is "Is there another means to obtain the informations of the
>> game, or the only one is the Lua ?"
>>
>> I hope I'm "understable"
>>
>> Best regards.
>>
>> Crahels.
>>
>> PS : Sorry for my English, I'm "just" French :p
>>
The Lua environment in Bos Wars does not have file access functions for
security reasons. There's no built-in support for this in the engine.
Why not write your "black box" in Lua and use it directly in a Lua script ?
Feb.