Retrying when condition is false?

Any information about the fun attribute is given here.
Previous topicNext topic
User avatar
Pederont
Small-town resident
Reactions:
Posts: 32
Joined: 10 Aug 2019, 07:01
Location: South Korea
Plugins: Showcase Store

Plugin Creator

Platform

Retrying when condition is false?

Post by Pederont »

Is it possible to trigger the random fun again till the condition is true?
I made a random spawn plugin that only spawns on empty land, but now it's spawnrate depends on the amount of empty land.

Code: Select all    Reset

"random fun":[{ "condition":{"type":"and", "inner":[{"type":"tree", "invert":true}, {"type":"building","invert":true},{"type":"zone", "invert":true}]}, "actions":[{"type":"build", "id":"$mokokoseed_pederont"}], "p":0.01
JSON checker
Check
If my links doesn't work, turn off your ad blocker
I'm just a furry artist and graphic designer :img
User avatar
CommanderABab
AB
Reactions:
Posts: 11311
Joined: 07 Jun 2016, 19:12
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Retrying when condition is false?

Post by CommanderABab »

Try a value of p closer to 1.
my avatar:
User avatar
Pederont
Small-town resident
Reactions:
Posts: 32
Joined: 10 Aug 2019, 07:01
Location: South Korea
Plugins: Showcase Store

Plugin Creator

Platform

Re: Retrying when condition is false?

Post by Pederont »

CommanderABab wrote: 28 May 2023, 03:50 Try a value of p closer to 1.
Doesn't that increases the entire spawnrate? I just want to keep spawnrate low but want it always spawn on empty tile when random fun triggers..
If my links doesn't work, turn off your ad blocker
I'm just a furry artist and graphic designer :img
User avatar
JustAnyone
Honorary Contributor
Reactions:
Posts: 3685
Joined: 23 Jul 2017, 10:45
Location: Easter Island
Plugins: Showcase Store

Platform

Re: Retrying when condition is false?

Post by JustAnyone »

If I recall correctly, "p" is the probability for the random fun object to get called, not the action.
User avatar
alfredparker360
Villager
Reactions:
Posts: 10
Joined: 29 May 2023, 07:49

Re: Retrying when condition is false?

Post by alfredparker360 »

Doesn't that raise the spawnrate overall? When random fun triggers, I only want to keep the spawn rate low and have it always spawn on an empty tile.
User avatar
JustAnyone
Honorary Contributor
Reactions:
Posts: 3685
Joined: 23 Jul 2017, 10:45
Location: Easter Island
Plugins: Showcase Store

Platform

Re: Retrying when condition is false?

Post by JustAnyone »

And if that condition is true, then the action gets trig.gered, correct.
Previous topicNext topic