Scattered Evil Editing Reference

Adding NPCs

There are two distinct “entitites”: a map thing, aka Actor, which uses sprites, walks and fights, and secondly a “person” – a conventional entity that defines the conversation (latter was added by me).

Adding a new thing

How to add new thing. There are two problems: register new class for the engine, and register new type in the DB.
Actor classes are registered by adding them to /koraxrpg/basepak.pk3/actors/ (also just /koraxrpg/actors/ – because engine checks both pk3 and subfolders). These text files are read at engine startup. Their format is called DECORATE, and is thoroughly explained in ZDoom wiki: http://zdoom.org/wiki/DECORATE

Let’s do a simple sample thing. Open /koraxrpg/basepak.pk3/actors/krpg/townfolk.txt and find this line:

 actor NPCTownFellow1 : NPCStrifePeasant 19003

This is an actor declaration. It makes a type “NPCTownFellow1” inherit all properties of base type NPCStrifePeasant (which defines all the animations). 19003 is map thing id.

Make a copy of the whole block of text:

 actor NPCTownFellow2 : NPCStrifePeasant 19010
 {
 ConversationID 4
 Scale 1.20
 }

Now you have NPCTownFellow2 thing of map Id = 19010 and with Conversation id = 4.

If you do not like to keep same sprites as for basic peasant, you shall replace them in a way similar to how it is done for NPCStrifePeasant. What you will see in its declaration is a classic state-machine: there is a number of actor states (names are quite self-explanatory) each having number of actions. See http://zdoom.org/wiki/Actor_states

For example:

 Spawn:
 PEAS A 10 A_Look2
 Loop

This runs when actor is spawned on map. “PEAS” is first 4 letters of sprite name, next follow sprite frame (“A”), third is frame’s delay (in 1/40 second IIRC). Finally it is an AI function to call (“A_Look2”). There are a lot of available AI functions, but that takes time to learn, so you may just copy these from existing actors and monsters.
If you want several frames to play in order with identical delay, you may write this:

 PEAS ABCDE 10 A_Look2

This way 5 frames (A to E) will play one after another. A_Look2 ai function will be called on EVERY frame. If you want it be called only on the first frame, split this sequence in two:

 PEAS A 10 A_Look2
 PEAS BCDE 10 A_Look2

“Loop” command means loop this state commands forever (actually – until state changes). “Goto” command means switch to another state.

If all you want is just use different sprite group, simply replace PEAS names with something else. For instance, replacing them with BISH will make new actor have Dark Bishop’s sprites.
Just be careful: the sprite set you are using should at least have all the same frames (BISHA.., BISHB.., etc), or the game will crash.

Adding a new conversation

Go to koraxrpg/data.pk3/ and find coninfo.txt. This is the base conversation script. I’d recommend not to put actual conversations there and use it only to import other files, like:

 import town1

this will use town1.txt for conversations.

There should be example of conversation I added for shopkeeper. It has this header:

 conitem NPCShoppeAttendant 100, ShoppeAttendantMain 0

First goes official “person” name and its Id. It is this Id that is assigned in the Actor’s declaration (ConversationID). Then goes conversation item script name and its related Id. You may have unlimited number of conv.items per person and switch between them in game by using SetActiveConItem(person_id, conitem_id) command in map script.

Mapping Guidelines

Dungeon map location guidelines

This goes for both new maps created from scratch as well as for existing maps being reworked for Scattered Evil.

A dungeon that the player accesses from the travel map (the world) is at the location shown in the world. This means that if the player enters a dungeon in the middle of the desert (e.g. the Nisisil hub), the outdoor areas of the dungeon need to look it – there should be sand and very little if any vegetation around. This goes for all further outdoor areas of the map as well, not just right at the entrance.

As long as the player crosses to the next map of a dungeon hub through a door, tunnel or similar, i.e. the next dungeon map is obviously in the same world location, the same restrictions apply to all outdoor areas.

