Recruitment help

Discussion and development of scenarios and campaigns for the game.

Moderator: Forum Moderators

Post Reply
ade334
Posts: 9
Joined: November 15th, 2005, 9:41 am

Recruitment help

Post by ade334 »

I wondered if it was possible to have 2 different units have the ability to recruit different units whilst being on the same side? (I'm guessing probably not)

Also, I have my side leader on the keep and another unit with canrecruit=1 on a castle hex, and I get an error telling me I need my leader on a keep to recruit or recall units. Once one or the other moves off the castle, I am again able to recruit units....
User avatar
Casual User
Posts: 475
Joined: March 11th, 2005, 5:05 pm

Post by Casual User »

I wondered if it was possible to have 2 different units have the ability to recruit different units whilst being on the same side? (I'm guessing probably not)
Not exactly, but you can use the following trick : Create two sides, allied, of which side=1 is your own and side=2 is an additional one that can recruit various units. Then use this code :

Code: Select all

[event]
name=recruit
[filter]
side=2
[/filter]
[store_unit]
kill=yes
[filter]
x,y=$x1,$y1
[/filter]
variable=recruit
[/store_unit]
{VARIABLE recruit_type.side (1)}
[unstore_unit]
variable=recruit
x,y=$x1,$y1
[/unstore_unit]
[/event]
I'm 95% sure it would work. Basically, side 2 would be restricted to the leader who would recruit units for you, in his keep, on his turn, regardless of where you are or what you can recruit.

It's not quite what you wanted to do, but it's as close as I can think of coming.
ade334
Posts: 9
Joined: November 15th, 2005, 9:41 am

Post by ade334 »

thanks for that, it will fit with what I want, and having tested it, it works with some small adjustments.

Code: Select all

[event]
name=recruit
first_time_only=no
[filter]
side=2
[/filter]
[store_unit]
kill=yes
[filter]
x,y=$x1,$y1
[/filter]
variable=recruit
[/store_unit]
{VARIABLE recruit.side (1)}
[unstore_unit]
variable=recruit
x,y=$x1,$y1
[/unstore_unit]
{CLEAR VARIABLE recruit}
[/event]
I'd tried going through with 2 separate sides and making the units switch at the end of the scenario (for the purpose of putting them in the recall list) but I ended up with no recall list whichever side triggered the victory.

This way, the second leader just acts as a recruiter for the first player - which is a neat concept anyway, may use it elsewhere as well.


Still a little concerned about the problem I had when I had two units with canrecruit=1. Basically, my "leader" would change randomly or so it would appear. Sometimes my main leader would only be able to recruit, then the other guy at other times. Seems odd..... my problem is fixed but is this a general problem or just something I missed in my code?
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Post by zookeeper »

You could also use a trick like this:

When one of the "recruiters" moves onto a keep, a moveto event triggers and gives that unit canrecruit=1 and removes it from the other one. When the other one moves onto a keep, another moveto event triggers and flips the canrecruits vice versa again. This way, there's only one unit with canrecruit=1 at any given time.

This, of course, works perfectly if you have just one keep, but can get confusing for the player who would have to occasionally move one recruiter out of the keep just to be able to move him back and "reclaim" the ability to recruit.

If you'd like to use this instead but can't figure out the WML for it, ask.
Lord_Aether
Posts: 127
Joined: November 11th, 2005, 9:06 am
Location: California

Post by Lord_Aether »

I believe what happens is the top-left most leader can recruit.

The solution above means that the two leaders have different gold stores. If you want them to share, try setting a variable at the end of each turn with the gold amount, then setting the gold amount of the current side to that number.
Mac OS X 10.5.7
Wesnoth 1.6.2
bruno
Inactive Developer
Posts: 293
Joined: June 26th, 2005, 8:39 pm
Contact:

Post by bruno »

I'll add making multiple recruiters work to my task list. If it turns out to be easy, it will probably be in the December 1.1 release. If it turns out not to be easy, don't look for it anytime soon.
Post Reply