Developer Store
Support
Member Forums

Screenshots
FAQ
Documentation
License
Known Issues
Downloads

MMOWorkshop.com Store Opened!
Torque MMO Kit - Open Sourced!
Torque MMO Kit - 1.5.2 Port Alpha Test
Torque MMO Kit - OSX Status

GarageGames.com irc.prairiegames.com
#mmoworkshop

PyTorque
TGB Web Browser


webgovernor

hallsofvalhalla - After a long epiphany
Leathel - FoHO pre-Alpha 2.42
OldRod - More Musings on the MMO Industry
xapken - nice
J.C. Smith - 0.0.4.1 Build Notes
Wolf Dreamer - Pointless blog of pointless things
AthlonJedi2 - Server Nuked !!!!!
gamer_goof - New character model GIRL1 available only $4
... MORE BLOGS!

My other project
A Message to all the new people.
MyGame
changing the primary class
See Ya Classes, Hello Skills!
XP Based Skills
fxFoliageReplicator zone loading...
Is it just me, or is it slow in ...
Places where NPC quest-givers ha...
TalentRaspel Grid

Creating NPCs and Monsters


Before beginning, make sure you have completed the Creating a New Zone tutorial so that you have a zone to add your spawns to. For this tutorial we'll be using a zone called, “Zone One”.

STEP ONE: Making Spawns

Creating an NPC

We are going to create a new guard that spawns in Zone One, his name is Guard Andarry.

1. Load the Torque MMO Kit IDE and open the file ~\test.game\genesis\zone\zoneone\spawns.py

2. First, we are going to assign a new spawn variable and name the spawn Guard Andarry.

#--- Guard Andarry
spawn = DBSpawn() 
spawn.name = "Guard Andarry"

Now, we want our guard to only talk to members of the Fellowship of Light realm and attack everyone else.

spawn.realm = RPG_REALM_LIGHT

Next, we add the following:

spawn.pclass = "Paladin"
spawn.plevel = 20
spawn.sex = "Male"
spawn.race = "Human"

This defines him as a level 20 Human Paladin. He could be also given secondary and tertiary classes, which may look like this:

spawn.sclass = "Monk"
spawn.slevel = 18
spawn.tclass = "Bard"
spawn.tlevel = 16

Guard Andarry is not a monster and we do not want him to behave like one, so we add the following line:

spawn.isMonster = False

He is a unique NPC, therefore only one of him spawns in the world at a time, so we need to add the following flag:

spawn.flags = RPG_SPAWN_UNIQUE

Next, we define his aggro range. Remember he will not attack people in the Fellowship of Light realm but he will attack members of the Minions of Darkness realm or monster realm. His aggro range defines how close they must be in order for him to attack.

spawn.aggroRange = 20

Now, we can define what he looks and sounds like:

spawn.textureArms = "tset_0_arms"
spawn.textureLegs = "tset_0_legs"
spawn.textureBody = "tset_0_body"
spawn.textureHands = "tset_0_hands"
spawn.textureFeet = "tset_0_feet"
spawn.vocalSet = 'A'

Lastly we add dialog and a description. The dialog is commented out right now because it needs to be written first which we will do in the Dialog and Quests tutorial. His description is viewed in a player's combat window when they 'evaluate' his difficulty.

#spawn.dialog = "Guard Andarry Dialog" 
spawn.desc = "Guard Andarry is a loyal guard of the citadel."

You can also supply configuration data as arguments to the DBSpawn constructor or mix the two styles.

spawn = DBSpawn(name = "Guard Andarry", realm = RPG_REALM_LIGHT, pclass = "Paladin",plevel = 20, sex = "Male", race = "Human", isMonster = False, flags = RPG_SPAWN_UNIQUE, aggroRange = 20, textureArms = "tset_0_arms", textureLegs = "tset_0_legs", textureBody = "tset_0_body", textureHands = "tset_0_hands", textureFeet = "tset_0_feet", dialog = "Guard Andarry Dialog", desc = "Guard Andarry is a loyal guard of the citadel.", vocalSet = 'A')

