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