Canrecruiter that still pays upkeep, how to ?

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
Eagle_11
Posts: 754
Joined: November 20th, 2013, 12:20 pm

Canrecruiter that still pays upkeep, how to ?

Post by Eagle_11 » January 20th, 2018, 12:21 pm

Is there any way to make an silver crown unit keep paying its value in upkeep ?

User avatar
Bitron
Moderator
Posts: 438
Joined: October 19th, 2015, 9:23 am
Location: Germany

Re: Canrecruiter that still pays upkeep, how to ?

Post by Bitron » January 21st, 2018, 12:46 am

The silver crowns are paying upkeep by default, as far as I know.
At first I thought you might be able to use the upkeep keyword from [unit], but apparently for canrecruiters it does not matter what it is set to, they will always have no upkeep.

User avatar
WhiteWolf
Forum Regular
Posts: 370
Joined: September 22nd, 2009, 7:48 pm
Location: Hungary

Re: Canrecruiter that still pays upkeep, how to ?

Post by WhiteWolf » January 21st, 2018, 12:12 pm

Silver crowns, a.k.a {IS_HERO} will still pay upkeep.
And canrecruit=yes will never pay upkeep. As far as I know :)

What you could do, is have a new turn event sub the gold from the side. Something like this:

Code: Select all

[event]
    name=new turn
    first_time_only=no

    [store_unit]
        # store the guy for his level
        variable=guy
        kill=no
    [/store_unit]

    [gold]
        side=$guy.side
        add=-$guy.level
   [/gold]
   {CLEAR_VARIABLE guy}
[/event]
Author of the Underness Series, consisting of V parts: The Desolation of Karlag, The Blind Sentinel, The Stone of the North, The Invasion Of The Western Cavalry, Fingerbone of Destiny
Standalone works: The Ravagers - now published!

User avatar
Eagle_11
Posts: 754
Joined: November 20th, 2013, 12:20 pm

Re: Canrecruiter that still pays upkeep, how to ?

Post by Eagle_11 » January 21st, 2018, 2:08 pm

Right, i can use that. One possible issue would be to filter out the original leader as dont want the goldcrown to pay upkeep.

I have required this for im reworking the extra recruiters in my era to be not specific units anymore.
When an level 1 unit is of eligible type to become an faction leader, upon advancing to level 2 it doubles as an extra recruiter. And when those level up to 3 they can recruit their level 2 form, but only when recruiting through that unit. The level 2 unit recruited this way does not become an recruiter itself. Somewhat similar to Ogre Battle.

Another question i have is it possible that when a side has lost goldcrown it immediately loses. Or if sudden death victory condition is not possible, can it be made so that when a side has lost its original leader all silver crowns get demoted to canrecruit=no.

User avatar
Pentarctagon
Forum Administrator
Posts: 3517
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Canrecruiter that still pays upkeep, how to ?

Post by Pentarctagon » January 21st, 2018, 5:39 pm

Would [endlevel] fit?
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code

User avatar
Eagle_11
Posts: 754
Joined: November 20th, 2013, 12:20 pm

Re: Canrecruiter that still pays upkeep, how to ?

Post by Eagle_11 » January 21st, 2018, 7:58 pm

The upkeep is now fixed, thanks. Since only leader can get heroic used filter for trait to single him out.

Code: Select all

#define UPKEEP_FIXER
	[event]
    name=side turn end
    first_time_only=no
    [store_unit]
        [filter]
			canrecruit=yes
            [not]
			    [filter_wml]
					[modifications]
                        [trait]
							id=heroicleader
                        [/trait]
						[or]
							[trait]
								id=loyal
							[/trait]		
						[/or]
					[/modifications]
                [/filter_wml]
			[/not]
        [/filter]
        variable=guy
        kill=no
    [/store_unit]
    [gold]
        side=$guy.side
        amount=-$guy.level
   [/gold]
   {CLEAR_VARIABLE guy}
[/event]
#enddef
Using the filter for trait from above i can easily write an simple trigger that will set every recruiter else of that side to canrecruit=no at time of leader death, probably triggered as an last breath.

Post Reply