For a complete list of defines (and their defaults) that can be added to spawns see: ~\mud\world\spawn.py

3. Save the file, select World -> Compile World and verify that there are no errors in the message window.

Creating a Monster

We are going to create a few wolves to spawn in Zone One.

1. Open the file ~\*.game\genesis\zone\zoneone\spawns.py inside of the Torque MMO Kit IDE.

2. We are going to begin by laying out the sounds that the wolves will use. Up to 4 sounds can be assigned to each category: Attack, Alert, Pain, and Death.

sounds = SpawnSoundProfile()
sounds.sndAttack1 = "character/ZombieDog_Attack1.ogg"
sounds.sndAttack2 = "character/ZombieDog_Attack2.ogg"
sounds.sndAttack3 = "character/ZombieDog_Attack3.ogg"
sounds.sndAlert1 = "character/ZombieDog_Growl2.ogg"
sounds.sndAlert2 = "character/ZombieDog_Growl3.ogg"
sounds.sndPain1 = "character/ZombieDog_Hurt1.ogg"
sounds.sndPain2 = "character/ZombieDog_Hurt2.ogg"
sounds.sndPain3 = "character/ZombieDog_Hurt2.ogg"
sounds.sndDeath1 = "character/ZombieDog_Death1.ogg"
sounds.sndDeath2 = "character/ZombieDog_Death2.ogg"

Here we are going to assign a new spawn variable and name the spawn Radothe.

#--- Radothe
spawn = DBSpawn() 
spawn.name = "Radothe"

Next, we add the following:

spawn.pclass = "Warrior"
spawn.plevel = 5
spawn.sclass = "Shaman"
spawn.slevel = 4
spawn.sex = "Male"
spawn.race = "Animal"

We are now going to give him a difficulty modifier which will give him extra health:

spawn.difficultyMod = 2

In order to define him as a unique monster so that he attacks players and NPCs in all realms, we assign the following:

spawn.isMonster = True
spawn.flags = RPG_SPAWN_UNIQUE

Next, we define his aggro range. He will attack everything within this range, except monsters.

spawn.aggroRange = 20

Now, we can define what he looks and sounds like (using the sounds set up in the profile above):

spawn.model = "wolf/wolf.dts"
spawn.textureSingle = "wolf_grey"
spawn.sndProfile = sounds

His description is viewed in a player's combat window when they 'evaluate' his difficulty.

spawn.desc = "Radothe is a fearsome beast!"

Lastly, we add his loot table which lists items he'll drop from his corpse. The item is commented out right now because it needs to be created first. Please see the Items and Loot tutorial on how to do this.

loot = DBLootProto()
#loot.addItem("Wolf Fang", RPG_FREQ_ALWAYS)
spawn.loot = loot


3. Now let's create some non-unique wolves to spawn along with Radothe.

Their spawn is virtually identical to Radothe, so we are going to clone Radothe's spawn and change only the parameters we need to, beginning with the name.

spawn = spawn.clone()
spawn.name = "Wild Wolf"

The Wild Wolf spawns should be considerably easier than Radothe so we are going to remove his secondary class and difficulty modifier.

spawn.plevel = 2
spawn.sclass = None
spawn.slevel = None
spawn.difficultyMod = 1

Since the wolves are not unique mobs and we want to have several running around at the same time, we must remove the unique flag from Radothe.

spawn.flags = 0

Lastly, we add his loot table which is different from Radothe in that we don't want them to drop their fangs as often as Radothe does. The item is commented out right now because it needs to be created first. Please see the Items and Loot tutorial on how to do this.

loot = DBLootProto()
#loot.addItem("Wolf Fang", RPG_FREQ_UNCOMMON)
spawn.loot = loot


4. Save the file, select World -> Compile World and verify that there are no errors in the message window.

Respawn Time Info

It is possible to add a respawn timer to your spawn. In order to do this you would add the following bit to your spawn

spawn.respawnTimer = durSecond * 60 * 5 # 5 minutes

or

spawn.respawnTimer = durMinute * 5 # 5 minutes

