Recruitment help
Moderator: Forum Moderators
Recruitment help
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....
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....
- Casual User
- Posts: 475
- Joined: March 11th, 2005, 5:05 pm
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 :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)
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]
It's not quite what you wanted to do, but it's as close as I can think of coming.
thanks for that, it will fit with what I want, and having tested it, it works with some small adjustments.
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?
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]
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?
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.
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.
-
- Posts: 127
- Joined: November 11th, 2005, 9:06 am
- Location: California
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.
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
Wesnoth 1.6.2