If the player crosses a magic portal to enter another dungeon map, the outdoor restrictions are lifted, since the magic portal could lead to a place nearby, a place at the other end of the continent or even to a place in another dimension.

There is one notable exception. If a dungeon map of a hub that the player reached through a magic portal has a normal entrance/exit connection to a world location, then this map’s outdoor areas need to conform to that location.

Theoretical example:

  • The first map of a hub is accessed from the desert on the world map. That means the outdoors areas of the first dungeon map need to be covered with yellow sand.
  • The second map of the hub is reached through a simple wooden door from the first map. That means the player is still in the same desert area, thus the outdoors areas are covered with yellow sand.
  • The third map of the hub is reached by a magic portal from the second map, so there are no restrictions.
  • The fourth map of the hub is reached through another magic portal from the first map, however it also exits into the forest far to the west. The outdoor areas of the fourth map have to look like the player is in the middle of a dense forest.

Dungeon map RPG Complexity design guidelines

For the RPG setting „Off“, the hub (or single map) should allow the player to quickly reach the exit/end boss/important area.

On the setting „Standard“, there should be a few obstacles that force the player to explore more of the map/hub before.

On the setting „Old School“, map flow should be designed in a way that the player is forced to explore all areas and kill most monsters to collect the keys or other items to unlock doors.

Example:

The map has a starting room from which three corridors lead to other areas of the map. Two of them lead to large further parts with many rooms and monsters. In these areas, three different keys are placed, one of them easily attainable, the rest between cascading closed doors around the map.

The third corridor leads to the final area of the map. On the setting „Off“, this corridor is passable from the start. On the setting „Standard“, there is a closed door in the middle, requiring the easy to attain key. On the setting „Old School“, there is a different closed door in that corridor, requiring the fourth key that can only be attained by first getting the other three keys and unlocking doors.

Non-combat map design guidelines

Leave enough space in all areas where there will be a lot of NPCs, otherwise the player will have great difficulties getting through.

Since there are no monsters, there is no need for closed doors. As polyobject doors don’t work well together with 3D architecture, it’s best to forfeit animated doors in non-combat maps. Just create sectors for open doors at different angles.

Use visual tricks to make the settlements look much bigger than the actual accessible part.

Texture (and flat) naming guidelines

4 letters describe the type of texture, two digits give it a serial number, one letter designates a subvariation of the texture and one character is saved for special cases. Except for the 8th character, all other characters are obligatory.

Examples:

  • CITY02A is the 2nd city texture’s first (basic) variation.
  • CHUR03D is the 3rd church texture’s 4th variation.

For an example how this works: CITY13A is the basic wall texture using the big green stones. CITY13B is the same texture with a window on it. CITY13C is the same texture with a door on it.

As a general rule, wall textures are using the serial numbers 01-70 and floors start at 71 (going up to 99), e.g. CITY13A would be a wall texture, CITY73A would be a floor. An exception is made for textures clearly meant as floor covering (e.g. ROAD*): here the numbering starts at 01.

Code

About the new script compiler

In the Korax Arena and Korax RPG TCs new action specials are introduced. All of them have identifier values greater than 255 to ensure none of them duplicate common ones from Vavoom. Unfortunately the original script compiler (ACC) stores action special as single byte, which does not allow to use those with identifier >255. We solved this problem by modifying ACC. New ACC stores action special in two bytes instead, so action specials can have identifier values up to 65535.

If you are not going to use new action specials in your map(s) you may still use original ACC, otherwise you’ll have to get new ACC. Currently it is included in the Korax Arena Editing package (available for download from our SourceForge account).

Source Code Compilation Process

Prerequisites for Compiling the Source Code

Before compiling the Source Code pack, you need to obtain the following:

TortoiseSVN

You can get it from http://tortoisesvn.net/downloads.

Download and install TortoiseSVN.

