Retrying when condition is false?

Any information about the fun attribute is given here.

Moderator: Plugin Moderators

User avatar
Pederont
Villager
Reactions:
Posts: 24
Joined: 10 Aug 2019, 09:01
Location: South Korea
Plugins: Showcase Store
Contact:

Plugin Creator

Platform

Retrying when condition is false?

#1

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
User avatar
CommanderABab
AB
Reactions:
Posts: 11080
Joined: 07 Jun 2016, 21:12
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Retrying when condition is false?

#2

Post by CommanderABab »

Try a value of p closer to 1.
User avatar
Pederont
Villager
Reactions:
Posts: 24
Joined: 10 Aug 2019, 09:01
Location: South Korea
Plugins: Showcase Store
Contact:

Plugin Creator

Platform

Re: Retrying when condition is false?

#3

Post by Pederont »

CommanderABab wrote: 28 May 2023, 05: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..
User avatar
JustAnyone
Developer
Reactions:
Posts: 3470
Joined: 23 Jul 2017, 12:45
Location: Easter Island
Plugins: Showcase Store

Platform

Re: Retrying when condition is false?

#4

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, 09:49

Re: Retrying when condition is false?

#5

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
Developer
Reactions:
Posts: 3470
Joined: 23 Jul 2017, 12:45
Location: Easter Island
Plugins: Showcase Store

Platform

Re: Retrying when condition is false?

#6

Post by JustAnyone »

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

Return to “Fun attribute”