Project

General

Profile

Actions

Feature #1451

closed

Lua API: specialist class

Added by Alexandr Ignatiev 12 days ago. Updated 4 days ago.

Status:
Closed
Priority:
Normal
Category:
Scripting API
Target version:
Start date:
05/26/2025
Due date:
% Done:

30%

Estimated time:

Description

Add the missing Specialist class.

This patch is independent of #1375 but required for its progress in #1399.


Files

lua-specialist.patch (7.48 KB) lua-specialist.patch Alexandr Ignatiev, 05/27/2025 01:35 AM
lua-specialist-nullptr.patch (7.5 KB) lua-specialist-nullptr.patch Alexandr Ignatiev, 05/27/2025 11:40 PM

Related issues 2 (2 open0 closed)

Blocks Feature #1399: Lua API: specialists controlIn ReviewMarko Lindqvist05/17/2025

Actions
Blocks Feature #1464: Lua API: minimal specialist controlIn ReviewMarko Lindqvist05/28/2025

Actions
Actions #1

Updated by Marko Lindqvist 12 days ago

Actions #2

Updated by Alexandr Ignatiev 12 days ago

Here I want to change api_game_methods.[ch], is NULL->nullptr change close there?

Actions #3

Updated by Marko Lindqvist 12 days ago

api_game_methods.[ch] nullptr patch has not yet been made, so feel free to make this patch first.

#1399 is currently targeted to S3_3, related to my comment there that we might want to have lua api for regular specialists also in the older branch. This ticket is now targeted to S3_4. Which one we should change?

Actions #4

Updated by Alexandr Ignatiev 12 days ago

Marko Lindqvist wrote in #note-3:

#1399 is currently targeted to S3_3, related to my comment there that we might want to have lua api for regular specialists also in the older branch. This ticket is now targeted to S3_4. Which one we should change?

This patch would well go to S3_3 and editing API from #1399 may be left for S3_4. It's not much useful without superspecialists.

Actions #5

Updated by Alexandr Ignatiev 11 days ago

Made a patch that should apply to both. Let's make granular and single-target patches. This one only defines the class and makes find/name/id basics. I think we can then make a bit of API accessible for S3_3, just to auto-toggle the specialists that fall out of their reqs if the ruleset author wants so. Then #1399 will add API related to superspecialists.

Based over #1458.

Actions #6

Updated by Marko Lindqvist 11 days ago

  • Target version changed from 3.4.0-d3f to 3.3.0-d3f
Actions #7

Updated by Marko Lindqvist 11 days ago

Please use nullptr instead of NULL, especially in api_game_find.c that is already otherwise unified to nullptr.

nullptr can be used in code that is not going to branches older than S3_3. For patches that are going also to older branches, we still have to use NULL (or to make separate patch for newer branches)

Actions #8

Updated by Alexandr Ignatiev 10 days ago

Marko Lindqvist wrote in #note-7:

Please use nullptr instead of NULL, especially in api_game_find.c that is already otherwise unified to nullptr.

nullptr can be used in code that is not going to branches older than S3_3. For patches that are going also to older branches, we still have to use NULL (or to make separate patch for newer branches)

Understood. Have you applied api_game_find patch to the repo?

Actions #9

Updated by Marko Lindqvist 10 days ago

Alexandr Ignatiev wrote in #note-8:

Understood. Have you applied api_game_find patch to the repo?

git log origin/main common/scriptcore/api_game_find.c

commit 3b77a0ea701e9ec023b61526dbdc063d977ced16
Author: Marko Lindqvist <>
Date: Sat May 3 11:13:08 2025 +0300

api_game_find.c: Replace NULL with nullptr
See RM #1361
Signed-off-by: Marko Lindqvist &lt;&gt;
Actions #10

Updated by Alexandr Ignatiev 10 days ago

Thanks! remade the patch.

Actions #11

Updated by Marko Lindqvist 10 days ago

  • Blocks Feature #1464: Lua API: minimal specialist control added
Actions #12

Updated by Marko Lindqvist 10 days ago

  • Status changed from New to In Review
  • Assignee set to Marko Lindqvist
Actions #13

Updated by Marko Lindqvist 4 days ago

  • Status changed from In Review to Closed
Actions

Also available in: Atom PDF