Page 1 of 1

Problem naming a unit sprite

Posted: Fri Jan 20, 2023 2:49 pm
by VulcanScout
Hi, 👋🏻
I cannot name certain units for my ruleset. I tried to rename the particular units to a more unique name, that works. I rewrote the complete units.spec file, with the sprite file names from the directory. I still get the error:
Error Message from loading the ruleset
Error Message from loading the ruleset
2023-01-19.png (5.71 KiB) Viewed 5681 times
The unit that causes the trouble is: 0, 4, "u.hmmwv".

Name in the spec file: "u.hmmwv", "modern/units/u_hmmwv"
Name in the units ruleset: graphic = "u.hmmwv"
My units selection
My units selection
modern_extra_units.png (44.62 KiB) Viewed 5681 times

Re: Problem naming a unit sprite

Posted: Fri Jan 20, 2023 3:54 pm
by Elefant
Did you add the spec file to the .tilespec file that defines the tileset?

Re: Problem naming a unit sprite

Posted: Fri Jan 20, 2023 9:03 pm
by cazfi
VulcanScout wrote: Fri Jan 20, 2023 2:49 pm Hi, 👋🏻
I cannot name certain units for my ruleset. I tried to rename the particular units to a more unique name, that works. I rewrote the complete units.spec file, with the sprite file names from the directory. I still get the error:
2023-01-19.png
The unit that causes the trouble is: 0, 4, "u.hmmwv".

Name in the spec file: "u.hmmwv", "modern/units/u_hmmwv"
Name in the units ruleset: graphic = "u.hmmwv"
modern_extra_units.png
Without seeing the files, I can only comment that at least the ruleset part seems to work as you expect. According to the error message, server has (correctly) requested "u.hmmwv" tag to be used.

Most likely this error comes from an attempt to load some other tileset than what you expect. (-> I'll look into adding tileset name to that error dialog).

Client logs, especially if you would run with a higher logging level, should help here. Which OS are you using? (Windows makes getting those logs a bit complicated)

Re: Problem naming a unit sprite

Posted: Fri Jan 20, 2023 9:47 pm
by cazfi
cazfi wrote: Fri Jan 20, 2023 9:03 pm(-> I'll look into adding tileset name to that error dialog).
-> https://osdn.net/projects/freeciv/ticket/46558

Re: Problem naming a unit sprite

Posted: Sat Jan 21, 2023 1:18 am
by cazfi
VulcanScout wrote: Fri Jan 20, 2023 2:49 pmName in the spec file: "u.hmmwv", "modern/units/u_hmmwv
Missed that part earlier. That line makes no sense in an attempt to name sprite at position 0, 4 of the grid - rather it seems like an attempt to load the sprite from a separate file.

Re: Problem naming a unit sprite

Posted: Sun Jan 29, 2023 2:45 pm
by VulcanScout
Elefant wrote: Fri Jan 20, 2023 3:54 pm Did you add the spec file to the .tilespec file that defines the tileset?
I did. However, the .spec files are okay. However, the image files are not loaded though :/
I work with two open windows. To the left, my own ruleset and on the right, another ruleset as example.
What I don't need to write, is copied via drag and drop from right to left.

My .tilespec file from the data directory
files =
; Amplio2 graphics... from amplio2.tilespec
; "amplio2/units.spec", ; Defined in /modern/units.spec
"modern/units.spec",
"modern/modern_units.spec",
"modern/more_units.spec",
"modern/extra_units.spec", ; Replacement graphics from amplio2/extra_units
"modern/buildings/buildings-large.spec",
"modern/wonders/wonders-large.spec",
"modern/terrain/terrain3.spec" ; New Resources: i.e. Coffee and Salt

Defined new graphics
[extra]
sprites = {
"tag", "file"
"ts.coffee", "modern/terrain/ts_coffee"
"ts.rice", "modern/terrain/ts_rice"
"ts.salt", "modern/terrain/ts_salt"
"ts.uranium", "modern/terrain/ts_uranium"
}

Here's two examples:

Extra Resource: Coffee
Image uses coal
2023-01-27__resource_coffee_present.png
2023-01-27__resource_coffee_present.png (7.72 KiB) Viewed 5586 times
Resource image should be using coffee beans
ts_coffee.png
ts_coffee.png (1.79 KiB) Viewed 5586 times
Unit: Delta Force (type)
Image uses paratroopers
2023-01-27__unit_airassault_present.png
2023-01-27__unit_airassault_present.png (6.77 KiB) Viewed 5586 times
Image should be using another sprite
u_air_assault.png
u_air_assault.png (1.46 KiB) Viewed 5586 times
For purpose, I created a stripped down ruelset version, no extra graphics used.

🖖🏻

Re: Problem naming a unit sprite

Posted: Sun Jan 29, 2023 2:51 pm
by VulcanScout
Hi,
cazfi wrote: Fri Jan 20, 2023 9:03 pm Client logs, especially if you would run with a higher logging level, should help here. Which OS are you using? (Windows makes getting those logs a bit complicated)
How can I activate client logs, I have both: Windows and a VM with Linux? Copying between should not be a problem

🖖🏻

Re: Problem naming a unit sprite

Posted: Sun Jan 29, 2023 3:05 pm
by Elefant
If you run the client with the terminal in linux, you should get a lot more information about the error. On windows, the terminal disconnects, so you would have to find a different terminal that doesn't. The clang64 shell from the freeciv development environment works on windows.

Re: Problem naming a unit sprite

Posted: Sun Jan 29, 2023 10:39 pm
by cazfi
The very first thing I would check is that you are using the tileset you think you're using.

On client: Help -> About Current Tileset

You should have distinct name for your tileset defined in the .tilespec for this to give useful info.