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


talentraspel

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!

Lets talk skills.
Mob chase range?
Auction House + Internal Mail Sy...
Crafting Wiki
Every Day a new question... :)
Web Host
Seeking experienced programmer
Integrating Green-Ear SDK (paid)
where character information is s...
Spells Problem...

Creating Factions


Simple Faction Creation

In this first section, we are going to create a simple faction assignment and build upon it in the following section. We will assign the 'Guards of Jorfu' faction to Guard Andarry with no opposing factions.

Note: If players kill members of a faction that has no opposing faction, this means they will never be able to raise their faction with this group...unless faction standing can be given by a neutral NPC via quests or other dialog actions.

1. Load the Torque MMO Kit IDE. Open ~\test.game\genesis\faction\globalfactions.py

2. We are going to set up a faction assignment for Guard Andarry as a member of the 'Guards of Jorfu'. Add the following text and save:

DBFaction(name="Guards of Jorfu",attackMsg = "$tgt, you have offended the Guards of Jorfu!",enemyMsg = "")

Here we have created a new faction prototype called 'Guards of Jorfu'. We set up an attack message that is displayed to players who have angered the guards. We do not need to setup an enemyMsg because, in this example, they do not have an opposing faction. We'll create an opposing faction in the next section.

3. Now, let's add the faction assignment to Guard Andarry using the name we created in the previous step. Open ~\test.game\genesis\zone\zoneone\spawns.py and add the following text to Guard Andarry's spawn information and save:

spawn.addFaction("Guards of Jorfu")


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

5. Select World -> Edit Zone and load zoneone. Guard Andarry will be neutral towards you, now kill him a few times and watch what happens :)

Note: You can evaluate 'g' Guard Andarry to watch how your faction standing with him changes.

Intermediate Faction Creation

In this section, we'll add the 'Wolves of Jorfu' as an enemy faction to the 'Guards of Jorfu'.

1. Let's fill in the enemyMsg that we created in the previous steps which we left blank:

enemyMsg = "The city will be ours!"

This is the message that enemies of the 'Guards of Jorfu' will scream.

2. Now, let's create the opposing faction the 'Wolves of Jorfu'. Add the following line of text and save:

DBFaction(name="Wolves of Jorfu", attackMsg = "$tgt, you have offended the Wolves of Jorfu!", 
enemyMsg = "Down with the guards!") 

This creates a new faction called the 'Wolves of Jorfu', gives them an attack message, and an enemy message.

3. These two factions need to know that they hate each other and will attack members in good standing of the opposing faction. Add the following text and save:

DBFactionRelation(faction="Guards of Jorfu", otherFaction = "Wolves of Jorfu", relation = RPG_FACTION_HATED)
DBFactionRelation(faction="Wolves of Jorfu", otherFaction = "Guards of Jorfu", relation = RPG_FACTION_HATED)

4. We need to assign the 'Wolves of Jorfu' faction and a killfaction to each of the new wolf spawns. Open ~\test.game\genesis\zone\zoneone\spawns.py and add the following to Radothe and save the file:

spawn.addFaction("Wolves of Jorfu")
spawn.addKillFaction("Guards of Jorfu")

Note the cloning function is used in this file, so this faction assignment is attached to both Radothe and the Wild Wolf.

We need to change the Monster flag to False so that the wolves will only attack players if they have a bad faction standing with the 'Wolves of Jorfu'. The line should now look like this:

spawn.isMonster = False


5. We must also add the killfaction assignment to Guard Andarry's spawn. Add the following text to his spawn information and save:

spawn.addKillFaction("Wolves of Jorfu")


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

7. Select World -> Edit Zone and load zoneone to test your changes.




Return to Tutorials