When you finish installing TortoiseSVN, please restart your computer.

Latest Vavoom SVN Revision Binary

It can be found on DRD Team’s site http://svn.drdteam.org/vavoom/.

Download the “LATEST” revision from there and write down where you have downloaded it, we’ll unzip it later in the process.

Obtaining the Source Code

You can get the file from https://sourceforge.net/projects/korax/files/ (koraxrpg_src.zip).

Once you have downloaded the file, you can Unzip inside a folder in your HD.

Compilation Process

Now, you will need to download most of the resource files from our SVN repository using TortoiseSVN, to do this you will have to left click on the ”’koraxrpg”’ folder inside the ”’code”’ folder and from the contextual menu choose the ””’SVN Update””’ option, this will display a window where you will see all the missing files being downloaded, once that’s finished, go inside the ”’progs”’ directory and run the ”’compile.bat”’ file, it might take a while to build everything, but once that finishes, you will find everything correctly compiled inside the ”’bin”’ folder of the distribution.

Finally, just unzip the Vavoom SVN revision binaries to the ”’bin”’ folder of the source code distribution pack.

And this covers the compilation process of the source code distribution pack.

Committing changes to the SVN Repository

This information is more related to the developers of the project, if you make any changes to the source files, the overlays on the folders will change from green color to red color (on the modified files), to submit these modified files, you must have a SourceForge.net account and be listed as a developer of the project in the project’s page in SourceForge.net, if you don’t have any of these and you really need them, ask Ramborc or Firebrand for help.

If you have an account in SourceForge.net, you might right click on the ”’koraxrpg”’ folder inside the ”’code”’ folder of the source distribution pack, and then select the ”’SVN Commit…”’ option on the contextual menu from TortoiseSVN, it will then ask for your username and passwords, use the same username and password from SourceForge.net and it should work fine.

Compiling for and running on Linux

According to Borsuk:

It’s enough to download the binary windows package, and copy the “koraxrpg” folder into vavoom folder (on Debian Squeeze default vavoom folder is /usr/local/share/vavoom, assuming you performed “make install” after compilation). Then run the game with

 vavoom -game koraxrpg -iwaddir /where/your/WAD/files/are

No need to add -opengl, it will default to it.

Appendix

Map List

Description of columns

  • Nr: map number, to be used in conjunction with “map”
  • Name: The name of the map as visible in the game
  • Entered from map(s): map(s) that lead to this map
  • Exits to map(s): map(s) to which this map has an exit to
  • Type: combat (dungeon) or noncombat (town) map
  • Travel map: whether the map is directly connected to the travel map
NrNameEntered from map(s)Exits to map(s)TypeTravel map
01Forest Clearing1818dungeonn
07Thystes Cathedral1111townn
08Thystes Academy1111townn
09Thystes Fortress1111townn
10Thystes Market Hall1111townn
11Thystes7, 8, 9, 107, 8, 9, 10towny
12Joraltowny
13Rophesiscartowny
14Neusustowny
15Melaertowny
16Enegalutowny
17Tower of Ianabectowny
18Pham11towny
19Hegdo's Inntowny
20Hytesthani Inntowny
21Etemoryt Outposttowny
22Tower of Daedalon6868towny
23Vineltowny
24Leamaner's Chapeltowny
25Gaeth's Farmtowny
26Euthaltowny
27Ocadiatowny
28Vionatowny
29Rasctowny
30Isianer's Farmtowny
31Kreotowny
32Xyleg's Farmtowny
33Nolcormutowny
34Sichabronertowny
35Viarpile Monasterytowny
36Faliotowny
37Xymonthtowny
38Pemoerttowny
39Oresis Outposttowny
40Iarmusc7070towny
41Tower of Zetelar6767towny
42Kranusthenttowny
43Rerontowny
44Thorastowny
45The Border Posttowny
46Saiab's Inntowny
47Is'hine Oasistowny
48Ruins of Nisisil6161dungeony
49Pyramid of Kryludungeony
50Lernal Cavedungeony
51Usachioi Minedungeony
52Jodisec Minedungeony
53Aldir's Cavedungeony
54Dark Conclave5757dungeonn
55Yerdel Cavedungeony
56The Chasm5757dungeony
57The Canyon54, 5654, 56dungeony
59Donas Monumentdungeony
60Ruins of Thryas6981dungeony
61Nisisil Sanctum48, 6348, 63dungeonn
62Vermin Hovelsdungeony
63Nisisil Catacombs61, 6461. 64dungeonn
64Nisisil Cloister6363dungeonn
67The Excavation4141dungeonn
68Heresiarch's Seminary2222dungeonn
69Thryas Arena8160dungeonn
70Iarmusc Dungeons4040dungeonn
77The Reckoning54dungeonn
81Thryas Reservoir6069dungeonn
82Hedyntin Cave8383dungeonn
83Hedyntin Citadel8282dungeonn

