Era of Zaestryon [unpublished]

The place to post your WML questions and answers.

Moderators: Forum Moderators, Developers

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.
Post Reply
User avatar
Zaestryon
Posts: 7
Joined: October 30th, 2019, 10:07 pm
Location: France

Era of Zaestryon [unpublished]

Post by Zaestryon » December 2nd, 2019, 10:39 pm

Hi ! First of all I'm making an Era.

All factions are remade with existing base units but adding some lower levels and giving 5 levels to great races units and 3 levels to animals (Falcons, gryphons, spiders etc.)

Bandits are no longer with dwarves but with orcs. Dwarves can recruit spiders now. New abilities and weapon specials. New AMLA. I need a lot of testing, I'm finishing units with abilities etc. I don't really like high level units not beeing able to hit a level 1. So I'm trying to balance everything for now.
The Era of Zaestryon
I'm an old Wesnoth player, I've worked a lot on unfinished and unpublished add-ons.
So, I'm only making an Era this time and will publish it for those who want another way to play Wesnoth.
With new abilities and weapon specials and everyone able to reach lvl 5 but animals lvl 3.

User avatar
Zaestryon
Posts: 7
Joined: October 30th, 2019, 10:07 pm
Location: France

Re: Era of Zaestryon [unpublished]

Post by Zaestryon » December 2nd, 2019, 10:48 pm

I need some help. I'm trying to make the Peasant more interesting. I want him to advance to 5 choices but I don't want us to really choose.

So I've created an event.
Here's the code.

Code: Select all

    [event]
        #when we recruit a Peasant
        name=recruit
        first_time_only=no
        [filter]
             type=Peasant
        [/filter]
        #we have a random variable 
        #to transform the base Peasant 
        #into another one who only advance 
        #to one choice (between Fencer, 
        #Heavy Infantryman, Sergeant, 
        #Spearman and Bowman)
        [set_variable]
            name=PeasantClass
            rand=1,2,3,4,5
        [/set_variable]
        [if]
        [variable]
            name=PeasantClass
            equals=1
        [/variable]
        [then]
            {TRANSFORM_UNIT id=Peasant PeasantArcher}
        [/then]
        [/if]
        [elseif]
        [variable]
            name=PeasantClass
            equals=2
        [/variable]
        [then]
            {TRANSFORM_UNIT id=Peasant PeasantDuel}
        [/then]
        [/elseif]
        [elseif]
        [variable]
            name=PeasantClass
            equals=3
        [/variable]
        [then]
            {TRANSFORM_UNIT id=Peasant PeasantGarde}
        [/then]
        [/elseif]
        [elseif]
        [variable]
            name=PeasantClass
            equals=4
        [/variable]
        [then]
            {TRANSFORM_UNIT id=Peasant PeasantLeader}
        [/then]
        [/elseif]
        [elseif]
        [variable]
            name=PeasantClass
            equals=5
        [/variable]
        [then]
            {TRANSFORM_UNIT id=Peasant PeasantSoldat}
        [/then]
        [/elseif]
        [clear_variable]
            name=PeasantClass
        [/clear_variable]
    [/event]
Thanks for your help, I don't have anymore ideas to fix this code. It doesn't work at all.
The Era of Zaestryon
I'm an old Wesnoth player, I've worked a lot on unfinished and unpublished add-ons.
So, I'm only making an Era this time and will publish it for those who want another way to play Wesnoth.
With new abilities and weapon specials and everyone able to reach lvl 5 but animals lvl 3.

User avatar
Ravana
Forum Moderator
Posts: 2262
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Era of Zaestryon [unpublished]

Post by Ravana » December 2nd, 2019, 11:03 pm

Problem
{TRANSFORM_UNIT id=Peasant PeasantSoldat} - no unit has id Peasant - if you inspect you see it is in the form of Peasant-3.

Suggestions
{VARIABLE_OP new_type rand PeasantLeader,PeasantSoldat,...} easier to use random.

Change the recruited unit only.
[modify_unit]
[filter]
id=$unit.id
[/filter]
type=$new_type
[modify_unit]

User avatar
Zaestryon
Posts: 7
Joined: October 30th, 2019, 10:07 pm
Location: France

Re: Era of Zaestryon [unpublished]

Post by Zaestryon » December 3rd, 2019, 9:34 pm

I'm with this event now and it still doesn't work.

Code: Select all

    [event]
        name=recruit
        first_time_only=no
        [filter]
             type=Peasant
        [/filter]
        {VARIABLE_OP PeasantClass rand "PeasantArcher,PeasantDuel,PeasantGarde,PeasantLeader,PeasantSoldat"}
        [modify_unit]
            [filter]
                id=$unit.id
            [/filter]
            type=$PeasantClass
        [/modify_unit]
        [clear_variable]
            name=PeasantClass
        [/clear_variable]
    [/event]
For info, I've put it in the Peasant.cfg before opening the [unit] section. Is it the problem ? Where can I put it to make this work ? I've already done something like this in the past but it was working x) but I don't remember, it was years ago. Anyway, thanks for your help !
The Era of Zaestryon
I'm an old Wesnoth player, I've worked a lot on unfinished and unpublished add-ons.
So, I'm only making an Era this time and will publish it for those who want another way to play Wesnoth.
With new abilities and weapon specials and everyone able to reach lvl 5 but animals lvl 3.

User avatar
Ravana
Forum Moderator
Posts: 2262
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Era of Zaestryon [unpublished]

Post by Ravana » December 3rd, 2019, 9:47 pm

Inspect and check that your event is registered, and that variable is set (remove clearing while developing).

It does not matter if it is before [unit], rather what is the tag around [event]. Since you develop era, usual places for events are in [era] or [units][unit_type].

User avatar
Zaestryon
Posts: 7
Joined: October 30th, 2019, 10:07 pm
Location: France

Re: Era of Zaestryon [unpublished]

Post by Zaestryon » December 3rd, 2019, 10:01 pm

Okay, thanks Ravana, I'll make more tests and will give you news later.

Otherwise, can I use units from original game campaigns without asking someone if I can ? I mean the orcish shaman and the dwarf with bolas for example ? I can't make art on my phone, if you know an app allowing me to modify or create transparent PNG files, please tell me.
The Era of Zaestryon
I'm an old Wesnoth player, I've worked a lot on unfinished and unpublished add-ons.
So, I'm only making an Era this time and will publish it for those who want another way to play Wesnoth.
With new abilities and weapon specials and everyone able to reach lvl 5 but animals lvl 3.

User avatar
Zaestryon
Posts: 7
Joined: October 30th, 2019, 10:07 pm
Location: France

Re: Era of Zaestryon [unpublished]

Post by Zaestryon » December 3rd, 2019, 10:09 pm

It works in the [era] section and in the [unit_type] section. It was the bug ! Thanks again, your code is really easy to use.
The Era of Zaestryon
I'm an old Wesnoth player, I've worked a lot on unfinished and unpublished add-ons.
So, I'm only making an Era this time and will publish it for those who want another way to play Wesnoth.
With new abilities and weapon specials and everyone able to reach lvl 5 but animals lvl 3.

Post Reply