任务单 #44842

Lua: Missing Civ2 scripting API

开放日期: 2022-06-15 21:38 最后更新: 2024-08-26 07:19

报告人:
属主:
(无)
状态:
开启
组件:
里程碑:
优先:
5 - Medium
严重性:
5 - Medium
处理结果:
文件:

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.

任务单历史 (3/3 Histories)

2022-06-15 21:38 Updated by: ihnatus
  • New Ticket "Lua: Missing Civ2 scripting API" created
2022-06-28 03:00 Updated by: ihnatus
评论

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.

2024-08-26 07:19 Updated by: cazfi

Attachment File List

No attachments

编辑

Please login to add comment to this ticket » 登录名