random_placement num_items WFL
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.
random_placement num_items WFL
Hi,
random_placement's num_items is deprecated and I get a warning saying use WFL instead.
I included the parentheses and it still giving me the deprecation warning.
Anyone know how I'm supposed to use WFL here?
I tried looking up examples in the campaigns and macros folders.
In terrain-utils.cfg it is the same as I have here. In HttT scenario 12 it is still using the old form (might need updating).
Thanks
Edit: I tried throwing in ceil.
random_placement's num_items is deprecated and I get a warning saying use WFL instead.
I included the parentheses and it still giving me the deprecation warning.
Code: Select all
num_items="(size * ({N} / 100))"
num_items="$(size * ({N} / 100))"
does not work.Anyone know how I'm supposed to use WFL here?
I tried looking up examples in the campaigns and macros folders.
In terrain-utils.cfg it is the same as I have here. In HttT scenario 12 it is still using the old form (might need updating).
Thanks
Edit: I tried throwing in ceil.
num_items="ceil(size * ({N} / 100))"
gave an error message. num_items="$(ceil(size * ({N} / 100)))"
didn't work.- Celtic_Minstrel
- Developer
- Posts: 2211
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: random_placement num_items WFL
It looks like there's a bug with the way the engine detects that you're using the deprecated form of
num_items
. Your first version is correct. We'll fix the bug, but in the meantime you can silence the deprecation warning by putting a space between the quote and parentheses, like so:
Code: Select all
num_items=" (size * ({N} / 100)) "
Re: random_placement num_items WFL
Unfortunately this is now broken in 1.15.9Celtic_Minstrel wrote: ↑December 20th, 2020, 8:23 pm It looks like there's a bug with the way the engine detects that you're using the deprecated form ofnum_items
. Your first version is correct. We'll fix the bug, but in the meantime you can silence the deprecation warning by putting a space between the quote and parentheses, like so:Code: Select all
num_items=" (size * ({N} / 100)) "
Edit: wesnoth.eval_formula() is returning 0