making two units able to recruit

The place to post your WML questions and answers.

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.
Post Reply
Gambrous
Posts: 26
Joined: July 3rd, 2012, 8:22 pm

making two units able to recruit

Post by Gambrous »

hey, I was attempting to make one of my heros into a leader for one scenario but can figure out how to make a second leader. Can anyone help?

Gambrous

ps. This is it at the moment

Code: Select all

    [side]
      side=1
      controller=human
      team_name=Glenfirians
      user_team_name= _ "Glenfirians"

      type=Noble Captain
      id=Gambrous
      name= _ "Gambrous"
      canrecruit=yes

      recruit=Elvish Fighter, Elvish Archer, Elvish Scout, Elvish Shaman

      {GOLD 100 50 0}
      {INCOME 10 5 0}
      [unit]
        id=Offgar
        name= _ "Offgar"
        unrenamable=yes
        type=Mage
        side=1
        x=40
        y=10
        {IS_HERO}
        [modifications]
          {TRAIT_LOYAL}
          {TRAIT_INTELLIGENT}
          {TRAIT_STRONG}
        [/modifications]
      [/unit]
      [unit]
        id=Pelor
        name= _ "Pelor"
        unrenamable=yes
        type=Elvish Archer
        side=1
        x=41
        y=9
        {IS_HERO}
        [modifications]
          {TRAIT_LOYAL}
          {TRAIT_INTELLIGENT}
          {TRAIT_QUICK}
        [/modifications]
      [/unit]
    [/side]
And I would like to make Pelor able to recruit as well as Gambrous just for this scenario.
User avatar
TheScribe
Posts: 465
Joined: June 17th, 2012, 8:17 pm
Location: You won't know till it's too late

Re: making two units able to recruit

Post by TheScribe »

Code: Select all

      [unit]
        id=Pelor
        name= _ "Pelor"
        unrenamable=yes
        type=Elvish Archer
        side=1
        canrecruit=yes
        x=41
        y=9
        {IS_HERO}
        [modifications]
          {TRAIT_LOYAL}
          {TRAIT_INTELLIGENT}
          {TRAIT_QUICK}
        [/modifications]
      [/unit]
    [/side]
This should work.
Sorta on a break from the forums ATM, have been for a while. If I was doing something for/with you and I haven't recently, that's why, I will be back soon hopefully.
Gambrous
Posts: 26
Joined: July 3rd, 2012, 8:22 pm

Re: making two units able to recruit

Post by Gambrous »

gave that a go but it didn't work, he's still just a normal hero

Gambrous

I also tried this:

Code: Select all

      [unit]
        id=Pelor
        name= _ "Pelor"
        unrenamable=yes
        type=Elvish Archer
        side=1
        canrecruit=yes

        recruit=Elvish Fighter, Elvish Archer, Elvish Scout

        x=41
        y=9
        [modifications]
          {TRAIT_LOYAL}
          {TRAIT_INTELLIGENT}
          {TRAIT_QUICK}
        [/modifications]
      [/unit]
but it didn't work either
User avatar
Crendgrim
Moderator Emeritus
Posts: 1328
Joined: October 15th, 2010, 10:39 am
Location: Germany

Re: making two units able to recruit

Post by Crendgrim »

Units with canrecruit=yes do not take upkeep, so you do not have to give them the loyal thread. Are you sure that it does not work, and that the unit is not able to recruit? Maybe it just displays the wrong icon.
UMC Story Images — Story images for your campaign!
User avatar
TheScribe
Posts: 465
Joined: June 17th, 2012, 8:17 pm
Location: You won't know till it's too late

Re: making two units able to recruit

Post by TheScribe »

Code: Select all

      [unit]
        id=Pelor
        name= _ "Pelor"
        unrenamable=yes
        type=Elvish Archer
        side=1
        canrecruit=yes
        x=41
        y=9
        [modifications]
          {TRAIT_INTELLIGENT}
          {TRAIT_QUICK}
        [/modifications]
      [/unit]
    [/side]
This should work. I forgot to remove the IS_HERO macro.

Also, the reason your's didn't work is "recruit=" isn't supported under the unit tag, only the side tag. If you want him to have a different recruit list use "extra_recruit=" under the unit tag. (He'll still be able to recruit the regular team recruits with this, so if you don't want that then use extra_recruit for the other leader too.)
Sorta on a break from the forums ATM, have been for a while. If I was doing something for/with you and I haven't recently, that's why, I will be back soon hopefully.
Gambrous
Posts: 26
Joined: July 3rd, 2012, 8:22 pm

