NPC (TeaScript)
Revision as of 18:42, 27 April 2020 by A nova on fyre (talk | contribs) (Added information on the .facing value.)
NPC is a class in TeaScript.vbs that allows you to read/write values of NPCs.
To read the value of NPC
use:
NPC(index).name
To change the value of NPC
use:
NPC(index).name = value
Name | Type | Description |
---|---|---|
X
|
R&W | The X coordinate of the NPC. |
Y
|
R&W | The Y coordinate of the NPC. |
prX
|
R&W | The X coordinate of the original position's NPC. |
prY
|
R&W | The Y coordinate of the original position's NPC. |
Xsp
|
R&W | The X speed of the NPC. |
Ysp
|
R&W | The Y speed of the NPC. |
ExtX
|
R&W | The X placement of the GFX expansion. |
ExtY
|
R&W | The Y placement of the GFX expansion. |
Facing
|
R&W | The direction of the NPC. 1: Left; 0: Right. |
ForeColor
|
R&W | The color of the NPC. |
ivala
|
R&W | Determines the behavior of an NPC. More info on how it works here. |
haswing | R&W | Determines if the NPC has the wing special type and what type of wing movement it has.
0 = None 1 = Jump 2 = Hover Left/Right 3 = Hover Up/Down 4 = Chase 5 = Hover Forward 6 = Lakitu's AI 7 = Controlled by NPC-308 8 = SMW Lines |
id | R&W | The ID of the NPC. |
addvx | ? | The x-axis platform speed of the NPC. |
addvy | ? | The y-axis platform speed of the NPC. |
friendly | R&W | Determines if the NPC is marked as friendly or not. |
nomove | R&W | Determines if the NPC's "Don't Move" flag is enabled. |
curframe | R&W | The current frame of the NPC. |
health | R&W | The current health of the NPC. |
advSet | R&W | Determines the advanced value of the NPC. |
permID | R | The permanent ID of the NPC. |
alive | R&W | Checks for if the NPC is alive or active. |
bkupx | R&W | The backup X position of the NPC. |
bkupy | R&W | The backup Y position of the NPC. |
stand | R&W | Determines if the NPC has gravity or not. |
curtime | R&W | The individual frame timer of the NPC. Counts from 1 to 8 and then resets. Not every NPC uses the frame timer. |
scount | ? | This value will be set to 1 if another NPC is colliding with the current. Does not work in 1.4.5. |
dtcplayer | R&W | Determines if the NPC is able to detect players. (1: off, 0: on) |
dtcliquid | R&W | Determines if the NPC is able to detect liquids or not. |
dtcself | R&W | Determines if the NPC is able to detect other NPCs or not. |
zpos | R&W | The z-position of the NPC. |
inwater | R | Determines if the NPC is using water physics or not. |
extset | R&W | External settings for the NPC. For bubbles and SMW Lakitus, the NPC ID they contain will depend on what this value is set to. |
target | R&W | Determines which player is closest. Primarily used for chasing NPCs. |
hide | R&W | Hides the NPC if set to 1. |
langle | R&W | Unknown effect. |
stimer | R&W | Unknown effect. |
talkevent | R&W | Determines the event called (as a string) when pressing up in front of a friendly NPC. |
deathevent | R&W | Determines the event called (as a string) when the assigned NPC is destroyed. |
activeevent | R&W | Determines the event called (as a string) when the assigned NPC first appears onscreen. |
nextframeevent | R&W | Determines the event called (as a string) every frame the assigned NPC is active. |
touchevent | R&W | Determines the event called (as a string) when a player comes into collision with the assigned NPC. |
grabedevent | R&W | Determines the event called (as a string) when a player grabs the assigned NPC. |