Dynamically setting up min/max value of an exported variable

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Halfmania33

Hi everyone,

i exported a few variables with min and max value this way :

export(int, 5, 21, 1) var points = 5
export(int, 2, 9, 1) var distance = 2

How can i define dynamically the max value for “distance” in this way (or another way if it’s not possible) :

export(int, 2, maxDistance, 1) var distance = 2

with maxDistance calculated like this :

maxDistance = (points-2)/2 if fmod(points, 2) == 0 else (points-1)/2

As you can see, i want the max value of “distance” dependant on “points” variable.

:bust_in_silhouette: Reply From: exuin

You can’t sorry, it has to be a constant value. But you could just check whenever you set the variable

Sad to learn it’s impossible.
But thank you for your answer.
Have a nice day.

Halfmania33 | 2023-03-06 18:10