Re: making two units able to recruit

Post by Gambrous »

This is really fustrating me now. I'm attaching the whole campaign to let one of you guys look over it and see where the problem is because it's just not working. If someone can fix this I'd be really grateful. It's the third scenario that I want Pelor to be able to recruit in as well as Gambrous.

Gambrous
Attachments
Defense_of_Glenfire_Forest.7z
this is the campaign
(107.11 KiB) Downloaded 79 times
User avatar
TheScribe
Posts: 465
Joined: June 17th, 2012, 8:17 pm
Location: You won't know till it's too late

Re: making two units able to recruit

Post by TheScribe »

I can't run 7z files. Could you post it in a different format?
Sorta on a break from the forums ATM, have been for a while. If I was doing something for/with you and I haven't recently, that's why, I will be back soon hopefully.
User avatar
8680
Moderator Emeritus
Posts: 742
Joined: March 20th, 2011, 11:45 pm
Location: The past

Re: making two units able to recruit

Post by 8680 »

@TheScribe: Windows: 7-Zip, Mac OS X: Keka, Posix in general: p7zip.
User avatar
Crendgrim
Moderator Emeritus
Posts: 1328
Joined: October 15th, 2010, 10:39 am
Location: Germany

Re: making two units able to recruit

Post by Crendgrim »

I understand your problem now. You are creating a unit with the id Pelor. This unit, however, still exists from the previous scenario, so it will get recalled there automatically.
If I put this inside the start event, it works (despite him still showing up the silver crown instead of the golden, if that really bothers you, you could kill Pelor first and then re-create him as a leader with his old EXP and HP):

Code: Select all

      [modify_unit]
        [filter]
          id=Pelor
        [/filter]
        canrecruit=yes
      [/modify_unit]
UMC Story Images — Story images for your campaign!
User avatar
TheScribe
Posts: 465
Joined: June 17th, 2012, 8:17 pm
Location: You won't know till it's too late

Re: making two units able to recruit

Post by TheScribe »

8680 wrote:@TheScribe: Windows: 7-Zip, Mac OS X: Keka, Posix in general: p7zip.
Wait, I'm running Windows. I tried to open it and it said I couldn't...
Crendgrim wrote:This unit, however, still exists from the previous scenario...
I totally missed that fact. :doh: Sorry...
Sorta on a break from the forums ATM, have been for a while. If I was doing something for/with you and I haven't recently, that's why, I will be back soon hopefully.
Gambrous
Posts: 26
Joined: July 3rd, 2012, 8:22 pm

Re: making two units able to recruit

Post by Gambrous »

this would explain a lot. For 7z files or any other compression type I use universal extractor as it's free and does a load of them (will only extract though, not compress). For plainly 7z there's also 7-zip and the program I use to create the 7z files which will also extract them is un-zip for windows file manager. All the listed programs should be free.

Anyway thanks for your help and I'm not bothered with the silver crown, I'll just make sure the player knows that for this scenario pelor is also able to recruit. To take this function away again in later scenarios do I just not put the canrecruit=yes event in or do I do a similar event which says can recruit=no?

Many thanks

Gambrous
User avatar
Crendgrim
Moderator Emeritus
Posts: 1328
Joined: October 15th, 2010, 10:39 am
Location: Germany

Re: making two units able to recruit

Post by Crendgrim »

I think it will keep the canrecruit=yes, so you'd need to put the exact same event with canrecruit=no in the scenario where he is not supposed to recruit anymore, yes.
UMC Story Images — Story images for your campaign!
User avatar
8680
Moderator Emeritus
Posts: 742
Joined: March 20th, 2011, 11:45 pm
Location: The past

Re: making two units able to recruit

Post by 8680 »

@TheScribe: Try setting .7z files to open by default in 7-Zip File Manager, however that works on your system.
JaMiT
Inactive Developer
Posts: 511
Joined: January 22nd, 2012, 12:38 am

Re: making two units able to recruit

Post by JaMiT »

Crendgrim wrote:(despite him still showing up the silver crown instead of the golden, if that really bothers you, you could kill Pelor first and then re-create him as a leader with his old EXP and HP)
You don't need to kill a unit to remove the silver crown. Just add

Code: Select all

    {UNMAKE_HERO Pelor}
to whatever event is appropriate (probably the one that makes him able to recruit). There is also a MAKE_HERO macro for when the silver crown should be restored.
Post Reply