Communication with python
Moderator: Forum Moderators
Communication with python
Hello,
I'm an engineering student and I have a project of creating an AI for Wesnoth using Reinforcement Learning. Since python is generally the best when it comes to ML, we wan't to create the "brain" of our AI using python and use the LuaAPI to communicate with the game.
Initially, I wanted to use sockets to communicate between the python and the Lua but, since Wesnoth doesn't expose packages such as "require" to its Lua scripts, I don't know how to access to sockets or any other communication method.
Do you have any ideas as how to make a python local script and a Wesnoth Lua script communicate with each other, or if it is even possible to do so ?
Thanks a lot,
--
Clément "Dwerynith" de Araujo
Developper for "Jean Cloud AI"
I'm an engineering student and I have a project of creating an AI for Wesnoth using Reinforcement Learning. Since python is generally the best when it comes to ML, we wan't to create the "brain" of our AI using python and use the LuaAPI to communicate with the game.
Initially, I wanted to use sockets to communicate between the python and the Lua but, since Wesnoth doesn't expose packages such as "require" to its Lua scripts, I don't know how to access to sockets or any other communication method.
Do you have any ideas as how to make a python local script and a Wesnoth Lua script communicate with each other, or if it is even possible to do so ?
Thanks a lot,
--
Clément "Dwerynith" de Araujo
Developper for "Jean Cloud AI"
Jean Cloud Team
-
- Inactive Developer
- Posts: 503
- Joined: April 24th, 2016, 4:18 pm
Re: Communication with python
Use Lua instead.
If you find it is possible to communicate with Pyhton, let us know. We'll probably want to close it down.
If you find it is possible to communicate with Pyhton, let us know. We'll probably want to close it down.
I forked real life and now I'm getting merge conflicts.
Re: Communication with python
It was recently discussed https://forums.wesnoth.org/viewtopic.php?f=10&t=51061
- Pentarctagon
- Project Manager
- Posts: 5599
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Re: Communication with python
To add to what Tad_Carlucci said, Wesnoth's lua is intentionally limited in order to prevent user made content from being able to do malicious things, so it wouldn't be good if you were to find a way to do something like open sockets using only what's available by default.
Probably the best way would be for you to use the
Probably the best way would be for you to use the
--unsafe-scripts
option, which is mentioned in the thread Ravana linked.99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
take one down, patch it around
-2,147,483,648 little bugs in the code