Why the hell cant l change the effects of "fearless" trait?

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.
User avatar
AxalaraFlame
Posts: 690
Joined: December 4th, 2011, 1:07 pm
Location: Pasadina, Caltech

Why the hell cant l change the effects of "fearless" trait?

Post by AxalaraFlame »

Could someone help me about this? l searched over all codes but my efforts are vain. Why cant l find it?
Ceres
Forum Regular
Posts: 620
Joined: September 18th, 2010, 7:56 pm
Location: Germany

Re: Why the hell cant l change the effects of "fearless" tra

Post by Ceres »

Because the effects of that trait are hardcoded, i.e. in the source code (written in C++).
User avatar
AxalaraFlame
Posts: 690
Joined: December 4th, 2011, 1:07 pm
Location: Pasadina, Caltech

Re: Why the hell cant l change the effects of "fearless" tra

Post by AxalaraFlame »

how can l decipher it? it should not be too hard
Ceres
Forum Regular
Posts: 620
Joined: September 18th, 2010, 7:56 pm
Location: Germany

Re: Why the hell cant l change the effects of "fearless" tra

Post by Ceres »

I'm not sure what you mean with "decipher" - it's part of the game engine, and you'd need some advanced C++ programming knowledge to mess around with it.
I don't know what you want to do with the fearless trait, so I don't know whether there're WML/Lua workarounds possible.
User avatar
AxalaraFlame
Posts: 690
Joined: December 4th, 2011, 1:07 pm
Location: Pasadina, Caltech

Re: Why the hell cant l change the effects of "fearless" tra

Post by AxalaraFlame »

well, l want to make an ability and define its effect as the same as "fearless" trait; thus, a unit can become fearless in a certain level, without having to had this trait inherently.

and decipher means decode
User avatar
Drakefriend
Posts: 436
Joined: September 27th, 2009, 12:57 pm
Location: Wandering from one world to another
Contact:

Re: Why the hell cant l change the effects of "fearless" tra

Post by Drakefriend »

As far as I know, if you want a unit to have a trait x automaticly, you write "TRAIT_X_MUSTHAVE" into the cfg. If ypu level into unit with an obligatory trait, it is added besides the preexisting traits. as is the case with liches (two from human + Undead from undead). So you probably do not need to modify the trait.
After far too long an absence, I have returned.
According to the quiz 100% Silver Mage (85% Archmage, 75% Shyde, 67% Flameheart and Ancient Wose,58% Assassin, Troll Warrior and Berserker). And my top score is exactly how I see myself.
User avatar
AxalaraFlame
Posts: 690
Joined: December 4th, 2011, 1:07 pm
Location: Pasadina, Caltech

Re: Why the hell cant l change the effects of "fearless" tra

Post by AxalaraFlame »

oh my! really? if that, l will test it this saturday. recently l am really busy.

my idea is: paladin shall be fearless
User avatar
AxalaraFlame
Posts: 690
Joined: December 4th, 2011, 1:07 pm
Location: Pasadina, Caltech

Re: Why the hell cant l change the effects of "fearless" tra

Post by AxalaraFlame »

oh guys l got problems again: a trait can not be added to a kind of unit at a certain level. Traits are inherent, which means l can make a inherently fearless paladin by recruiting him, but l can't make a knight level up to be a fearless paladin
User avatar
The_Other
Posts: 189
Joined: February 3rd, 2012, 10:05 pm
Location: UK

Re: Why the hell cant l change the effects of "fearless" tra

Post by The_Other »

I believe you can include traits in a unit's .cfg file, in which case all units of that type, regardless of where they come from will have the trait.

You can also use [modify_unit] to assign traits.
Nothing is true; everything is permissible.
User avatar
AxalaraFlame
Posts: 690
Joined: December 4th, 2011, 1:07 pm
Location: Pasadina, Caltech

Re: Why the hell cant l change the effects of "fearless" tra

Post by AxalaraFlame »

Yep l know how to change those stuff and know how [modify] sentense works, but that is used in campaigns and for temporary adjustments; a units still can't get an additional trait when leveled up something.

But there is an exception: lich. lich has three traits because when an adept leveled up a lich, its race got transfered and got inherent "undead" trait. For paladins and other units l wanna expand, this adjustment is juts useless
User avatar
Alarantalara
Art Contributor
Posts: 786
Joined: April 23rd, 2010, 8:17 pm
Location: Canada

Re: Why the hell cant l change the effects of "fearless" tra

Post by Alarantalara »

If you want a unit type to always have a trait, then add the trait to its unit_type definition and make sure it is marked as "availability=musthave"
Conveniently, there is already a macro for the fearless trait: TRAIT_FEARLESS_MUSTHAVE

Also, moved to WML workshop
User avatar
AxalaraFlame
Posts: 690
Joined: December 4th, 2011, 1:07 pm
Location: Pasadina, Caltech

Re: Why the hell cant l change the effects of "fearless" tra

Post by AxalaraFlame »

sorry, l dont really get your point. can u explain that futher with details? l am only a player who know a little about those stuff
User avatar
8680
Moderator Emeritus
Posts: 742
Joined: March 20th, 2011, 11:45 pm
Location: The past

Re: Why the hell cant l change the effects of "fearless" tra

Post by 8680 »

Try putting {TRAIT_FEARLESS_MUSTHAVE} in the unit's [unit_type] tag.
User avatar
AxalaraFlame
Posts: 690
Joined: December 4th, 2011, 1:07 pm
Location: Pasadina, Caltech

Re: Why the hell cant l change the effects of "fearless" tra

Post by AxalaraFlame »

Yes I tried it, but l still can't level a knight (with two normal traits) to a paladin withnthree traits. This effect is just like the effect to bats, {must_have_feral}. They can be conscripted but not leveled up to be someone.
User avatar
The_Other
Posts: 189
Joined: February 3rd, 2012, 10:05 pm
Location: UK

Re: Why the hell cant l change the effects of "fearless" tra

Post by The_Other »

You could try creating a custom race, used only for the Paladin unit, which is identical to human except with three traits (including the compulsory Fearless)

Alternatively, give the Paladin a modified version of the Illuminate ability, which affects only himself and works only at night (thus eliminating the night-time penalty, but not affecting adjacent units or providing any benefit at other times of day). Functionally this is the same as Fearless, except that it is implemented as an ability rather than a trait.

Code: Select all

#define FEARLESS_PALADIN_HACK
    [illuminates]
        id=fearless_hack
        value=25
        max_value=25
        cumulative=no
        name= _ "fearless"
        female_name= _ "female^fearless"
        description= _ "Fearless:
This unit does not receive a damage penalty for fighting at night."
        affect_self=yes
	    [filter_self]
            	[filter_location]
                    time_of_day=chaotic
	        [/filter_location]
            [/filter_self]
	affect_adjacent=no
    [/illuminates]
#enddef
I haven't tested this so it may not work like it's supposed to, but it looks right to me.
Nothing is true; everything is permissible.
Post Reply