Trait which increases upkeep
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.
Trait which increases upkeep
Is there a way to create a trait which increases upkeep?
I've been working on the devilings, and I would like to give the devilings upkeep without there being alot of upkeep, and I figure if I make it a trait so that olny two out of 5 devilings have this trait then that would not increase their upkeep as quickly while still allowing it to be a factor. This trait would also provide nice benifits, but if I can't get it to increase the upkeep then there is not much point.
I've been working on the devilings, and I would like to give the devilings upkeep without there being alot of upkeep, and I figure if I make it a trait so that olny two out of 5 devilings have this trait then that would not increase their upkeep as quickly while still allowing it to be a factor. This trait would also provide nice benifits, but if I can't get it to increase the upkeep then there is not much point.
"There are two kinds of old men in the world. The kind who didn't go to war and who say that they should have lived fast died young and left a handsome corpse and the old men who did go to war and who say that there is no such thing as a handsome corpse."
Re: Trait which increases upkeep
It shouldn't be too hard to find the number of units with that trait in a side turn event, then divide it by something and subtract that from your gold, but it wouldn't show up in the upkeep.
Re: Trait which increases upkeep
I'd like this trait to happen regaurdless of what map it is on, and that sounds like something I'd have to attach to the map. Also it does not sound like that implication would take into account the free upkeep that villages soak up. I could modify the equasion to take in the number of villages- other upkeep you have, but this seems pretty sloppy. Is there a way to build this into the trait?
"There are two kinds of old men in the world. The kind who didn't go to war and who say that they should have lived fast died young and left a handsome corpse and the old men who did go to war and who say that there is no such thing as a handsome corpse."
Re: Trait which increases upkeep
http://www.wesnoth.org/wiki/SingleUnitWML
upkeep: the amount of upkeep the unit costs.
...
An integer can be used to set the upkeep cost to that number.
upkeep: the amount of upkeep the unit costs.
...
An integer can be used to set the upkeep cost to that number.
Re: Trait which increases upkeep
What I was asking was how do you get the trait to change the upkeep, there does not seem to be a way to do it through an effect.
"There are two kinds of old men in the world. The kind who didn't go to war and who say that they should have lived fast died young and left a handsome corpse and the old men who did go to war and who say that there is no such thing as a handsome corpse."
Re: Trait which increases upkeep
Code: Select all
[event]
name=prerecruit
first_time_only=no
[filter]
[wml_filter]
[modifications]
[trait]
id=more_upkeep
[/trait]
[/modifications]
[/wml_filter]
[/filter]
# set upkeep to 2
{VARIABLE unit.upkeep 2}
[unstore_unit]
variable=unit
find_vacant=no
[/unstore_unit]
[/event]
Re: Trait which increases upkeep
Thanks
"There are two kinds of old men in the world. The kind who didn't go to war and who say that they should have lived fast died young and left a handsome corpse and the old men who did go to war and who say that there is no such thing as a handsome corpse."