Items

Description of columns

  • Name: what the item is called in the game
  • Thing ID: used by map editors to place the item
  • Type: item category
    • artifacts can be activated manually by the player
    • powerups activate their effect at pickup time
    • treasure is converted to money at pickup time
  • List price: the base price an item is sold for by merchants
    • merchants selling items by the dozen charge half this price
    • merchants selling items by the crate (25 pieces) charge a quarter of this price
    • merchants who buy excess player inventory offer half to a quarter of this price, depending on location
    • a few individual merchants might offer special deals for lower prices or might try to gouge you for a higher price
  • Inventory Limit: the maximum number of items you can carry at one time
  • Merchants: whether the item is sold by merchants
  • World: whether the item can be found lying around out in the world
  • Monsters: whether the item can drop from monsters you kill
  • Pecularities: differences vs original Hexen items
NameThing IDTypeList priceInventory LimitMerchantsWorldMonstersPecularities
Quartz Flask82artifact4100yynheals 25 hit points or 25% of the player's maximum health, whichever is larger
Mystic Urn32artifact1550yyyfully heals the player even if his maximum health is more than 100
Flechette8000artifact3200yyyworks for all classes as a grenade
Time Bomb8041artifact3200yyysimilar to the Heretic item
Disc of Repulsion10110artifact2200yyy
Krater of Might8003artifact2525yyy
Icon of the Defender84artifact10012yyy
Dark Servant86artifact4025yyn
Porkelator30artifact6020yyn
Chaos Device36artifact3025yyn
Banishment Device10040artifact3525yyn
Torch33artifact550yyyilluminates a small area around the player
Dragonskin Bracers-artifact5025yny
Boots of Stealth8002artifact2525yyyMakes the player less visible
Wings of Wrath15407powerup--nyngreatly reduces gravity in the vicinity for a short time
Pellonosian Crown15301money--nyyused to purchase items and services
Pellonosian Crown15302money--nynused to purchase items and services
Gold Bar15311treasure--nynconverts to 5 crowns on pickup
Gold Bars15312treasure--nynconverts to 10 crowns on pickup
Gold Bars15313treasure--nynconverts to 15 crowns on pickup
Gold Bars15314treasure--nynconverts to 15 crowns on pickup
Gold Bars15315treasure--nynconverts to 25 crowns on pickup
Gold Bars15316treasure--nynconverts to 35 crowns on pickup
Crate of Gold15317treasure--nynconverts to 50 crowns on pickup
Overflowing Crate of Gold15318treasure--nynconverts to 80 crowns on pickup
Scroll of Recall15400artifact850ynnteleports to the attuned mage tower
Potion of Charisma15401artifact40025yyypermanently increases Charisma by 1
Potion of Constitution15402artifact40025yyypermanently increases Constitution by 1
Potion of Dexterity15403artifact40025yyypermanently increases Dexterity by 1
Potion of Intelligence15404artifact40025yyypermanently increases Intelligence by 1
Potion of Strength15405artifact40025yyypermanently increases Strength by 1
Potion of Wisdom15406artifact40025yyypermanently increases Wisdom by 1
Apple15408artifact512yynreduces hunger by 5% and fatigue by 1%
Bread15409artifact812yynreduces hunger by 20%; increases fatigue by 4%
Treasure Key15700artifact-50nynopens a treasure chest

