How to change or remove "standart" traits?

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
myav
Posts: 85
Joined: August 23rd, 2008, 12:53 pm

How to change or remove "standart" traits?

Post by myav »

In my scenario many heroes has x3 or x4 damage and traits (as example) strong, weak, dextrous are completely useless.

How to change standart traits only for 1 scenario (without creation of a new era)?

And second question: In my scenario, many units are guards (0 movement). And trait "quick" is completely useless for them too. How to remove 1 trait for one kind of units but that they continued to receive other random traits? it is possible or no? )
H-Hour
Posts: 222
Joined: April 14th, 2010, 12:27 pm

Re: How to change or remove "standart" traits?

Post by H-Hour »

There may be a more elegant solution, but if you're using custom units you can give them a custom race definition and set their traits that way.
myav
Posts: 85
Joined: August 23rd, 2008, 12:53 pm

Re: How to change or remove "standart" traits?

Post by myav »

H-Hour wrote:but if you're using custom units
No.. Units are "not custom" (players hire usual units and they receive upgrades later) and I can't use custom race.

any other ideas? help pls...
gfgtdf
Developer
Posts: 1452
Joined: February 10th, 2013, 2:25 pm

Re: How to change or remove "standart" traits?

Post by gfgtdf »

you could change the traits in the recruit event, if you create the units iwth [unit] you can also give the traits explicit in [unit].
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
User avatar
Azeal
Posts: 97
Joined: July 24th, 2012, 8:19 am

Re: How to change or remove "standart" traits?

Post by Azeal »

I would suggest making custom units for that scenario that are clones of regular ones with a different id and random_traits=no. You could also try a prerecruit event like this

Code: Select all

[event]
    name=prerecruit
    first_time_only=no
    [modify_unit]
        [filter]
            x,y=$x1,$y1
        [/filter]
        [modifications]
            random_trait=no
        [/modifications]
    [/modify_unit]
[/event]
however prerecruit only works before the image is displayed, so I doubt it modifies the unit before traits are generated. To my knowledge there is no way to remove traits from a unit, and if there is it will likely only remove the trait name and not the modifications the trait has already made.

Perhaps a solution would be in variables. You could try a prerecruit event with {CLEAR_VARIABLE unit.trait} or {CLEAR_VARIABLE unit.traits} followed by transform_unit with transform_to=$unit.id to refresh its stats. A solution along these lines would be the best bet.
Post Reply