Jump to content

How To Invert $life Values?


chrisedu

Recommended Posts

A more general (and more expensive but more flexible) solution is to use the fit() or one if it's variants fit01() fit11() and fit10().

e.g.: fit($LIFE, 0, 1, 1, 0)

remaps $LIFE to the complement. In this case, yes 1-$LIFE is more efficient but remapping to another range requires offsets and multipliers.

A simpler version:

fit01($LIFE, 1, 0)

where you know $LIFE will be between 0 and 1 hence the name fit01.

You can remap the range to whatever you want.

fit01($LIFE, 0.8, -0.2) will remap $LIFE going from 0 - 1 to 0.8 - -0.2 and so on....

Hope this is helpful. Perhaps too much information.

Link to comment
Share on other sites

  • 4 weeks later...
A more general (and more expensive but more flexible) solution is to use the fit() or one if it's variants fit01() fit11() and fit10().

e.g.: fit($LIFE, 0, 1, 1, 0)

remaps $LIFE to the complement. In this case, yes 1-$LIFE is more efficient but remapping to another range requires offsets and multipliers.

A simpler version:

fit01($LIFE, 1, 0)

where you know $LIFE will be between 0 and 1 hence the name fit01.

You can remap the range to whatever you want.

fit01($LIFE, 0.8, -0.2) will remap $LIFE going from 0 - 1 to 0.8 - -0.2 and so on....

Hope this is helpful. Perhaps too much information.

try using the Age POP and $AGE instead, unless you like getting into expressions ;)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...