Page 1 of 1

Little hint for setting ages in LifePlay [Hint]

Posted: Wed Jul 27, 2022 3:28 am
by Raddeck
If your intention when creating a mod, is to only add something like this inside your lpscene files:

Code: Select all

Actor2:age => Actor:age
Actor2:age += random(-10, 10)
It can create bugs
Possible bug: Age limitation

Explication:
If Actor age is 18 and the random chose -10, Actor2 will have 8


The best way is like that:

Code: Select all

Actor2:age => Actor:age
Actor2:age += random(-10, 10)
If Actor2:age < 18
    Actor2:age => 18
EndIf
Meaning:
If Actor age is 18 and the random chose -10, Actor2 will have 8
No problem, I set Actor2 to 18 as default.


That's it!