naming a new unique character
Moderator: Forum Moderators
Forum rules
- Please use [code] BBCode tags in your posts for embedding WML snippets.
- To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
-
- Posts: 26
- Joined: April 1st, 2024, 10:35 pm
naming a new unique character
Good day to you ladies and gents. So basically i made a character that is unique (in a sense that he is an important character for me at least) so it should have a name and one name only.
But he is of race human. So every time i create it with (DEBUG -> create unit) or any other way really (like recruiting), his name is generated as a random human name.
My question is, is it possible to make his name constant, right in the unit's .cfg? Because when I put there
it gives me a character with type notNicholasCage, with a randomly generated human name, and in the unit description in game is notNicholasCage(Badass)
I want him to be race human, type badass, with the constant name notNicholasCage.
I tried "unrenamable=yes" since in this way the units are called in scenarios and there is required to have the unique name every time.
Do i need to create another totally unique race just for this character? I mostly sure there should be something less redundant than that.
BTW, is it possible in the data\core\macros\names.cfg to put an if/then clause that checks the id for example and give it always the same name?
And if yes, can you please show how? bc im not good with WML
But he is of race human. So every time i create it with (DEBUG -> create unit) or any other way really (like recruiting), his name is generated as a random human name.
My question is, is it possible to make his name constant, right in the unit's .cfg? Because when I put there
Code: Select all
[unit_type]
id=Badass
name= _ "notNicholasCage"
unrenamable=yes
race=human
...
I want him to be race human, type badass, with the constant name notNicholasCage.
I tried "unrenamable=yes" since in this way the units are called in scenarios and there is required to have the unique name every time.
Do i need to create another totally unique race just for this character? I mostly sure there should be something less redundant than that.
BTW, is it possible in the data\core\macros\names.cfg to put an if/then clause that checks the id for example and give it always the same name?
And if yes, can you please show how? bc im not good with WML
Re: naming a new unique character
You should use [unit] for such use case.
-
- Posts: 26
- Joined: April 1st, 2024, 10:35 pm
- Spannerbag
- Posts: 735
- Joined: December 18th, 2016, 6:14 pm
- Location: Yes
Re: naming a new unique character
[unit_type] defines a type of unit (such as Dwarvish Fighter or Elvish Marksman) not a specific [unit] (also mentioned here).
Here's an example of unit creation from one of my campaigns, hope it helps!
Good luck!
Cheers,
-- Spannerbag
Here's an example of unit creation from one of my campaigns, hope it helps!
Code: Select all
[unit]
side=2
type=Orcish Ruler
id=Bohsun
x,y=10,12
name=_"Bohsun"
unrenamable=yes
canrecruit=yes
[modifications]
{TRAIT_QUICK}
{TRAIT_RESILIENT}
[/modifications]
generate_name=no
random_traits=no
animate=no
[/unit]
Cheers,
-- Spannerbag
- beetlenaut
- Developer
- Posts: 2863
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: naming a new unique character
Answering this question fully means explaining the structure of a Wesnoth add-on. Nobody is likely to do that since you can just follow the "Create" link at the top of the page to find a thorough description. Maybe if you had some more information, you could ask a more targeted question...
[unit_type] creates a class of units. It allows you to create any number of units of that type later (even if you only plan to recruit one). It sets some basic properties like race, description, animations, abilities, maximum HP, and so on.
[unit] creates a new unit on the map. It will inherit the basic properties from its [unit_type], plus it will have its own individual properties. The individual properties include things like side, name, location, traits, current HP, and so on.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
-
- Posts: 26
- Joined: April 1st, 2024, 10:35 pm
Re: naming a new unique character
thank you for your answer, this cleared things up for me