Npc crp V3

From Unofficial QEdit Wiki Guide
Jump to: navigation, search

Syntax

Syntax: npc_crp_v3 Register1

  • Register1 = Start of continuous 6 Registers

1st register = Position X (decimal)

2nd register = Position Y (decimal)

3rd register = Position Z (decimal)

4th register = Rotation of NPC (decimal)

5th register = State (0 is alive, 1 is dead, 2 is Invisible Named Text Box)

6th register = NPC Template (0 - 63 in decimal, look in someusefulinfo.zip)


Use

Used to create an NPC occupying the 2nd (Green) character slot. If the slot is occupied, moves that player to the spawn location.

NOTE: Creating an NPC with this OPCode Will do the following effects when other players are present:

  • The player in the Green slot will appear as the NPC for everyone else.
  • The player in the Green slot will move to the designate spawn argument.

Though this OPCode does not overwrite the Player Character's data, it is still highly recommended to put failsafes and checks to prevent spawning an NPC with multiple players.

Example


100:     leti R1, 00000208 //Makes register 1 equal 520. (X position of where the npc will spawn.)
         leti R2, 00000000 //Makes register 2 equal 520. (Y position of where the npc will spawn.).
         leti R3, 00000022 //Makes register 3 equal 34. (Z position of where the npc will spawn.)
         leti R4, 00000014 //Makes register 4 equal 20. (Rotation of spawned npc.)
         leti R5, 00000000 //Makes register 5 equal 0. (Is npc dead flag set to 00000000 for alive, 00000001 for dead and lying on the ground.)
         leti R6, 00000011 //Makes register 6 equal 17. (Preset npc number. Determines what the npc will have equipped, level, and type. 00000011 is MONTAGUE)
         npc_crp_v3 R1 //Loads the npc with the leti arguments listed above.
         ret 

Also see

load_npc_data, get_npc_data, leti,

npc_crp_id_V3, npc_stop, ret,

npc_play, npc_kill, HEX: