[Command] getUntil

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 »

Actor.getUntil()


USE:
Mostly use inside lpai files.

Returns the time this person will stop being at their current location and AI would look for a new location again.
The value returned isn't the time of the day, but total hours elapsed since the start of the current game, i.e. HoursElapsed + HoursStayed
HoursElapsed being a special variable


TYPE: Command, non-Ref
RETURNS: Float
THEME:
COMPARE:


EXAMPLE:

Code: Select all

If AI.hasRelationship(Spouses, Dating)
    SO = getRelatedPersonQuick(Spouses, Dating)
    Until = SO.getUntil()
    If Until - HoursElapsed > 1
        Dest = SO.getBuilding(current)
        Work = SO.getBuilding(work)
        If !Dest.isSameBuilding(Work)
            AI.setCurrentLocation(Dest)
            AI.setUntil(Until)
        Endif
        SO.delete()
    Endif
Endif
Last edited by Raddeck on Wed Jun 15, 2022 7:04 pm, edited 1 time in total.
Reason: Added 1 example
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