This is a brief explination of the scripting process for Mobs and NPC's for Core3. Best way is to examine the file contents on the server and follow the convention.
IMPORTANT NOTE - Cut and paste is your friend
There are just a few things that you must remember to check for.
- Object and template files are placed in the correct folders (Easy to get them switched about).
- Spelling - This is the most common cause of errors and tail chasing.
- Typo's - Yeah i know you think you can spell!!
- Entries are made in each file.
- Did i mention spelling?
Server scripts for NPC's for Core3 are composed of two seperate sets of scripts for both the object and template files. For this exercise, we will use General Grievous as the NPC we are going to add to the server.
Object files.
The object files instruct the core to create and name mobs using the information they contain. Name, path to iff, etc. These are all located in the folder:
bin/scripts/object/mobile/..
Folders are grouped into relative groups and follow the same structure and naming convention (for the most part) as the object .iff files contained in the Tre files. It's a good idea to keep following this convention as it makes the files easier to find.
The Object files comprise of three parts needed by the server for it to work.
- The object template file (general_grievous.lua)
- objects.lua file
- serverobjects.lua file
The Object Template File.
This contains the information for naming the mob and the path to its relative .iff file. There is one of these files for each mob that is added to the server, so for General Grievous it will contain:
Code:
object_mobile_ep3_general_grievous = object_mobile_ep3_shared_general_grievous:new {
}
ObjectTemplates:addTemplate(object_mobile_ep3_general_grievous, "object/mobile/ep3/general_grievous.iff")
The objects.lua File.
This contains naming, path and refactoring information. It contains entries for each mob that is placed in the same folder. and contains:
Code:object_mobile_ep3_shared_general_grievous = SharedCreatureObjectTemplate:new {
clientTemplateFileName = "object/mobile/ep3/shared_general_grievous.iff"
}
ObjectTemplates:addClientTemplate(object_mobile_ep3_shared_general_grievous, "object/mobile/ep3/shared_general_grievous.iff")
The serverobjects.lua File.
This file contains the includeFile command for each mob to be added and is specific to the folder in which it resides. Every folder has one. It needs to contain:
Code:includeFile("ep3/general_grievous.lua")
Thats all the information needed for the object file.
The Template File.
This is the file that contains all of the information about what the mob actually is. Type, stats, armour, weapons, dialogue etc. It is almost infinatly customizable and one is needed for every mob created.
These are located in:
bin/scripts/mobile/..
This is the contents of the file.
Code:
objectName = "@mob/creature_names:ep3_general_grievous",
socialGroup = "",
pvpFaction = "",
faction = "",
level = 100,
chanceHit = 0.01,
damageMin = 100,
damageMax = 200,
baseXp = 514,
baseHAM = 8100,
baseHAMmax = 9900,
armor = 0,
resists = {10,5,0,0,0,0,0,-1,-1},
meatType = "",
meatAmount = 0,
hideType = "",
hideAmount = 0,
boneType = "",
boneAmount = 0,
milk = 0,
tamingChance = 0,
ferocity = 0,
pvpBitmask = ATTACKABLE,
creatureBitmask = NONE,
optionsBitmask = 128,
diet = HERBIVORE,
templates = {"object/mobile/ep3/general_grievous.iff"},
lootGroups = {
{
groups = {
{group = "crystals_premium", chance = 5000000},
},
lootChance = 10000000
}
},
weapons = {"dark_jedi_weapons_gen4"},
conversationTemplate = "",
attacks = merge(lightsabermaster,forcepowermaster)
}
CreatureTemplates:addCreatureTemplate(general_grievous, "general_grievous")
The serverobjects.lua File.
This folder also needs the include file and contains an entry for each template in the folder:
Code:
includeFile("ep3/general_grievous.lua")
Back to the top