Skip to content

Scripted Schedule

Roman Chistokhodov edited this page Jul 1, 2024 · 4 revisions

scripted_schedule is an entity that allows to request a monster to play a schedule from a limited set. The schedule is a list of tasks the monster performs as part of its AI.

Note that currently monsters don't keep their schedules between save-loads. So the monster will forget the schedule set via scripted_schedule on the reload.

Note that scripted_schedule is just a suggestion. The monster might delay playing the schedule and it can be interrupted by the monster's AI conditions.

scripted_schedule allows to suggest that monster should play following schedules:

  • Move away from spot - just move away for some distance.
  • Cover or retreat from spot - try to cover from entity (i.e. find a place where the entity can't "see" the monster).
  • Investigate spot - move to spot, then move back to the original position.
  • Turn to spot - self-descriptive.
  • Move to spot - self-descriptive.

The spot is some other entity the schedule will be played related to. It can be configured via Spot entity parameter. You can also leave this parameter empty. In this case the effect depends on the schedule type - the monster will choose either themselves as a spot (for "Move away from spot", "Cover or retreat from spot") or the scripted_schedule entity itself (for others).

Other parameters are "Min distance" and "Max distance" which are distances in world units used by some schedules. E.g. minimum and maximum distance for moving away from spot or searching for cover. If these parameters are 0 or omitted the default values (depending on the schedule) are used.

The parameter "Move preference" allows to set a preferrable move activity (Auto, Walk, Run) where Auto means to chose the default move activity depending on the schedule. E.g. for "Cover or retreat from spot" it's "Run", while for others it's "Walk".

The parameter "Spot preference" sets how to treat the spot entity. 'Entity' requires the presense of the spot entity at the time the schedule is played. 'Position' means to calculate position of spot entity once and save it as spot for the schedule. This might matter if the spot entity itself can move (e.g. if it's another monster).

Clone this wiki locally