Spawn Numbers

These spawn numbers can be used in scripts or as Argument 1 for items like breakable pots and suits of armor. Note that numbers 1 through 108 are unchanged versus the original Hexen spawn numbers (the select entries below 109 displayed in this table are replicated from the ZDOOM wiki for a quicker reference).

Spawn NumberSpawned Actor
1Centaur
2Slaughtaur
3Green Chaos Serpent
4Ettin
5Afrit
6Stalker
7Stalker Leader
8Wraith
9Wraith (buried)
11Blue Mana
12Green Mana
13Boots of Stealth
17Banishment Device
18Chaos Device
19Dark Bishop
20Wendigo
23Health Vial
24Quartz Flask
25Mystic Urn
26Krater of Might
68Mesh Armor
69Falcon Shield
70Platinum Helm
71Amulet of Warding
72Flechette
73Torch
74Disc of Repulsion
75Red Mana
109Time Bomb
110Scroll of Recall
111Potion of Charisma
112Potion of Constitution
113Potion of Dexterity
114Potion of Intelligence
115Potion of Strength
116Potion of Wisdom
117Treasure Chest Key
118Wings of Wrath
119SpinningCoin
120RestingCoin
121GoldBarSingle
122GoldBarDouble
123GoldBarTriple
124GoldBarTripleDiagonal
125GoldBarQuintuple
126GoldBarSeptuple
127GoldCrateLidAskew
128GoldCrateLidOff
129Afrit Leader
130Afrit Martyr
131Flame Centaur
132Spectral Centaur
133Centaur Ghost-King
134Ettin Slinger
135Ettin Grenadier
136Ettin Commander
137Ettin Warlord
138Stone Ettin
139Magma Serpent
140Heresiarch
141Exarch
142Baby Heresiarch
143Ghost
144Dark Cardinal
145Dark Advisor
146Chilling Mist
147Toxic Mist
148Lava Dweller
149Specter
150Magma Stalker
151Moving Prop 1
152Moving Prop 2
153Moving Prop 3
154Moving Prop 4
155Moving Prop 5
156Moving Prop 6
157Moving Prop 7
158Moving Prop 8
159Moving Prop 9
160Moving Prop 10
161Moving Prop 11
162Moving Prop 12
163Moving Prop 13
164Moving Prop 14
165Moving Prop 15
166Moving Prop 16
167Moving Prop 17
168Moving Prop 18
169Moving Prop 19
170Moving Prop 20
171Brown Chaos Serpent
172Icon of the Defender

NPC Sprites

IDspritedescriptionanimated?author
101npc101shopkeepernoMago
102npc102acolytenoMago
103npc103merchantnoSylon
104npc104peasant womannoMago
106npc106blacksmithnoMago
109npc109barkeepnoMago
110npc110peasantnoMago
111npc111barmaidnoMago
112npc112townswoman, green dressnoMago
113npc113townswoman, brown dressnoMago
114npc114townswoman, white blousenoMago
115npc115innkeepernoSylon
116npc116old mageyesMago
117npc117bearded clericyesMago
118npc118barbarianyes?
119npc119peasant / townsmanyesRogue Entertainment
120npc120hooded magenoRaven Software
121clericclericyesRaven Software
122fighterfighteryesRaven Software
123npc120mageyesRaven Software
124k124a0bald tavernkeepernoFirebrand
125k125a0legionnairenoFirebrand
126k126a0golden guardnoFirebrand
127magecrimson magenoRaven Software