Documentation and Syntax

QuestX File Documentation and Syntax

Upon startup QuestX will create a number of folders and files for storing data. The directories are coloured blue, and files red.

  • Configuration
    • npc_world_config.txt (Configuration options related to NPC spawning/despawning)
    • general_config.txt (General configuration options)
    • sql_logging_config.txt (Configuration options related to SQL logging of ChunkPopulationDensity)
  • Data
    • NPCs (All NPC files are stored here in folders)
    • Quests (All Quest files are stored here in folders)
    • Reputation (Player's reputation's are stored here)
    • fixed_spawns.qxs (Serialized data about NPCs with fixed spawn locations)
    • pop_density_data.db (SQLite database which tracks data required for dynamic spawning of NPC's in more commonly populated chunks)

NPCs

  • NPC Name (Each NPC will have a separate folder)
    • Progression (Stores the players progression for a task)
    • custom_script.qxs (Contains custom trigger information which is triggered from a speech option)
    • dialogue.dlg (Contains speech information for the NPC)
    • death_trigger.qxs (Contains information on what happens when an NPC dies)
    • properties.txt (Basic NPC properties for customisation)
    • quest_link.qxs (Link to the main quest file, if this NPC is involved in a quest)
    • task.qxs (Information about the task this NPC can distribute)

Dynamic Variables and Colour Codes

The dynamic variables are listed below and will be replaced with the corresponding value when displayed to the player.

VariableDisplayed
%playername%The Player's name
%playercount%The number of players on the server
%servername%The name of the server
%motd%Message of the day

Colour Codes are also supported, each code must be preceeded by the ampersand (&).

Code StringColour
&0Black
&1Navy
&2Green
&3Teal
&4Maroon
&5Purple
&6Gold
&7Silver
&8Grey
&9Blue
&aLime
&bAqua
&cRed
&dPink
&eYellow
&fWhite

Custom Script

The custom_script.qxs file allows your NPCs to perform certain actions or trigger events when a speech option is selected. There can be multiple action files per NPCs allow them to perform a variety of actions. The custom script file will only load values you provide, meaning you won't get an error if the file is empty, simply nothing will happen. This is useful as it will allow me to add more content in updates without you having to modify your files, all you need do is simple add the key.

The custom script files like the death_trigger file takes the extension .qxs (QuestX script). By default each npc will have a file called custom_script.qxs which is activated whenever a dialogue action of 'c' is specified. Custom files can also be designated, see the Dialogue section below for this. Here I will explain the formatting of the file and options you can take advantage of.

Calling a custom script file will automatically end the conversation with the NPC.

KeyData TypeValuesEffect
INVOKE_QUESTBooleantrue/falseInvoke the NPC's quest
INVOKE_TASKBooleantrue/falseInvoke the NPC's task
DAMAGE_PLAYERIntegerAny whole numberThe number of hearts damage to do to the Player
LIGHTNINGString (Custom)Custom Format (See Below)Configurable lightning strikes
SPAWN_MOBSString (Custom)Custom Format (See Below)Configurable amount of mob spawns
SPAWN_MOB_RANGEIntegerAny whole numberThe range relative to the Player within which the mobs will be spawned
SPAWN_COOLDOWN_MINUTESIntegerAny whole numberThe number of minutes between which mobs can be spawned
DESPAWN_MOB_SECONDSIntegerAny whole numberThe number of seconds after which all the mobs which were spawned should be despawned
MOBS_TARGET_PLAYERBooleantrue/falseWhether the mobs will be set to target(attack) the Player
ATTACK_PLAYERBooleantrue/falseSet wheteher the NPC should attack the Player after saying something
PLAY_RECORDInteger(2256 - 2267)The block id of the record you want to play to the Player.
PLAYER_GIVE_ITEMSString (Custom)Custom Format (See Below)The set of items to give to the Player
GIVE_ITEMS_COOLDOWN_MINUTESIntegerAny whole numberThe number of minutes between which a Player can recieve items from the NPC
POTION_EFFECTString (Custom)Custom Format (See Below)Configurable potion effects to apply to the Player
TELEPORT_PLAYERString (Custom)Custom Format (See Below)Teleport the Player to a Location

Invoke Quest/Task

This feature allows you to invoke a quest or task and perform custom actions. For example if you wanted to have the player kill x mobs you could trigger the tasks and spawn some mobs around him to help him complete the task.

Note that you cannot invoke both a quest and a task, if you try to invoke both only the task will be invoked.

Lightning Format

Following the standard format of QuestX files seperate components are seperated by the hash (#) key and individual values for components separated by a comma (,). The format for Lightning is as follows.

<number of strikes>#<range>#<tick delay>#<damage player>

All these values must be integers, except for the last value which must be a boolean (true/false) value. Each lightning strike will be targeted at a random location within the specified block range relative to the Players location. The tick delay is the delay in ticks between each strike. 20 Server ticks is equal to 1 second, so for example 30 seconds is (20 * 30) = 600 and so 1 minute is (600 * 2) = 1200 ticks and so on. The final value of damage player determines whether the lightning can actually damage the player or not.

Mob Spawn Format

For the mob spawn action to be enabled all 5 values must be detected, this means SPAWN_MOBS, SPAWN_MOB_RANGE, SPAWN_COOLDOWN_MINUTES, DESPAWN_MOB_SECONDS and MOBS_TARGET_PLAYER must all be present or the action will not be activated.

The format for spawning mobs is identidcal to the kill entities format, except in this case entities to kill is number of entities to spawn. So for example.

SPAWN_MOBS:PIG,3#WOLF,5#SPIDER,1

Player Give Items Format

Like mob spawns both the PLAYER_GIVE_ITEMS and PLAYER_GIVE_ITEMS_COOLDOWN value must be present or the action will not be activated.

Follows the same format as fetch items. See below.

Potion Effect Format

<potion effect>,<duration>,<amplitude>

Multiple potion effects can applied to a player and you can customise the effect type, the duration in second and the amplitude (how much effect the potion has on the Player). Following the standard format each value is seperated by a comma and each potion effect by the hash key, for example.

POTION_EFFECT:SPEED,10,5
POTION_EFFECT:SPEED,10,5#SLOW,5,6#FAST_DIGGING,5,6

The amplitude and duration in seconds must both be integer values. However the potion effect must be either a String or an integer which represents the potion. See the table beneath.

Potion NamePotion IDEffect
SPEED1Increases movement speed.
SLOW2Decreases movement speed.
FAST_DIGGING3Increases dig speed.
SLOW_DIGGING4Decreases dig speed.
INCREASE_DAMAGE5Increases damage dealt.
HEAL6Heals an entity.
HARM7Hurts an entity.
JUMP8Increases jump height.
CONFUSION9Warps vision on the client.
REGENERATION10Regenerates health.
DAMAGE_RESISTANCE11Decreases damage dealt to an entity.
FIRE_RESISTANCE12Stops fire damage.
WATER_BREATHING13Allows breathing underwater.
INVISIBILITY14Grants invisibility.
BLINDNESS15Blinds an entity.
NIGHT_VISION16Allows an entity to see in the dark.
HUNGER17Increases hunger.
WEAKNESS18Decreases damage dealt by an entity.
POISON19Deals damage to an entity over time.
WITHER20Deals damage to an entity over time and gives the health to the shooter.

So, far instance these two configurations would be the same as SPEED is equal to ID 1 and vice versa.
POTION_EFFECT:SPEED,10,5
POTION_EFFECT:1,10,5


NPC Dialogue

The dialogue.dlg file found in the folder of each NPC contains all the information your NPC will need for speech with other players. The format is as simple as I could make it and I have made an effort to include checks when the dialogue file is being parsed by the plugin to help you determine where you have incorrectly formatted the file, if you have done so. Within the dialogue file you can customise:

  • How many speech options there are. (Unlimited but I would suggest 5-6 max so the chat isn't flooded)
  • The reputation level needed to select a specific speech option (5 Tiers, Evil-Bad-Ordinary-Good-Hero-Any)
  • What type of trigger each speech option will have (End the conversation, start a quest, start a task, continue the conversation)

This is the format each line must follow. If a part of the dialogue file does not conform to this format an error will be thrown when parsing the file and you will have to fix any errors for it to work. Each option is delimited (separated) by the # (hash) key. This is how the parser splits up each setting so these must be included.

<node_id> # say # <speech_options> # <speech> # <reputation_levels> # <triggers>

<node_id> # reply # <speech_options> # <speech>

Node ID

The 'Node ID' tag is what links each speech option to another to allow you to have branching trees. A dialgoue file must always start with a Node ID of 1 and have a corresponding reply. Depending on which speech option a player chooses will depend what Node ID they are linked to for the next dialgoue. For instance if you start out with the first speech options, say there are 3 options. Choosing the first will link you to the node 11, choosing the second node 12, and the third node 13. So the new node which will be linked to is determined by (current node)(speech index). A diagram may help better explain this, see below.

Dialogue Tree Configuration

As you can hopefully gather from this diagram the configuration may seem complicated but it makes sense. You simply combine your current node with the index of speech chosen and this will start off your new node. I would suggest laying out your files as I have done in the picture, with each reply directly underneath your speech option. Each NPC that comes with the plugin has its own dialogue.dlg file so there are plenty of examples for you to look at. GUI for creation of NPC's, tasks and Quests is in development.

Response Type

A response type follows the node ID in your dialogue file, it must either be 'say' or 'reply'. For each 'say' line the player will be able to choose which speech option they wish to say. And the reply will be the NPC's response to the selected speech option. For example:

1#say#Hello#Goodbye
1#reply#Player said Hello#Player said Goodbye

Speech Options and Speech Strings

This field must denote an integer value. It represents the number of speech options a player has to choose from, similarly a reply must have an equal number of options for its corresponding speech line.

1#say#speech 1#speech 2#speech 3# etc...
1#reply#reply 1#reply 2#reply 3# etc...

As you can see each speech is wrapped in speech marks, and each string seperated by the #(hash) delimiter. Do not include hashes in your speech options. I have not coded the parser to escape characters yet.

Reputation Levels

There is a reputation tracking system in-game. Every action a player takes towards NPCs and other players will have an effect on his in-game reputation. A players reputation is specified by an integer value between -1000 and 1000. Depending on a players reputation he will have a certain title.

TitleMinimum ReputationMaximum ReputationName Colour (Optional Tag API)
Guardian8001000Green
Lawman600800Dark Green
Sheriff400600Gold
Officer200400Aqua
Neutral0200No Colour
Thug-200-400Dark Grey
Criminal-600-400Gold
Hitman-800-600Red
Villain-1000-800Dark Red


For the sake of simplicity dialogue reputation levels only check for generic rep levels, these are specified as follows.

TitleMinimum ReputationMaximum ReputationReputation Tag
Any-10001000a
Hero6001000h
Good200600g
Ordinary-200200o
Bad-600-200b
Evil-1000-600e

So, for applying this to your dialogue files you simply insert the generic rep level you want a certain speech option to apply to. Choosing from the letters (a, h, g, o, b, e) only, as specified in the table above. For most cases you will be using a so that all players can use the speech option. However if you only want a certain speech option to apply to a bandit, or lawman simply insert the relevant letter. Some examples.

Example 1
1#say#2#I am a law abiding citizen#I am a criminal#g#b
1#reply#"Good to know#Curse you criminal
Example 2
1#say#2#I am a hero#I am evil#h#e
1#reply#That you are#Get away from me

Dialogue Triggers

Trigger TypeTrigger TagEffect
NonenNo Effect
CustomcInvokes the actions from the default 'custom_trigger.qxs' file and ends the conversation
Custom Definedc{your_file_name.qxs}Invokes the actions from the specified trigger file 'your_file_name.qxs' file and ends the conversation
EndeWill end the conversation
TasktAssigns the player the task in the NPC's folder
QuestqLinks the player to a quest

Triggers 'n' and 'e' should be self explanatory, every conversation path must have an end trigger at the end. For the most part if you are simply continuing a conversation you will want to use the 'n' trigger.

Custom triggers, see above, allow for the execution of various events. Invoking a custom trigger will automatically end the conversation. By default the NPC has one custom trigger file 'custom_trigger.qxs' which is invoked by specifying c as a dialgoue trigger, however to designate a custom action to be loaded from another custom trigger file you must specify this by using the format c{myfile.qxs} and this file must reside in the root NPC directory along with the dialgoue and property files. Your file name must end in .qxs or it will not be detected

Now, for tasks. Including the task triggger 't' will automatically end the conversation and assign the player a task specific to that NPC. Read the task file section for configuring task files.

Finally quests, these are more complicated that tasks as they can have multiple objectives and involve numerous NPC's. Each NPC has a quest_link.qxs file which links to a main quest which is stored elsewhere. For configuring these files head to the 'Quests' section.


NPC Properties

All of the properties of the NPC that are customisable are stored within the propeties.txt file located in the root of the NPC folder. Do not change the key (that is the string before the colon (:)), only change the values.
donotchangekey:value can be changed
Properties.txt

KeyData TypeValuesEffect
LOADBooleantrue/falseWhether the NPC can be included in dynamic spawning
NAMEStringAny StringThe name of the NPC, should not differ from the folder name
CHAT_COLOURCharactera/b/c/d/e/f/0/1/2/3/4/5/6/7/8/9The colour of the NPC's name (If Tag API support is enabled)
MOVEABLEBooleantrue/falseWhether the NPC will move around
ATTACKABLEBooleantrue/falseWhether the NPC can be attacked and take damage
AGGRESSIVEBooleantrue/falseWhether the NPC will be aggressive towards players with a generic reputation level of Bad or Evil
MIN_PAUSE_TICKSIntegerAny whole numberThe minimum number of server ticks the NPC will wait between moving
MAX_PAUSE_TICKSIntegerAny whole numberThe maximum number of server ticks the NPC will wait between moving
MAX_VARIATIONIntegerAny whole numberThe maximum number of blocks the NPC will move away from its initial spawn point
RESPAWN_TICKSIntegerAny whole numberThe number of server ticks between respawns
MAX_HEALTHIntegerAny whole numberThe health the NPC has (A player has 20 health)
DAMAGE_MODIFIERIntegerAny whole numberThe damage an NPC will do to a player (per hit)
RETALLIATION_MULTIPLIERIntegerAny whole numberThe distance, as a multiple of MAX_VARIATION which the NPC will move from its spawn location to chase a player that has attacked it
INVENTORY_DROPSString (Custom)Custom Format (See Below)The items the NPC will drop upon death, percentage drop chance precision of 0.01%
GEARString (Custom)Custom Format (See Below)The item ids of the gear the NPC will wear

Inventory Drops Format

Each NPC can have an unlimited amount of items it can drop on death, the item id, data value and percentage drop chance is configurable within 0.01% (Out of 10,000). Each item must be configurated as follows.
<item_id>,<data>,<quantity>,<drop_chance>
The drop chance must be a whole number between 0 and 10,000. Here are some examples.

Drop ChanceDrop Percentage
10,000100%
5,00050%
10.01%
00%

So, percentage drop rate = (100 x Drop Chance) / 10,000

If you want to include multiple drops each drop must be separated by the # (hash) key as so.
<itemid1>,<data1>,<quantity1>,<dropchance1>#<itemid2>,<data2>,<quantity2>,<dropchance2>

NPC Gear Format

To equip an NPC with armour you need to enter the item ID of the item and it will be equipped to the NPC upon spawning. As seen below the item ID ordering is from the bottom up, with the item in hand being last. If you don't want anything to be equipped just leave the value as 0.
<boots>,<legs>,<chest>,<head>,<hand>


NPC Death Trigger

This file contains customisable settings which determine what happens when an NPC dies. Currently there are only 5 options but I plan to add more in future updates. The formatting for these settings can be found directly below in the tasks section.

KeyData TypeValuesEffect
REWARD_EXPIntegerAny whole numberThe experience orbs that are spawned for a player when he completes the task
REWARD_REPIntegerAny whole numberThe reputation a players gains, or looses for completing a task
REWARD_GOLDIntegerAny whole numberThe currency awarded to a player for completing a task
EXECUTE_PLAYER_CMDString (Custom)Custom Format (See Below)The commands which will automatically be executed by the player upon completion of the task
EXECUTE_SERVER_CMDString (Custom)Custom Format (See Below)The commands which will automatically be executed by the server (OPERATOR privileges) upon completion of the task

Tasks

Each NPC can assign a task to players. Each task can have one, or none, of each objective. There are 3 objectives which can be set for tasks (Fetching items, killing entities and killing NPCs). The file format follows the same configuration as NPC files, a simple key:value. The list of keys and possible values can be seen below

KeyData TypeValuesEffect
TASK_NAMEStringAny StringThe name of the task which will be shown to the Player
TASK_DESCRIPTIONStringAny StringA description of what the player needs to do to complete the task (Will be displayed to the Player upon starting the task)
FETCH_ITEMSString (Custom)Custom Format (See Below)The items a Player needs to bring the NPC
KILL_ENTITIESString (Custom)Custom Format (See Below)The type, and number of entities a player needs to kill
KILL_NPCSString (Custom)Custom Format (See Below)The NPCs a Player needs to kill
INCOMPLETE_TASK_SPEECHStringAny StringThe message sent to a player if he returns to talk to the NPC without completing a task
COMPLETE_TASK_SPEECHStringAny StringThe message sent to a player when he returns to talk to the NPC after completing a task
REWARD_ITEMSString (Custom)Custom Format (See Below)The items a player is awarded when completing a task
REWARD_EXPIntegerAny whole numberThe experience orbs that are spawned for a player when he completes the task
REWARD_REPIntegerAny whole numberThe reputation a players gains, or looses for completing a task
REWARD_GOLDIntegerAny whole numberThe currency awarded to a player for completing a task
REWARD_PERMISSIONS_ADDString (Custom)Custom Format (See Below)The permission nodes added to a player upon completing a task
REWARD_PERMISSIONS_REMOVEString (Custom)Custom Format (See Below)The permission nodes removed from a player upon completing a task
EXECUTE_PLAYER_CMDString (Custom)Custom Format (See Below)The commands which will automatically be executed by the player upon completion of the task
EXECUTE_SERVER_CMDString (Custom)Custom Format (See Below)The commands which will automatically be executed by the server (OPERATOR privileges) upon completion of the task
FIREWORKSString (Custom)Custom Format (See Below)Fireworks will be ignited about the players location on completing the task.

If you do not want the task to include any of the following options simply enter a '0' as their value, eg REWARD_EXP:0
FETCH_ITEMS, KILL_ENTITIES, KILL_NPCS, REWARD_ITEMS, REWARD_EXP, REWARD_REP, REWARD_GOLD, REWARD_PERMISSIONS_ADD, REWARD_PERMISSIONS_REMOVE, EXECUTE_PLAYER_CMD, EXECUTE_SERVER_CMD, FIREWORKS

Fetch Items Format

The inventory drops format is similar to the inventory drop chance format explained above, except these drops have no need for the percentage chance modifier, so this format is.

<item_id>,<data>,<quantity>#<item_id_2>,<data_2>,<quantity_2>

So for example, 3 stone.

3,0,3

And, 6 yellow wool, 2 red wool and 25 coal.

35,4,6#35,14,2#263,0,25

Kill Entities Format

Each entity set is seperated by a hash (#) with individual values in each set being split by a comma (,), as so.

<entity>,<number_to_kill>#<entity2>,<number_to_kill_2>
Or for a single set.
<entity>,<number_to_kill>
Entities: BAT, BLAZE, CAVE_SPIDER, CHICKEN, COW, CREEPER, ENDER_DRAGON, ENDERMAN, GHAST, GIANT, IRON_GOLEM, MAGMA_CUBE, PIG, PIG_ZOMBIE, SHEEP, SILVERFISH, SKELETON, SLIME, SNOWMAN, SPIDER, SQUID, VILLAGER, WITCH, WOLF, ZOMBIE.


The entity must be typed with underscores if it contains one, else the plugin won't recognise the entity type. Some examples, kill 3 wolves.

WOLF,3

And, kill 4 pigs, 2 chickens and a cave spider.

PIG,4#CHICKEN,2#CAVE_SPIDER,1

Kill NPC Format

You can only be assigned to kill one of each NPC, as each NPC name must be unique. The format follows with each NPC seperated by the hash (#) key.

<NPC1>#<NPC2>

So for example, kill NPC 'Notch'

NOTCH

Or, kill 'Notch', 'Adamki11s' and 'Bukkit'

Notch#Adamki11s#Bukkit

Reward Items Format


Follows the same format as fetch items. See above.

Reward Permissions Format Format

This works similarly to the Kill NPCs format, simply enter your permission node and if you are entering multiple values separate them with a hash (#) key.
perm.node1#perm.node2#perms.etc.etc

EXECUTE_X_CMD Format

These are formatted in exactly the same way as the ADD and REMOVE permission node rewards, each command delimited (separated) with a hash (NOTE : No backspace (\) is needed). For example.

time set 1

And for multiple commands

time set 1#rl#stop

Fireworks Format

Upon completion of a quest or task you can set it so fireworks are ignited around the player in a circle. If you do not want this feature just set the value to 0, it is 0 by default also. The format is simply the radius around the player and the number of fireworks you want released. Make sure both these numbers are non-negative integers.

<radius>,<fireworks>

To get at least a decent looking effect the number of fireworks I would recommend using would be 5 times the radius. For example.

6,36


Quests

Quests are without a doubt, the largest feature in QuestX. Quests allow you to craft intricate storylines and add a stronger sense of purpose to your Minecraft server, especially important for RPG servers.

QuestX contains a number of Quests which are extracted when you first run the plugin, however there will come a point where you want to create your own custom Quests. The great thing about Quests is that you can customise so much, for example, say you want to have new players learn the rules before playing. You could send them on a quest which requires they talk to various NPCs about the rules and mechanics of server and then upon completion of the Quest award them the permission nodes needed to build etc. On the other hand you could send them on a grand quest to help a town clear rebuild by gathering supplies for the villages and killing x amount of entites/NPCs and then give them a large reward of gold or items upon completion. Whatever type of Quest you wish to create, QuestX should be able to fulfill your goals.

So, onto the format. Quests will be stored in a .zip file which will include your Quest files, and any NPCs related to your Quests all bundled into one file. In the interest of sharing and ease of setup, each Quest must come with a setup file which will provide a series of steps the user must go through to set the spawns of NPCs related to the Quest (If you make a quest and want to keep it exclusive to your server instead of sharing it I will talk about how you can bypass the checks later).

So this is what the hierarchy of your Zip file should look similar to, for example, say our quest is called 'Start' and has one NPC named 'Adam'.
The directories are coloured blue, and files red.

  • Start.zip
    • NPCs
      • Adam
        • Progression
        • quest_link.qxs
        • death_trigger.qxs
        • properties.qxs
        • dialogue.dlg
        • task.qxs
    • Quest
      • Progression
      • quest.qxs
      • setup.qxs

The NPC file structure has been covered above and so will not be included here; the only file which will be mentioned is the quest_link.qxs file.

Main Quest File (quest.qxs)

This file is the backbone of your quest, it links together all the NPCs and the task a player is required to perform for the specified NPC along with rewards and other customisation options. It is formatted as follows.

KeyData TypeValuesEffect
NAMEStringAny StringThe Name of the Quest which will be shown to the Player
START_TEXTStringAny StringThe message sent to the Player upon starting a quest
END_TEXTStringAny StringThe message sent to the Player upon completing a quest
REWARD_ITEMSString (Custom)Custom Format (See Below)The items a player is awarded when completing a task
REWARD_EXPIntegerAny whole numberThe experience orbs that are spawned for a player when he completes the task
REWARD_REPIntegerAny whole numberThe reputation a players gains, or looses for completing a task
REWARD_GOLDIntegerAny whole numberThe currency awarded to a player for completing a task
REWARD_PERMISSIONS_ADDString (Custom)Custom Format (See Below)The permission nodes added to a player upon completing a task
REWARD_PERMISSIONS_REMOVEString (Custom)Custom Format (See Below)The permission nodes removed from a player upon completing a task
EXECUTE_PLAYER_CMDString (Custom)Custom Format (See Below)The commands which will automatically be executed by the player upon completion of the task
EXECUTE_SERVER_CMDString (Custom)Custom Format (See Below)The commands which will automatically be executed by the server (OPERATOR privileges) upon completion of the task
FIREWORKSString (Custom)Custom Format (See Below)Fireworks will be ignited about the players location on completing the task.
REQ_REP_MINIntegerAny whole numberThe minimum reputation needed to start a quest. If no level is needed set this to 0
REQ_REP_MAXIntegerAny whole numberThe maximum reputation needed to start a quest. If no level is needed set this to 0
REQ_GOLDIntegerAny whole numberThe gold need to start a quest, note that no gold is taken from the players account
REQ_COMPLETED_QUESTSString (Custom)Custom Format (See Below)The quests that need to be completed prior to starting this one

The reward values and formats have not been included here because they have already been documented in the 'Tasks' section above.

The values shown in the table are the basic customisation options, excluding the rewards. After all of these comes the configuration of Quest tasks! The format for a quest task is as follows.

<node_id> : <task_type> : <task_data> : <completion_npc> : <next_task_description>

Node ID

The node ID is simply a reference for the order of the tasks. Each node ID must start at 1 and then the proceeding task 2, then 3, then 4 and so on. It doesn't matter which order these are in the quest.qxs file but you can't have node id's of 1,2 and 4, they have to be sequential.

Task Type

The task type indicates what type of action the Player must take to complete the quest task. The task type can take one of four values.

Task TypeDescription
GOTOGoto a certain Location
FETCH_ITEMSFetch x amount of items and return them to the specified NPC
KILL_ENTITIESKill n amount of entities of type t
KILL_NPCKill the specified NPCs
TALK_NPCGo and speak to the specified NPC


Goto Format

The formatting for this Quest objective is simple.

world,x,y,z#range#descripion

The world, x, y and z coordinates are the Location you want the Player to travel to. The range, in terms of blocks is the minimum distance the Player needs to be from the Location to complete the task. Think of this as a 'tolerance' setting, so if the player needs to be in a specific location the range could be set to 4 or 5, on the other hand if you want the Player to go to a city just specify the Location as the centre of the city and then specify a larger range such as 30-50. Finally, the description is the text which will be sent to the player upon recieving the objective, this tells the Player where he needs to go. For example.

world,50,70,-122#30#Go to the city centre.
world,34,25,445#5#Go to some secret cave.

Require Completed Quests Format (REQ_COMPLETED_QUESTS)

The format for this is simply a comma delimited list. For example.

asinglequest
onequest,anotherquest,afinalquest


The format for type TALK_NPC is simply a String of the NPC the player needs to go and speak to.

The remaining formats have all been documented above.

Fetch Items Format

Kill Entities Format

Kill NPC Format

Quest Link File (quest_link.qxs)

Each NPC involved in a Quest has a quest_link.qxs file. This file contains the information about what parts of the quest they can allow a player to complete. This is to allow a Player to visit different NPCs during a quest. For example if you want NPC 'A' to assign a task to a player to deliver some items to NPC name 'B'. You would assign NPC 'B' the permission to complete node 1 of the quest. So for this case the Player would not be able to continue the quest without taking the items to the correct NPC. This is more easily understood with some examples and by looking through the Quest files. The file is formatted as follows.

KeyData TypeValuesEffect
QUEST_NAMEStringAny StringThe name of the quest the NPC links to
NODESString (Custom)Custom (See Below)The nodes of a quest an NPC can complete

Quest Nodes Completion Format

The nodes in the quest link file are just the integer values of nodes seperated by commas, like so.

1,2,3

Quest Setup File (setup.qxs)

The setup file contains basic information related to setting up the quests which is constituted of having to set fixed spawn locations for NPC's involved in the Quest. This means the NPCs must always spawn in the same 'area'. The formatting is as follows.

KeyData TypeValuesEffect
NameStringAny StringName of the quest

Then the format is similar to that of nodes in quests. The first character is the node number as an integer, followed by the name of the NPC that will be spawned and then some descriptive text about what role the NPC will play in the Quest, or possibly a suggestion of where to spawn the NPC.
<node_id>:<npc_name>#<Description>
For example.
1:Adam#Choose a spawn location for the main NPC of the quest (Recommended location : Town centre)


Comments

Posts Quoted:
Reply
Clear All Quotes