#44842: Lua: Missing Civ2 scripting API Open Date: 2022-06-15 15:38 Last Update: 2022-06-27 21:00 URL for this Ticket: https://osdn.net//projects/freeciv/ticket/44842 RSS feed for this Ticket: https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=44842 --------------------------------------------------------------------- Last Changes/Comment on this Ticket: 2022-06-27 21:00 Updated by: ihnatus Comment: Some ideas, doubt I'll code them in near time: as it was said, NOSCHISM is already doable, just maybe the AI sometimes needs a modifier of a desire to take other prayer's capital (we even have a apecial strategy mode for focusing on a capital used in the space race handling that though seems to work poorly). We can relatively easily make a method (Player):set_dipl_rel(string what, Player to_whom); again, a wonder triggering it needs some evaluation that shall depend on the player's current desire for the given pacts. The diplomatic blocker is a more interesting task. Maybe we can just make "NoDiplomacy" a targeted effect, but that would need more requirement types to test other_player factor properties. About the Lua solution, we can have an event "players_try_meet", but how it would decide if the meeting is blocked? I once made a patch that allowed to pass lua_Objects to events, so that some of them get tables from the caller and can modify them. Maybe a simpler way would be just reading second return value of the callback. It would be nice if AI and the human players could know before can they meet; so, the other option is making a script-controlled field in the struct player_diplstate that would tell it, and we can switch it off within the callback or before. We can, furtherly, control adding and removing clauses in a pact. AI should get some idea in can, say, an individual city be added to the treaty, and if it can't, what other clause can be modified to make it possible. But this is beyound this ticket and probably needs a fullscale Lua AI module. --------------------------------------------------------------------- Ticket Status: Reporter: ihnatus Owner: (None) Type: Feature Requests Status: Open Priority: 5 - Medium MileStone: S3_2 d3f Component: Scripting API Severity: 5 - Medium Resolution: None --------------------------------------------------------------------- Ticket details: Parts of Civ2 scripting language as described here not yet having any equivalent in Freeciv: NEGOTIATION - an event of starting talks with an ability to cancel the meeting. NOSCHISM - prevents a civil war (may be some switch to put in "city_destroyed" or "city_transferred" callback, though may just set cw probability to 0 and trigger it by scripts when needed) MAKEAGGRESSION - a method to cancel peace treaty (in general, something to manipulate diplomatic relations, Civ2 Great Wall effect maybe works like this. -- Ticket information of Freeciv project Freeciv Project is hosted on OSDN Project URL: https://osdn.net/projects/freeciv/ OSDN: https://osdn.net URL for this Ticket: https://osdn.net/projects/freeciv/ticket/44842 RSS feed for this Ticket: https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=44842