Racial Leadership

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
Alks
Posts: 314
Joined: December 4th, 2005, 11:53 pm
Location: Poland

Racial Leadership

Post by Alks »

Not even in MP, but in campaigns and in multiracial custom factions. It came as odd to me that it is theoretically possible that Dwarvish Thunderer would listen to Elf Marshal and gain leadership bonus. It is possible to encode in WML, that some units with leadership can extend this bonus only over units of the same race?
User avatar
Noyga
Inactive Developer
Posts: 1790
Joined: September 26th, 2005, 5:56 pm
Location: France

Post by Noyga »

AFAIK it is not currently possible.
You need to implement in WML the leadership ability manually.
User avatar
Elvish_Pillager
Posts: 8137
Joined: May 28th, 2004, 10:21 am
Location: Everywhere you think, nowhere you can possibly imagine.
Contact:

Post by Elvish_Pillager »

They're all in the same army, working for the same goal. Presumably they've all been brainwashed. :P In any case, it seems that if they weren't to listen to leadership, they'd also only be allies.
It's all fun and games until someone loses a lawsuit. Oh, and by the way, sending me private messages won't work. :/ If you must contact me, there's an e-mail address listed on the website in my profile.
User avatar
Eleazar
Retired Terrain Art Director
Posts: 2481
Joined: July 16th, 2004, 1:47 am
Location: US Midwest
Contact:

Re: Racial Leadership

Post by Eleazar »

Alks wrote:Not even in MP, but in campaigns and in multiracial custom factions. It came as odd to me that it is theoretically possible that Dwarvish Thunderer would listen to Elf Marshal and gain leadership bonus. It is possible to encode in WML, that some units with leadership can extend this bonus only over units of the same race?
I see your point, but to me if you accept that Elves and Undead (for instance) can be allies, it doesn't strech believability much more to think that a member of one race can lead another. I tend to think of Leadership, as the leader coordinating rather than inspiring the troops-- which makes more sense in these kind of scenarios. It's more important that a soldier follows a general's orders than that he likes the general.

Selective leadership would be an interesting option for campagn designers.
Feel free to PM me if you start a new terrain oriented thread. It's easy for me to miss them among all the other art threads.
-> What i might be working on
Attempting Lucidity
Xan
Inactive Developer
Posts: 258
Joined: August 28th, 2005, 3:05 pm
Contact:

Post by Xan »

Sometime after 1.1.2 this will be possible..
"It is time people learned about their failures and my successes."
Alks
Posts: 314
Joined: December 4th, 2005, 11:53 pm
Location: Poland

Post by Alks »

Basically I started to think about it, when dealing with two-racial faction, and don't really think that *X* "Tamer" should govern *Y* warriors, but strictly affect *X* "Beast". Nevertheless, yet another thing to wait on possibly.
User avatar
Casual User
Posts: 475
Joined: March 11th, 2005, 5:05 pm

Post by Casual User »

Disclaimer: Off the top of my head, so some of the tags may be wrong

1. In a perfect world:

Code: Select all

#define LEADERSHIP_ELF
[leadership]
description=leadership
[if]
[filter]
race=elf
[/filter]
[then]
per_level_bonus=25
[/then]
[else]
per_level_bonus=0
[/else]
[/if]
[/leadership]
enddef
When placed in the [abilities] tag, should be a leadership that applies only to elves. But I have the feeling that leadership is still hard-coded (for now), so it wouldn't work.

You could obviously change the filter as you see fit.

I'm not sure it would work anyway ([if] doesn't always work the way I'd like it to), I'd prefer to be able to use an '#ifdef' on it.

2. A little hack that might work right now:

An alternative idea that should work anyway (but needs debugging, I'm at school and am writing stritctly from memor):

Code: Select all

#define TAMER_LEADERSHIP
[event]
first_time_only=no
name=attack
[filter]
type=Wolf
[/filter]
{CHG_UNIT Tamer_no_lead Tamer_lead}
[/event]

[event]
first_time_only=no
name=end_attack
[filter]
type=Wolf
[/filter]
{CHG_UNIT Tamer_lead Tamer_no_lead}
[/event]
enddef
This requires you to have two different units : a tamer with leadership and one without. The {CHG_UNIT} is a macro you can find in scott's 'Liberty' (might require more arguments, I don't quite remember).

When you attack with a wolf, the tamer without leadership is changed to a tamer with leadership. When the attack takes place, the tamer has leadership and so can lead the wolf. After the attack, the tamer loses leadership so he can't lead anyone else. If you don't attack with a wolf, no leadership. Just put {TAMER_LEADERSHIP} in the scenario cfg file.

You can obviously put different filters (like race=elf).

P.S.http://www.wesnoth.org/forum/viewtopic.php?t=8503
P.P.S. It's not just being given orders, one also has to take them :wink:
Alks
Posts: 314
Joined: December 4th, 2005, 11:53 pm
Location: Poland

Post by Alks »

It's excellent. Even if it didn't work, it will give me a wonderful opportunity to see WML tricks in action.
User avatar
Casual User
Posts: 475
Joined: March 11th, 2005, 5:05 pm

Post by Casual User »

alks wrote:It's excellent. Even if it didn't work, it will give me a wonderful opportunity to see WML tricks in action.
What did it do?

It should, theoretically, work.

Possible bugs:
- 'end_attack' is only in 1.1, so you might want to check your version number.
- I don't quite remember how {CHG_UNIT} is used. Check the second scenario of Liberty for info
- {CHG_UNIT} is a 1.0 macro while 'end_attack' is 1.1. It might cause problems.
- I don't remember if it's enddef or #enddef.

Alternative which should work fine in 1.0:

Code: Select all

#define TAMER_LEADERSHIP
[event]
first_time_only=no
name=attack
[filter]
type=Wolf
[/filter]
{CHG_UNIT Tamer_no_lead Tamer_lead}
[/event]

[event]
first_time_only=no
name=attack
[filter]
[not]
type=Wolf
[/not]
[/filter]
{CHG_UNIT Tamer_lead Tamer_no_lead}
[/event]
enddef
Xan
Inactive Developer
Posts: 258
Joined: August 28th, 2005, 3:05 pm
Contact:

Post by Xan »

Actually, it would/will work like this:

Code: Select all

[leadership]
    per_level_bonus=25
    cumulative=no
    affect_allies=yes
    name= _ "Elven leadership"
    description= _ "blah"
    affect_self=no
    [affect_adjacent]
        adjacent=n,ne,se,s,sw,nw
        race=elf
    [/affect_adjacent]
[/leadership]
"It is time people learned about their failures and my successes."
toms
Posts: 1717
Joined: November 6th, 2005, 2:15 pm

Post by toms »

And @ casual user:

This will never work if you don´t write #enddef instead of enddef. I don´t know if this was only a mistype since it appeared more than once in your messages. :wink:
First read, then think. Read again, think again. And then post!
Post Reply