Currently Online

Latest Posts

Topic: diplomatic function

Ron_of_Nord
Avatar
Topic Opener
Joined: 2024-04-20, 23:43
Posts: 54
OS: Windows
Version: 1.2.1
Ranking
Likes to be here
Location: Land_down_under
Posted at: Yesterday 06:45

Hi folks, I've been searching the Lua interface documents but couldn't find a function that allowed a script to use diplomancy. I was thinking along the lines of trading between two allies ( for a scenario) but couldn't find a function to give the diplomatic status 'in script' Maybe I've missed something but I couldn't find such a thing in the Lua documents. I know the AI players can switch teams at any moment, but with diplomacy off, an AI player stays int the team it's in.What I want to do is have the player discover an AI tribe, team up with them and begin to trade goods between them. I already have the trade model worked out but I cant find a function in the lua side that can tell me the diplomatic status of an AI player in the lua script. Getting the actual trade doesn't actually seem that hard but it might be.


The aussies are coming, ya ho! ya ho!

Top Quote
Nordfriese
Avatar
Joined: 2017-01-17, 18:07
Posts: 2084
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: Yesterday 10:08

To change teams, you can use the wl.game.Player.team property.

For trading, I point to https://codeberg.org/wl/widelands/pulls/4781 face-smile.png


Top Quote
Ron_of_Nord
Avatar
Topic Opener
Joined: 2024-04-20, 23:43
Posts: 54
OS: Windows
Version: 1.2.1
Ranking
Likes to be here
Location: Land_down_under
Posted at: Yesterday 21:15

Thanks, I must have missed that, I'll have another good read of the documents on saturday when I have more time. I'll also have another read of those trading notes.


The aussies are coming, ya ho! ya ho!

Top Quote