Doing this will set the spawn time to 5 minutes. The default spawn time in an online game is 3 minutes + 30 seconds per 10 levels. There is also a 30 second check on spawn time, so you will want to set your spawns mostly in 30 second chunks.

Also, your spawn time cannot be less than the default spawn time. If you wish to change the way this works please visit the following thread:
http://www.mmoworkshop.com/trac/mom/phpbb?page=viewtopic.php&p=9791

STEP TWO: Assigning Spawns to Spawngroups

Spawngroups are assigned to zones. Monsters and NPCs will not show up inside of the game unless they are in a spawngroup. Spawngroups are added to spawnpoints inside of the mission editor, I will go into this in the section titled Step 3. Let's assign our guard and wolves to Zone One first!

1. Open the file ~\test.game\genesis\zone\zoneone\spawngroups.py inside of the Torque MMO Kit IDE.

2. Add the following text:

#--- Guard Andarry    
guard = DBSpawnInfo(spawn="Guard Andarry")
sg = DBSpawnGroup(zone="zoneone",groupName="GUARD ANDARRY")
sg.addSpawnInfo(guard)

#--- Radothe
mob1 = DBSpawnInfo(spawn="Radothe",startTime=20, endTime=6)
mob2 = DBSpawnInfo(spawn="Wild Wolf",frequency=RPG_FREQ_ALWAYS)
sg = DBSpawnGroup(zone="zoneone",groupName="RADOTHE")
sg.addSpawnInfo(mob1)
sg.addSpawnInfo(mob2)

The spawn information tells who spawns in a spawngroup, it can also include information such as what time they spawn at and what time they despawn(in military time), as well as the frequency of their spawn. The zone name is the name of the zone that the spawngroup will be placed. The groupname is used inside of the Torque mission editor which we will place in the next step.

3. Save the file, select World -> Compile World and verify that there are no errors.

STEP THREE: Adding Spawngroups to Spawnpoints in a Zone

1. From inside the Torque MMO Kit IDE select World -> Edit Zone and load zoneone.

2. From the dropdown menu on the top of your screen select World -> Drop at Camera w/Rot. Enter World Editor Creator mode (F4). Position the player, including rotation, where you want to place a spawnpoint. In the bottom right hand window select Shapes/Misc/rpgSpawnPointMarker. This will place a spawnpoint in your position.

3a. Static Mobs Next you need to assign a spawngroup to that spawnpoint. Hit the F3 key to enter World Editor Inspector. Click on the + sign next to the folder called Mission Group in the top right hand window. Find the rpgSpawnPoint at the bottom of the list. Select any other item and then select your rpgSpawnPoint (this quirk has something to do with Torque) Add 'GUARD ANDARRY' to SpawnGroup and in the space next to the apply button type GUARD_ANDARRY (Torque doesn't like spaces so the underscore is necessary in this case) and hit Apply. With the WanderGroup set to -1, this spawngroup will NOT wander.

Note: NPCs that interact should not wander because when a player is interacting with them the dialog window will close as they continue walking.

3b. Wandering Mobs Do exactly as above, except change WanderGroup to 1. Note that each WanderGroup needs a different number but there can be multiple spawngroups assigned to the same WanderGroup.

Creating a WayPoint Hit the F4 key, this time select Shapes/Misc/rpgWayPointMarker. Locate the rpgWayPoint at the bottom of the Mission Group folder, select another item and then select it again (this again has to do with Torque). Hit the F3 key to go back into World Editor Inspector. As in the previous step, you will need to assign the WanderGroup number to 1. This means that all spawngroups with the WanderGroup of 1 will walk to this point. Randomly place these around. Be careful that the spawns aren't hindered by models or buildings as they will get stuck on or in them. Note: rotation does NOT matter when placing waypoints, so you don't need to be as exact as with the spawnpoints.

4. Add your RADOTHE spawngroup inside of the editor using one of the 2 methods listed above.

5. /camp out to the main menu and enter the single player world 'editworld' again. You should see your spawns!




Return to Tutorials