Can recuit loyal units
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: 6
- Joined: December 12th, 2017, 1:41 pm
Can recuit loyal units
Hello,
I need recuit loyal units to my campaing, but i dont get this.
Look my code please:
Could you help me please?
Thanks
I need recuit loyal units to my campaing, but i dont get this.
Look my code please:
Code: Select all
[unit_type]
id=Adolescente Femea
name= _ "Adolescente"
race=elf
ignore_race_traits=yes
[race]
num_traits=2
[trait]
[effect]
apply_to=loyal
[/effect]
[/trait]
[/race]
gender=female
image="units/elves-wood/adolescente.png"
{MAGENTA_IS_THE_TEAM_COLOR}
profile="portraits/elves/adolescente.png"
hitpoints=10
...
[/unit_type]
Thanks
Re: Can recuit loyal units
This looks ok.
The trait has no name, so it won't be shown. It had no description / help_text either, so it won't be shown in the trait list in the help (1.13).
Eventually this unit is already having free upkeep, try to monitor the impact on upkeep.
I don't know if having an id is mandatory.
Btw, if you give availaibility=mustehave you don't have to ignore race traits.
The trait has no name, so it won't be shown. It had no description / help_text either, so it won't be shown in the trait list in the help (1.13).
Eventually this unit is already having free upkeep, try to monitor the impact on upkeep.
I don't know if having an id is mandatory.
Btw, if you give availaibility=mustehave you don't have to ignore race traits.
Try out the dark board theme.
-
- Posts: 6
- Joined: December 12th, 2017, 1:41 pm
Re: Can recuit loyal units
Shiki wrote:This looks ok.
The trait has no name, so it won't be shown. It had no description / help_text either, so it won't be shown in the trait list in the help (1.13).
Eventually this unit is already having free upkeep, try to monitor the impact on upkeep.
I don't know if having an id is mandatory.
Btw, if you give availaibility=mustehave you don't have to ignore race traits.
Thank you for your response
I change my code, but the trait loyal not work and not show in unit.
Did I do something wrong?
Code: Select all
[unit_type]
id=Adolescente Femea
name= _ "ElfaAdolescente"
race=elf
#ignore_race_traits=yes
availaibility=mustehave
[race]
num_traits=2
[trait]
id=loyal
male_name= _ "loyal"
female_name= _ "female^loyal"
description= _ "Zero upkeep"
[effect]
apply_to=loyal
[/effect]
[/trait]
[/race]
gender=female
...
[/unit_type]
Re: Can recuit loyal units
I'm sorry, I overlooked that before, the problem is there should be no [race] tag in [unit_type]. [unit_type] accepts [trait], so just place it directly there. availability is part of [trait].
And it is possible to have not visible traits if you want them, without name or description.
And it is possible to have not visible traits if you want them, without name or description.
Try out the dark board theme.
-
- Posts: 6
- Joined: December 12th, 2017, 1:41 pm
Re: Can recuit loyal units
Shiki wrote:I'm sorry, I overlooked that before, the problem is there should be no [race] tag in [unit_type]. [unit_type] accepts [trait], so just place it directly there. availability is part of [trait].
And it is possible to have not visible traits if you want them, without name or description.
Thank you Shiki! And I'm sorry in on tag "availability"
I believe that this is the way.
See Code:
Code: Select all
[unit_type]
id=Adolescente Femea
name= _ "ElfaAdolescente"
race=elf
[trait]
availaibility="musthave"
id=loyal
male_name= _ "loyal"
female_name= _ "female^loyal"
description= _ "Zero upkeep"
[effect]
apply_to=loyal
[/effect]
[/trait]
gender=female
...
[/unit_type]
What happens with the above code is that the unit is recruited with loyal only sometimes.
I gave a searched, and found the code below, which works 100%, but as it disables the traits, the unit only stays loyal.
My desire is for unity to be loyal and some random.
See Code:
Code: Select all
[unit_type]
id=Elvish Adolescente Femea
name= _ "ElfaAdolescente"
race=elf
ignore_race_traits=yes
{TRAIT_LOYAL}
gender=female
...
[/unit_type]
I tried "num_traits=2", but not successful
Would you or anyone else have any tips to help me?
Re: Can recuit loyal units
Might want to to try this (untested):
Code: Select all
[unit_type]
{TRAIT_LOYAL}
[+trait]
availability=musthave
[/trait]
[/unit_type]
-
- Posts: 6
- Joined: December 12th, 2017, 1:41 pm
Re: Can recuit loyal units
zookeeper wrote:Might want to to try this (untested):
Code: Select all
[unit_type] {TRAIT_LOYAL} [+trait] availability=musthave [/trait] [/unit_type]
Thanks zookeeper.
But don't worked =/
Still looking the solution
Re: Can recuit loyal units
You could do it in your campaign's recruit event. I've tested this on v1.13.10, putting it in a scenario's .cfg file (hence why it's working on spearmen). This gives the loyal trait, and affects the upkeep, but it doesn't add the gold UI hint that the unit is loyal.
For Wesnoth 1.12 you'd have to convert [modify_unit] back to the v1.12 method (hopefully someone will tell both of us what the v1.12 method is ).
For Wesnoth 1.12 you'd have to convert [modify_unit] back to the v1.12 method (hopefully someone will tell both of us what the v1.12 method is ).
Code: Select all
[event]
name=recruit
first_time_only=no
[filter_side]
side=1
[/filter_side]
[filter]
type=Spearman
[/filter]
[modify_unit]
[filter]
id=$unit.id
[/filter]
{TRAIT_LOYAL}
[/modify_unit]
[/event]
Currently updating the SurvivalXtreme Collection, and the SXC Pressure scenario. That's about a mermish necromancer, who's just found out that her Tentacles Of The Deep have been nerfed.
Re: Can recuit loyal units
It doesnt look like anything 1.13 specific.
Re: Can recuit loyal units
I bet the reason why it didn't work is the spelling of availability - I misspelled it.
Try out the dark board theme.
-
- Posts: 6
- Joined: December 12th, 2017, 1:41 pm
Re: Can recuit loyal units
Thank you octalot!! It's workoctalot wrote:You could do it in your campaign's recruit event. I've tested this on v1.13.10, putting it in a scenario's .cfg file (hence why it's working on spearmen). This gives the loyal trait, and affects the upkeep, but it doesn't add the gold UI hint that the unit is loyal.
For Wesnoth 1.12 you'd have to convert [modify_unit] back to the v1.12 method (hopefully someone will tell both of us what the v1.12 method is ).
Code: Select all
[event] name=recruit first_time_only=no [filter_side] side=1 [/filter_side] [filter] type=Spearman [/filter] [modify_unit] [filter] id=$unit.id [/filter] {TRAIT_LOYAL} [/modify_unit] [/event]
You're right, it's work in 1.12Ravana wrote:It doesnt look like anything 1.13 specific.
Oh no!Shiki wrote:I bet the reason why it didn't work is the spelling of availability - I misspelled it.
Sorry Shiki, I'm kind of dumb hehehehe
After writing it right, it worked
See Code Working:
Code: Select all
[unit_type]
id=Adolescente Femea
name= _ "ElfaAdolescente"
race=elf
[trait]
availability="musthave"
id=loyal
male_name= _ "loyal"
female_name= _ "female^loyal"
description= _ "Zero upkeep"
[effect]
apply_to=loyal
[/effect]
[/trait]
...
[unit_type]
- Celtic_Minstrel
- Developer
- Posts: 2207
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: Can recuit loyal units
There's no need to write your own
[trait]
code though. Just use {TRAIT_LOYAL}
! I'm pretty sure that even already has availability=musthave
, but if not you can augment it as zookeeper demonstrated.