You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While trying to use this I realized that something that would be very useful would be to be able to have nested AdvancedModifierConditions, so I wrote my own.
class_name NestedCondition
extends AdvancedModifierCondition
## This condition is only if all the nested conditions are true.
## (If inverted, instead returns true if all nested conditions are false)
@export var conditions: Array[AdvancedModifierCondition]
var noise:FastNoiseLite
func is_condition_met(grid: GaeaGrid, cell) -> bool:
for condition in conditions:
# Sets child noise seeds to selfs noise seed
if condition.get("noise") != null and condition.get("noise") is FastNoiseLite:
condition.noise.seed = noise.seed
# Checks if the condition is met
if not condition.is_condition_met(grid, cell):
return (mode!=Mode.NORMAL)
# If none of them return false, return true (or opposite if inverted)
return (mode==Mode.NORMAL)
This allows for much more advanced and customized generation. I don't quite know how to properly do the noise offsetting, that is the part that I feel could be vastly improved.
The text was updated successfully, but these errors were encountered:
While trying to use this I realized that something that would be very useful would be to be able to have nested AdvancedModifierConditions, so I wrote my own.
This allows for much more advanced and customized generation. I don't quite know how to properly do the noise offsetting, that is the part that I feel could be vastly improved.
The text was updated successfully, but these errors were encountered: