Minimum value for [attacks] and [damage]
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.
- Spannerbag
- Posts: 876
- Joined: December 18th, 2016, 6:14 pm
- Location: Yes
Minimum value for [attacks] and [damage]
Hi,
Not sure if I've missed something obvious hence this post.
I want to nerf an opponent's
Using values greater than opponents strikes/damage via both
Examples;
1: normal combat 2: [damage] (damage mod shown in special name) 3: [attacks] (strikes mod shown in special name)
Is there any way I can specify a minum value (=1) for both strikes and damage?
I had hoped to use something like
Hope this all makes sense.
Cheers!
-- Spannerbag
Not sure if I've missed something obvious hence this post.
I want to nerf an opponent's
[attacks] and [damage] significantly but not below 1 in either case (v1.18.5).Using values greater than opponents strikes/damage via both
sub and [divide] on 1.18 result in 0.Examples;
1: normal combat 2: [damage] (damage mod shown in special name) 3: [attacks] (strikes mod shown in special name)
Is there any way I can specify a minum value (=1) for both strikes and damage?
I had hoped to use something like
value="max(1,round(???/divide_value))" or value="max(1,(??? - sub_value))"but don't know how to access the appropriate number of stikes/damage in a straightforward manner as the nerf applies for both melee and ranged (and even if I separate the specials by range some units have multiple ranged and/or melee attacks anyway so I still have to select the correct value from 2+ options).Hope this all makes sense.
Cheers!
-- Spannerbag
Re: Minimum value for [attacks] and [damage]
[filter_base_value]
- Spannerbag
- Posts: 876
- Joined: December 18th, 2016, 6:14 pm
- Location: Yes
Re: Minimum value for [attacks] and [damage]
Brilliant!
Got everything working as I wanted.
Thanks ever so much for your help, much appreciated as always.
Cheers!
-- Spannerbag
-
newfrenchy83
- Code Contributor
- Posts: 214
- Joined: October 6th, 2017, 12:57 pm
Re: Minimum value for [attacks] and [damage]
after wesnoth 1.19.2, you could use min_value=1 for prevent final value to be lower what 1
- Spannerbag
- Posts: 876
- Joined: December 18th, 2016, 6:14 pm
- Location: Yes
Re: Minimum value for [attacks] and [damage]
Noted, thanks!
Cheers!
-- Spannerbag