Little hint for setting ages in LifePlay [Hint]

To discuss about modding LifePlay game. Best place to ask for help or to share some tips and tricks for coding.
Post Reply
User avatar
Raddeck
LP Manager
Reactions: 1
Posts: 508
Joined: Sat Oct 16, 2021 6:22 pm
Location: LpWorld
Contact:

Post 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!
Like my work? Buy me a coffee or support me on Patreon to keep it coming. :ugeek:
-Don't PM me for support-
Top
Post Reply