How to make npc?

Thothie

Administrator
Staff member
Administrator
Moderator
MSC Archivist
Joined
Apr 8, 2005
Messages
16,342
Reaction score
326
Location
lost
I think Lord K has given us permission to discuss such things... So, in the interest of content creation...



The MS_NPC syntax:

origin: Le classic xxx yyy zzz origin, ie. where it is

angles (0 0 0): Le classic pp yy rr angles, ie. which way it's facing

killtarget: Activate this on death

delayhigh (2): Maximum time before spawn check (respawn)

delaylow (1): Minimum time before spawn check (respawn)

lives (0): Number of times will spawn (0=infinite)

scriptfile*: Used to define which NPC, Monster, or item (see below)

spawnarea: ms_monsterspawn to use

spawnchance (100): Odds of spawning with each spawn check

target: Activate this on spawn (often an ms_npcscript)

targetname: Used to define NPC as target (often for scripts)



Example with commentary, Edrin, the Edana Guard:

Code:
{

"origin" "1408 192 -64" //origin

"angles" "0 270 0" //angle facing

"spawnchance" "100" //chance of appearing

"targetname" "edrin" //targetname for scripts, etc

"scriptfile" "edana/edrin" //script file to use

"delayhigh" "300" //max respawn time after death

"delaylow" "30" //min respawn time after death

"classname" "ms_npc"

}



Valid NPC scriptfiles:

Techincally, it seems you can summon just about anything using ms_npc - I think the name is primarily for convention, but here's a list that actually goes with the intended convention, some will not work:



EDANA:

v1.0 Sumdale : edana/tutorial

Bervold the Trapper : edana/trapper

Guard Mercenary : edana/rentaguard1

Guard Mercenary2 : edana/rentaguard2

Guard Mercenary3 : edana/rentaguard3

Deralia Guard Mercenary : mercenaries/merc1

Findlebind Goodheart : dq/findlebind

Old man : edana/oldman

Priest of Urdual : edana/priest

High Priest : edana/highpriest

Sembelbin : edana/masterp

Guard : edana/msqguard

Mayor's Guard : edana/mayorguard

Edrin, Captain of the Guard : edana/edrin

Bryan the grocer : edana/bryan

Hartold the Healer : edana/healer

Iron Fist Ike, the Armourer : edana/armourer

Foglund the Merchant : edana/packmerc

Krythos the travelling Merchant : edana/weaponsmith

Bertold the Fletcher : edana/fletcher

v1.2 Bertold the Fletcher : edana/Copy of fletcher

Sumdale : edana/sumdale

Urduaf : edana/urdauf

Waitress : edana/barwench

Erkold, the Mayor : edana/mayor

Merchant Square Keeper : edana/mergur

Commoner : NPCs/default_human



THORNLANDS:

Scared Rudolf : a3/rudolf

Holden, the Mercenary : a3/merc1

Olof Odlaren : a3/olof



HELENA:

v1.2 Dorfgan : helena/dorfgan_normal

Serrold : helena/serrold

Harry : helena/harry

Dorfgan : helena/dorfgan

Merchant : helena/genstore

Erkold : helena/erkold



MSCAVE:

Darrelin : mscave/darrelin-npc



SFOR:

Undamael Keyhole : sfor/keyhole_1



Some NPC's require one or more "ms_npcscript" entities to control their behavior. I'm not entirely sure how these work, unfortunately, as I don't have a list of scripts or what they do, I can only infer from what I've seen. Edrin's reaction to people walking in the flower garden, for example, is apparently two ms_npcscripts, one to run and bitch, and another to walk back to his guard post. The orcs in Helena, however, seem to react from a single script.



Edrin's ms_npcscript's:

Code:
{

"model" "*4"

"target" "edrinstrict1"

"wait" "15"

"classname" "trigger_multiple"

}

{

"origin" "1328 96 -112"

"angles" "0 260 0"

"targetname" "edrinstrict1"

"firewhendone" "edrinspot"

"eventname" "trig_flowercompliant"

"moveanim" "run"

"target" "edrin"

"firedelay" "4"

"type" "4"

"classname" "ms_npcscript"

}

{

"origin" "1408 224 -96"

"angles" "0 270 0"

"targetname" "edrinspot"

"moveanim" "walk"

"target" "edrin"

"classname" "ms_npcscript"

}



I've no list of these, so you'll have to experiment on your own and run about ripenting existing MS maps. If anyone does have a list of what these do, or a complete syntax for ms_npcscript, please post. Could be most useful for controlling monster/NPC behavior.

__________

"If you see in any given situation only what everyone else can see,

you can be said to be so much a representative of your culture that you are a victim of it."


Saint Thoth
 

ROOKIE

New Adventurer
Joined
May 29, 2005
Messages
18
Reaction score
0
Location
Hong Kong
sorry.......i can't get it.....

or can you give me a example *.rmf in the *.rmf have a npc)
 

Thothie

Administrator
Staff member
Administrator
Moderator
MSC Archivist
Joined
Apr 8, 2005
Messages
16,342
Reaction score
326
Location
lost
Delete the spawnarea property tag. Otherwise he'll appear he'll only appear in an msarea_monsterspawn with the targetname "bigopen23"



I dunno why the FGD has default spawnarea and targetnames for ms_npc - it just does. I would suggest editing it to remove this.



If you want him to only appear after an event is trigger, place him inside a brush linked to entity msarea_monsterspawn with the targetname "bigopen23" (or whatever you wish to name it), and the property spawnstart set to 1. Then the NPC will only appear if the event bigopen23 (or whatever you named it), is triggered.



msarea_monsterspawn



origin: The origin of the monster spawn, but can also be tied to a model

angles: Default direction NPC, Monster, or Items spawned will face

spawnstart (0): When enabled, MS entities assigned to this spawnarea begin spawning only if monsterspawn is targeted by another entity.

spawnloc (0): This bit is always confusing. Enabled it forces the creature to be spawned inside of the spawn area, ignoring the spawning entity's own local origin. I think. (Correct me if I'm wrong here)

targetname (bigopen23): Name of the monster spawn, can be anything

fireallperish: When all monsters in spawn are slain, trigger this entity. Can be used to spawn treasure, more monsters, open a locked door, etc. (see below)



Little warning on using Fireallperish, and this is an issue that appears in some maps made by the developers: if you use monsters with multiple lives to activate a monster spawn area that also contains monsters with multiple lives, very often an internal bug will cause the monster spawns to "jam up" and any subsequent Fireallperish events you have in mind may or may not fire. My advice is to use avoid using multi-life spawns that link to events via Fireallperish. Instead, use single life spawns that call on one another, or multiple point-entity spawns with multiple lives that link up via a multisource, triggerrelay or trigger_counter, and fire the intended event when all the point-entity monster spawns are drained and have called their fireallperish events.



Code Example:

Code:
{

"origin" "-572 -768 1216"

"fireallperish" "trollreward"

"targetname" "cavetrolls"

"classname" "msarea_monsterspawn"

}

__________

"As usual, more than you wanted to know."

Saint Thoth
 
Top