Player NPC

From Cubic Castles Wiki
Jump to navigation Jump to search

Player NPCs can be purchased from the Cubit Store for Cubit.png 1,000. They are interactable Mannequins that can be coded to talk to players and or give them Temporary Items. Upon walking up to a Player NPC that you have placed, three options will appear. These options are Dress Up, Talk, and Code. Selecting Dress Up will allow you to add clothes to your NPC, similar to Mannequins. Selecting Talk will trigger the NPC to read the first script and follow it's instructions. Selecting Code will open the panel of scripts to be edited.

NPC Coding

First, selecting Code will open a panel where you can add, delete, or rename scripts. An NPC will have two scripts coded by default that demonstrates how to create a basic piece of dialogue. To begin coding, select the first script, or delete the two scripts and create a new one. Then select Edit to begin editing your script.

Commands

Selecting Add Command will give you a list of commands that can be added to your script. Note that you cannot have more than ten commands in a single script.

Start Chat

This command must be in the script in order to create dialogue. Say and Reply commands will not work if there is no Start Chat command in the script. By itself, this command does nothing. The Start Chat command can be placed anywhere in the script to function.

Say

The Say command will allow the NPC to talk to the player interacting with it. The NPC will say whatever is typed into the Say command. Adding more Say commands in a row will make the dialogue last longer and will require the player to click/press to continue to the next box of dialogue. A Reply command must be placed anywhere below all Say commands for the dialogue to work. A Start Chat command must be anywhere in the script for the dialogue to work. Normally, your Say commands will be at the top of your script to avoid issues with other commands.

Reply

The Reply command will allow the player to respond to the NPC. One script can have up to three Reply Commands. Anymore than three will not show up while talking to the NPC. Reply commands must be below all other commands in the script (except Start Chat commands). The script must have a Start Chat command and at least one Say commands for a Reply command to work.

The Reply command has two text boxes: the reply, and the goto. Whatever is typed into the reply box will be the response that a player can select when talking to the NPC. the goto box will determine what script is triggered next once that response is selected. Type the name of another script into the goto box. Now the NPC will go to that script whenever that reply is selected when talking to the NPC. The goto must be the exact name of another script. If the goto or script is typed incorrectly, the NPC will crash when that reply is selected.

Echo

The Echo command will send a message into the chat that is only visible to the player that is interacting with the NPC. The echo command must be placed above all goto commands to work properly. Type in what you want the echo to say into the command.

(still a work in progress)