Skip to content

routine

Black Ram edited this page Jul 1, 2024 · 1 revision

Routine

The routines are the commitments that the character has to do in the room. For example, study, work, etc...

Commitment

For create a new commitment you need to create a new instance of the CommitmentBaseModel class and add it into a game rooms dictionary, when the game is initialized.

For create a new instance of CommitmentBaseModel you need to pass:

  • id: a unique identifier for the commitment. It is used to reference the commitment in the game (must be unique).
  • character: the character or a list of characters that do the commitment.
  • room: the room where the commitment is done.
  • props: the room properties. The properties are:
    • name: the name of the commitment.
    • fromHour: the hour when the commitment starts. If the commitment is not started yet, it will be hidden. If you set 3, the commitment will be hidden into hours 1 and 2, and will be shown from hour 3.
    • toHour: the hour when the commitment ends. If the commitment is ended yet, it will be hidden. If you set 3, the commitment will be shown into hours 1 and 2 and will be hidden from hour 3.
    • fromDay: the day when the commitment starts. If the commitment is not started yet, it will be hidden. If you set 3, the commitment will be hidden into days 1 and 2, and will be shown from day 3.
    • toDay: the day when the commitment ends. If the commitment is ended yet, it will be hidden. If you set 3, the commitment will be shown into days 1 and 2 and will be hidden from day 3.
    • renderImage: the image. It can be a string, an JSX.Element, GraphicItemInterface or a Pixi'VN Canvas Item. Or a function to manage multiple icon types. For example to have a icon based on time.
    • executionType: the execution type. If is automatic the onRun() runned automatically when the palayer is in the room. If is interaction the player must interact with the character to run the onRun() function.
    • onRun: is a function that is called when the player interacts with the character.
    • disabled: whether is disabled. You can also pass a Pixi'VN flag name.
    • hidden: whether is hidden. You can also pass a Pixi'VN flag name.
    • renderIcon: the commitment icon. It can be a string, an JSX.Element, GraphicItemInterface or a Pixi'VN Canvas Item. Or a function to manage multiple icon types. For example to have a icon based on time.
    • priority: the priority. The higher the number, the higher the priority.
Clone this wiki locally