VoidExpanse/scope-npc

From AtomicTorchWiki
Revision as of 06:52, 14 February 2014 by Damonwall (talk | contribs) (Created page with "<noinclude> Category:VoidExpanse/api_scopes </noinclude> = Scope npc = Manages NPC bahavior, interactions and parameters. '''Visibility:''' Global. == List of functions...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


Scope npc

Manages NPC bahavior, interactions and parameters.

Visibility: Global.

List of functions

Objectives

CountObjectives
Arguments Returns Example
  • int: npc_ship_id

int: current number of objectives

var obj = npc.CountObjectives(25334);
Description


AddObjective
Arguments Returns Example
  • int: npc_ship_id
  • string: name
  • (optional) object: parameters

void

npc.AddObjective(25334, "go_to_jumpgate", {jumpgate_id: 15});
Description

Adds new objective to npc. All objectives must be implemented in npc's behavior script. NOTE: in object parameters there shouldn't be parameters "name" - it will be overriden by name of objective.


CleanObjectives
Arguments Returns Example
  • int: npc_ship_id

void

npc.CleanObjectives(25334);
Description

Removes all objectives from npc ship.


NextObjective
Arguments Returns Example
  • int: npc_ship_id

void

npc.NextObjective(25334);
Description

Moves current objective pointer to next position, removes previous objective.


GetCurrentObjective
Arguments Returns Example
  • int: npc_ship_id

object:

  • string: name - name of objective, specified in AddObjective
  • string: ... - other parameters, specified in AddObjective
var objective = npc.GetCurrentObjective(25334);
Description

Gets current npc's objective (or null if none)


GetCurrentObjectiveTimer
Arguments Returns Example
  • int: npc_ship_id

double: time - how long npc is doing his current objective

var time = npc.GetCurrentObjectiveTimer(25334);
Description