How to make a custom unit?

Contribute, display and discuss rulesets and modpacks for use in Freeciv here.
Post Reply
Sova173
Posts: 7
Joined: Tue Jan 23, 2024 8:50 am

How to make a custom unit?

Post by Sova173 »

What I really mean is that I'm having trouble creating a custom unit icon, specifically with the string graphic = "[NAME HERE]"

Who can help with this line?
Elefant
Hardened
Posts: 239
Joined: Sat May 28, 2022 3:55 am

Re: How to make a custom unit?

Post by Elefant »

The tileset will need to provide the specified graphic. If it is not present, the alt graphic will be used.
Civ 3 tileset: viewtopic.php?t=92953
3d Irrlicht desktop client development: viewtopic.php?t=92289&start=20
cazfi
Elite
Posts: 3335
Joined: Tue Jan 29, 2013 6:54 pm

Re: How to make a custom unit?

Post by cazfi »

Graphics are provided by the tilesets. The tileset defines tags for the sprites in it. See .spec files.

That ruleset "graphics" line just refers to a tag provided by the tileset.
Sova173
Posts: 7
Joined: Tue Jan 23, 2024 8:50 am

Re: How to make a custom unit?

Post by Sova173 »

Thanks, but how do I make a custom tag? Since I'm just starting out, I need to figure it out.
cazfi
Elite
Posts: 3335
Joined: Tue Jan 29, 2013 6:54 pm

Re: How to make a custom unit?

Post by cazfi »

Sova173 wrote: Sat Apr 19, 2025 7:43 pm Thanks, but how do I make a custom tag? Since I'm just starting out, I need to figure it out.
The tags are defined in the .spec files of the tileset.

See also doc/README.graphics
Sova173
Posts: 7
Joined: Tue Jan 23, 2024 8:50 am

Re: How to make a custom unit?

Post by Sova173 »

Error:
the “isophex” graphics set may not be compatible with the [NAME OF MY RULESET] ruleset There are no sprites for unit [MY UNIT] with the tag “[TAG]” and its alternatives “-” and “-”.


What am I supposed to do? I've been doing this shit for 20 minutes.
cazfi
Elite
Posts: 3335
Joined: Tue Jan 29, 2013 6:54 pm

Re: How to make a custom unit?

Post by cazfi »

If you just want to modify "isophex" tileset to be compatible with your custom ruleset with the new unit:

From isophex.tilespec "files" we see that it uses "trident/units.spec" and "trident/extra_units.spec" for units, so you should add your unit sprite to trident/extra_units.png and define the tag in trident/extra_units.spec.

Alternatively you could add completely new .png and .spec, and add it to isophex.tilespec "files" list.
Sova173
Posts: 7
Joined: Tue Jan 23, 2024 8:50 am

Re: How to make a custom unit?

Post by Sova173 »

I'm using an alternative, I'll let you know how it goes.
Post Reply