Ticket #47829

Lua: Get counter value

Open Date: 2023-04-10 10:33 Last Update: 2024-03-09 17:49

Reporter:
Owner:
Type:
Status:
Closed
Component:
MileStone:
Priority:
5 - Medium
Severity:
5 - Medium
Resolution:
Fixed
File:
5

Details

Add lua method to get city counter value, e.g., "Counter:get_value(City)". Depends on #47827

Ticket History (3/19 Histories)

2023-04-10 10:33 Updated by: cazfi
  • New Ticket "Lua: Get counter value" created
2024-02-18 02:34 Updated by: lachu
Comment

Reply To cazfi

Add lua method to get city counter value, e.g., "Counter:get_value(City)". Depends on #47827

I think it is done. Maybe reuse code from scenario? Scenario to conquer city and kept it for some time is great fun, but scenario should be modified, like time of keeping control over city to achieve victory, making default owner of Constantinopol a barbarian player, etc.

2024-02-18 02:34 Updated by: lachu
Comment

Reply To cazfi

Add lua method to get city counter value, e.g., "Counter:get_value(City)". Depends on #47827

I think it is done. Maybe reuse code from scenario? Scenario to conquer city and kept it for some time is great fun, but scenario should be modified, like time of keeping control over city to achieve victory, making default owner of Constantinopol a barbarian player, etc.

2024-02-18 03:22 Updated by: cazfi
Comment

The patch tries to modify file server/scripting/api_server_counters.c that does not exist.

Likely this method (to READ counter value) should be in the common/ code. Also the client knows the counter values.

2024-02-18 03:56 Updated by: cazfi
Comment

Reply To cazfi

The patch tries to modify file server/scripting/api_server_counters.c that does not exist.

That's being added by #47828

But this is still valid point:

Likely this method (to READ counter value) should be in the common/ code. Also the client knows the counter values.

2024-02-19 00:18 Updated by: lachu
  • File 0001-OSDN-47829-S-awomir-Lach-slawek-lach.art.pl.patch (File ID: 13702) is attached
2024-02-19 00:19 Updated by: lachu
  • File 0001-OSDN-47829-S-awomir-Lach-slawek-lach.art.pl.patch (File ID: 13702) is deleted
2024-02-19 00:19 Updated by: lachu
Comment

Reply To cazfi

Reply To cazfi

The patch tries to modify file server/scripting/api_server_counters.c that does not exist.

That's being added by #47828 But this is still valid point:

Likely this method (to READ counter value) should be in the common/ code. Also the client knows the counter values.

0001-OSDN-47829-S-awomir-Lach-slawek-lach.art.pl.patch(2KB)
Implementation - move to common code

It now requires another patch. I wrote number of ticket in comment of patch.

2024-02-24 11:44 Updated by: cazfi
Comment

Reply To lachu

It now requires another patch. I wrote number of ticket in comment of patch.

#47827? That has been closed already, but this patch does not apply. You may have based this on older version of #47827 than what got accepted.

2024-02-24 19:59 Updated by: lachu
Comment

2024-02-24 19:57 Updated by: lachu

File 0001-OSDN-47829-S-awomir-Lach-slawek-lach.art.pl.patch (File ID: 13704) is attached

I do

git switch --detach origin/main git switch -c NAME_OF_NEW_BRANCH git am 0001-OSDN-47829-S-awomir-Lach-slawek-lach.art.pl.patch

It applies.

2024-02-24 20:01 Updated by: lachu
Comment

Reply To cazfi

Reply To lachu

It now requires another patch. I wrote number of ticket in comment of patch.

#47827? That has been closed already, but this patch does not apply. You may have based this on older version of #47827 than what got accepted.

See above. But test patch has one bug. When nobody conquers Portugal city in first turn, game ends and I cannot click next turn. Maybe problem is I set Poe player as reserved?

(Edited, 2024-02-24 20:03 Updated by: lachu)
2024-02-25 22:44 Updated by: lachu
Comment

Reply To cazfi

Reply To lachu

It now requires another patch. I wrote number of ticket in comment of patch.

#47827? That has been closed already, but this patch does not apply. You may have based this on older version of #47827 than what got accepted.

Sorry for miss-clarification. I apply never patch, which I attach:

0001-OSDN-47829-S-awomir-Lach-slawek-lach.art.pl.patch(2KB)
Should apply.
2024-03-02 11:13 Updated by: cazfi
  • Resolution Update from None to Accepted
  • Owner Update from (None) to cazfi
2024-03-09 17:49 Updated by: cazfi
  • Resolution Update from Accepted to Fixed
  • Status Update from Open to Closed

Attachment File List

Edit

Please login to add comment to this ticket » Login