User Tools

Site Tools


en:modulebuilding:generaladvices

This is an old revision of the document!


General Building Advices

Resrefs and tags

Resrefs should start with two letters as a shortcut of its creator (so I am using “sh”), underscore character and whatever. This is important so we know who to blame later.

Tag and resref should match unless it is specifically needed for scripting.

Newly created blueprints and area gets default resref, to change it you need to make a copy of that blueprint/area.

There is no need to change tag of ordinary placeables you place into area unless you want to do something special with them via scripting. Unordinary placeables like treasures needs unique tag though.

Object Names

Never change a Door and Trap names, the name is visible to player if they attack it or get damaged by it. There is no reason to change area transition name either, although that is not visible to player at all.

Creature and item names should be upper cased (in English at least).

Base Area Settings

Every area needs to have following scripts set:

mod_area_enter in OnEnter event
mod_area_exit in OnExit event

Area tag should match resref. Exceptions are when you have multiple variants of same area, then they should share same tag so they count towards number of visited areas just once.

Area Transitions

  • make sure that waypoints to which area transition leads is not inside area transition trigger back. This is common building error
  • it is not needed to change tag of area transition triggers, don't do that
  • neither is needed to change tag of invisible doors if they are not linked from elsewhere (which for invisible door is not needed, read below)
  • doors should be linked with doors otherwise they won't open from the other side, unless you want exactly that behavior
  • if the doors are leading to subarea with no return back link them to waypoint or use invisible door

Area Variables

  • DUNGEON int 1 - set to 1 for areas that are part of a dungeon
  • DARKAREA int 1 - set to 1 if exterior area, but dark; such area won't penalty ligh-vulnerable races
  • UNDERDARK int 1 - marks the area as underdark (required for achievement)
  • X3_MOUNT_OK_EXCEPTION int 1 - will allow to ride horses in the area
  • NO_EXPLORATION int 1 - will not count the area towards number of areas visited (this is for system areas like Morgue or Realm of Souls)
  • QUEST string quest_tag - area with this variable will update player's quest status when players enter it
  • QUEST_CHECK int X - quest state number required for the quest to advance, will be 1 if not set
  • QUEST_SET int X - new quest state number, will be 2 if not set
  • SECRET_AREA int X - marks the area as “secret”, X is number of experiences gained for finding this area
  • DISABLE_HINTS int 1 - disables dungeon hints (like “you can use grapple in this area”)
  • TICHO int 1 - applies a silence to every player entering this area
  • KOUZLO_VSE int X - percentual chance of spell failure for all spells, typically 100 (other values are misleading imo)
  • KOUZLO_Y int X - percentual chance of spell failure applied to specific spell of ID Y (see NWN Wiki for vanilla spell ID values)

Area Terrain Setting

By default an area terrain is based on used tileset. For example tileset mines and caves will be treated as underground by default. But sometimes you want to change this or expand this, for example if the cave is flooded etc.

To do that, add a variable to the area:

  • TERRAIN string terrain_list - this is list of terrains separated by comma (if more than one terrain is required) that overrides the default terrain type that is based on used

Keywords for the terrains are:

  • AQUATIC
  • DESERT
  • FOREST
  • JUNGLE
  • MOUNTAINS
  • PLAINS
  • RUINS
  • SWAMP
  • UNDERGROUND
  • URBAN
  • ABYSSAL
  • CELESTIAL
  • COLD
  • ETHEREAL
  • SHADOW

So for example, if I want the area to be both of underground and aquatic terrain, I set variable:

  • TERRAIN string AQUATIC,UNDERGROUND

Creatures

Never use the creature wizard. If you want to make a creature, find a creature closes to what you want by strength or/and race and make a copy then adjust it. That will allow you to set its resref. Creature wizard and level up wizard too tends to give NPC starting gear for its class and tons of useless feats.

Since there is not an immunity to stun and since mind-spells immunity doesn't include stun anymore, if you want to make creature immune to stun you need to grant her feat Tough as Bone.

Pre-placed NPCs in areas (merchants and other friendly NPCs in towns) that aren't supposed to move and roam should have their scripts cleared out like this to preserve server resources:

Encounter Trigger Painting and Spawn Points Placement

Placeables

Container placeables (various boxes and chests from base palette) should be static, unless they are supposed to contain loot. If they exist solely for the purpose of decoration just make them static. And if they mustn't be static for some reason, then remove their scripts that they have, otherwise they will drop vanilla loot and we don't want that.

Placeables that are not supposed to respawn and that aren't static for a reasons (placeables with lights or animated ones mustn't be static for example) needs to be plot, so the first griefer doesn't destroy them.

If you use Community Patch, then all chair-type placeables from vanilla palette should have a script to sit on them. If not, or if you choosed non-vanilla placeable and you want to make it sit-able, then put script named x2_plc_used_sit into placeable's OnUsed event. The placeable must be useable of course.

Absolutely avoid using a tree canopy placeables. I absolutely hate them as a top-down player. They obstruct vision and do not tilefade. Which is a basic feature of NWN, but these placeables are missing it. This is not a roleplay server with focus on pretty areas with no other functionality but being beautiful. Also never place placeables into positions where they would block movement, unless you want to block movement on purpose (a blockade that needs to be destroyed).

Placeable Flickering Workaround

This happens when multiple flat-type placeables like carpets or some floor-overriding ones are placed over each other. To avoid this, you need to make sure their Z position (right-click Adjust Location) isn't same. Make the second placeable to be at +0.01 Z, third at +0.02 Z etc., that should fix this.

en/modulebuilding/generaladvices.1763065416.txt.gz · Last modified: 2025/11/13 20:23 by shadooow