Plot:Alter NPC

From OHRRPGCE-Wiki

Jump to: navigation, search
alter NPC (who,NPCstat,value)

Changes the stats of an NPC. Constants for this command have been included in PLOTSCR.HSD. Alter NPC can be used for many purposes.


  • Alter NPC (who,NPCstat:picture,picture number)
  • Alter NPC (who,NPCstat:palette,palette number)
  • Alter NPC (who,NPCstat:move type,move type code)

Available move types

  • NPCmovetype:standstill
  • NPCmovetype:wander
  • NPCmovetype:pace
  • NPCmovetype:rightturns
  • NPCmovetype:leftturns
  • NPCmovetype:randomturns
  • NPCmovetype:chaseyou
  • NPCmovetype:avoidyou
  • Alter NPC (who,NPCstat:move speed,speed)
  • Alter NPC (who,NPCstat:display text,text box number)
  • Alter NPC (who,NPCstat:when activated,when activated code)

Available when activated codes

  • NPCwhenactivated:changedirection
  • NPCwhenactivated:faceplayer
  • NPCwhenactivated:donotfaceplayer
  • Alter NPC (who,NPCstat:give item,item number + 1) Note: item number is offset by one, a zero means no item
  • Alter NPC (who,NPCstat:pushability,pushability code)

Available pushability codes

  • NPCpush:off
  • NPCpush:full
  • NPCpush:horizontal
  • NPCpush:vertical
  • NPCpush:uponly
  • NPCpush:rightonly
  • NPCpush:downonly
  • NPCpush:leftonly
  • Alter NPC (who,NPCstat:activation,activation code)

Available activation codes

  • NPCactivation:use
  • NPCactivation:touch
  • NPCactivation:stepon
  • Alter NPC (who,NPCstat:script,script ID)
  • Alter NPC (who,NPCstat:script argument,number)
  • Alter NPC (who,NPCstat:vehicle,vehicle ID)Normally you would only give an NPC ID number to alter NPC, but if you want to use an NPC reference it will still work. Just remember that alter NPC changes every copy of the NPC on the map, not just the specific one you referenced.

A good way to make use of Alter NPC is to wrap it in your own script. For example:

[edit] Examples

# Example AlterNPC wrapper for changing NPC appearance
plotscript,change NPC,who=0,picture=0,palette=0,begin
  Alter NPC(who,NPCstat:picture,picture)
  Alter NPC(who,NPCstat:palette,palette)
end
Personal tools