BioWare Atari
Information de BioWare Jeux BioWare Assistance Forums Visit the BioWare Store
Neverwinter Nights Home
Neverwinter Nights Home
Sections: New Creatures & Placeables | New Tilesets | New Scripts

Go to (Previous  - 1. About, 2. Introduction, 3. Script: Set Name, 4. Script: Set Wing, 5. Commands - Next )



Georg's Scripting Extreme Close-Up I: Set Name

By Georg Zoeller

This article discusses new scripting commands introduced in the 1.67 Update and demonstrates one possible way of using these commands to add interesting new features to a module or persistent world.

This article assumes the reader is somewhat proficient with Neverwinter Script, but a demo module and downloadable .erf is provided for simple import and text.

SetName

This powerful, new scripting command allows the module builder to change the name of in game items, creatures and placeable objects, allowing for truly random content generation while adding personality to your NPCs.

Image 1 - Bag 'o Scripting Booty: Georg's Scripting Extreme Close-Up I: Set NameNote that the scripting command can not be used to change a player character's name.

This new scripting commands enables builders add a number of new things to their modules which could not done before patch 1.67, such as:
  • Personalized item names (such as Lilac's Mace +1).
  • Create named gravestones on a player's or creature's death.
  • Treasure Systems dropping custom monster treasure (Big Bad Demon's Whip).
  • NPCs starting off as "Generic Peasant" and changing their name to "Craig the Rancher" after the player talks to them.
  • Crafting Systems that adjust the name of items based on their properties.
  • Truly random quest content generation. ("Find Vulcano's Lute!")
  • Random creature names generated based on race, alignment, class or weapon specialization ("Tasha Swiftaxe").

New Game Functionality - The Built in Name Generator

With patch 1.67, the default OnSpawn script for the game (nw_c2_default9.nss) has been update to include an easy to use Random Name generator for creatures placed in the toolset.

The Variables Dialog can be found on the Advanced tab of the creature properties dialog in the toolsetBy setting the integer variable X2_NAME_RANDOM on any creature template in the toolset palette, a module builder can tell the game to generate a unique random name for any creature based off that creature template (Note: Already placed instances are not automatically updated with the variable).

The "Variables" Dialog can be found on the "Advanced" tab of the creature properties dialog in the toolset

Because we know that builders like to have the maximum level of control over content in their module, we also added functionality to allow a module creator to override the default name generator used by the game (RandomName()) with a custom, more sophisticated script of the builder's choice.

Creating A Custom Name Generator

To override the default name generator used at creature spawn when the aforementioned variable is set, a module builder can create a script named "x3_name_gen.nss" in the toolset, which will automatically be executed when a creature is spawned and tries to generate a random name.

An Example Custom Random Name Generation ScriptTo designate a return value for the script, containing the creature name that is supposed to be used, x3_name_gen.nss needs to set a local string "X3_S_RANDOM_NAME" on OBJECT_SELF (the creature just being spawned).

Download this example as .erf

Example Application: Updating NPC Names

Builders - In addition to the examples provided in the text above, the 1.67 demo module demonstrates some additional use for the function:

  • An example "Item Branding Device" item that imprints the name of the owner on an item when used.
  • A house the player can own complete with matching key and road sign.

Players - You can test this functionality by downloading the demo module. The store in this module features a "Signet Item" that can be used on any item (such as a weapon) to imprint your name onto it. (i.e. Torias' Axe +2)


 

 

BioWare Store
Neverwinter Nights 2 Forums
Cacher/Afficher

English
Deutsch
Français
Español
Italiano

Cacher/Afficher

Voir les dernières captures d'écran 

Voir les dernières captures d'écran
Cacher/Afficher

Multiplayer Games at Neverwinter Connections

Today
Schedule a Game...



Il est actuellement: (régler heure)
dim, 22 novembre 2009 01:45

Cacher/Afficher

Download Modules

Top NWN: HotU Modules:
1. Good vs Evil III
2. More...

Top NWN: SoU Modules:
1. Good vs Evil III
2. More...

Top CEP Modules:
1. The Lord of Terror The Diablo Campa...
2. More...

Top Modules - NWVault:
1. Hall of Fame
2. More...

Total Modules: 4423

Cacher/Afficher

5,049,352 utilisateurs sur le site de BioWare:
  58 connectés
  2 invisibles
  211 invités

1376 Playing Online
  100% NWN
  98% NWN: SoU
  99% NWN: HotU

447 Registered Guilds

8,768,526 messages dans les forums

Sujets les plus récents dans les forums:
1. Toolset work with Vista? (NWN2: Builders - NWN2 Toolset)

2. Vale of Merdelain (NWN2: Players - Storm of Zehir (Spoilers Warning))

3. Freezing at Specific character's... (Baldur's Gate II: SoA and ToB Technical Support)

4. Won't let me create new topic (Web Site Help)

5. BUILDERS - Showcase YOUR Talent! (NWN 1: Guilds and Registry - Ye Olde Tavern)