-
Notifications
You must be signed in to change notification settings - Fork 3
Tutorial Creating a New Store
This tutorial adds a new store the player can buy from or sell to by creating a merchant (UTM), an NPC with dialog, a dialog file (DLG), and a script that opens the store. The NPC is placed on the Ebon Hawk.
Create a new merchant. Set Tag and ResRef to match the filename (e.g. aarn_store). Mark Up / Mark Down control pricing (e.g. Mark Down 50 = player sells at half base price). Use Edit Inventory to add items and right-click to toggle infinite stock. Save; filename must match ResRef/Tag.

Base the NPC on c_jawa (Core tab). Set Tag and ResRef to match the filename (e.g. aarn). Set the Conversation field to aarn (same as the DLG we will create). Give a name via the ellipsis -> None -> type aarn. Save.

Create a simple dialog: NPC says hello; options "Browse Aarn's wares" and "Leave". For the option that opens the store, set Script #1 ResRef to aarn_openstore. Save as aarn.

Create script aarn_openstore with:
void main()
{
object oStore = GetObjectByTag("aarn_store");
object oSpeaker = GetPCSpeaker();
if (GetIsObjectValid(oStore))
{
DelayCommand(0.5, OpenStore(oStore, oSpeaker));
}
}The tag in GetObjectByTag() must match the UTM Tag. Save and File -> Compile.

In the Modules tab select Ebon Hawk [ebo_m12aa.rim] (or the .mod if you use K1CP). Open the GIT m12aa under Module Data. Add a Creature and a Store in the central room; Edit Instance on each and set their resrefs to aarn and aarn_store. Save the GIT (it writes into the module).

Use a save from before escaping Taris (or warp ebo_m12aa with cheats). Talk to the NPC and choose to browse; the store should open.

- Tutorial: Creating custom robes -- Item creation and texture workflow
- Tutorial: Creating static cameras -- Camera placement in modules
- Tutorial: Area transitions -- Connecting areas with doors and triggers
- GFF-UTM -- Merchant (UTM) Format
- GFF-UTC -- Creature (UTC) Format
- GFF-DLG -- Dialogue (DLG) Format
- Mod Creation Best Practices -- Testing, merges, compatibility