Module: Scheduler::EventTasks

Defined in:
docs/4_Systems_003_Map_Engine.rb

Overview

Module that aim to add task triggered by events actions

List of the event actions :

- begin_step
- begin_jump
- begin_slide
- end_step
- end_jump
- end_slide

Events can be specified with the following criteria

  • map_id / :any : ID of the map where the task can trigger
  • event_id / :any : ID of the event that trigger the task (-1 = player, -2 its first follower, -3 its second, ...)

Parameter sent to the task :

- event : Game_Character object that triggered the task
- event_id : ID of the event that triggered the task (for :any tasks)
- map_id : ID of the map where the task was triggered (for :any tasks)

Important note : The system will detect the original id & map of the events (that's why the event object is sent & its id)

Class Method Summary collapse

Class Method Details

.delete(task_type, description, event_id, map_id)

Remove a task

Parameters:

  • task_type (Symbol) —

    one of the specific tasks

  • description (String) —

    description allowing to retrieve the task

  • event_id (Integer, :any) —

    id of the event that triggers the task

  • map_id (Integer, :any) —

    id of the map where the task triggers



1992
1993
# File 'docs/4_Systems_003_Map_Engine.rb', line 1992

def delete(task_type, description, event_id, map_id)
end

.on(task_type, description, event_id = :any, map_id = :any, &task)

Add a new task

Parameters:

  • task_type (Symbol) —

    one of the specific tasks

  • description (String) —

    description allowing to retrieve the task

  • event_id (Integer, :any) (defaults to: :any) —

    id of the event that triggers the task

  • map_id (Integer, :any) (defaults to: :any) —

    id of the map where the task triggers

  • task (Proc) —

    task executed



1970
1971
# File 'docs/4_Systems_003_Map_Engine.rb', line 1970

def on(task_type, description, event_id = :any, map_id = :any, &task)
end

.resolve_id(event) ⇒ Integer

Resolve the id of the event

Parameters:

Returns:

  • (Integer)


1980
1981
# File 'docs/4_Systems_003_Map_Engine.rb', line 1980

def resolve_id(event)
end

.resolve_map_id(event) ⇒ Integer

Resolve the id of the event

Parameters:

Returns:

  • (Integer)


1985
1986
# File 'docs/4_Systems_003_Map_Engine.rb', line 1985

def resolve_map_id(event)
end

.trigger(task_type, event)

Trigger a specific task

Parameters:

  • task_type (Symbol) —

    one of the specific tasks

  • event (Game_Character) —

    event triggering the task



1975
1976
# File 'docs/4_Systems_003_Map_Engine.rb', line 1975

def trigger(task_type, event)
end