Files
swg-main-wiki/Adding_NPCs.md
2015-11-09 03:49:51 -05:00

4.3 KiB

Adding NPCs

Creature Definitions

Creatures are defined and identified by their names in datatables/mob/creatures.tab, with their associated scripts, conversations, and mobile templates, amongst other parameters listed in their row. Adding a creature that is missing entirely starts here, if the mobiletemplate and conversation scripts are already in existence, otherwise you have to create those first.

Static Spawns

Static spawns can be defined/created in several ways. Some are spawned purely using scripts, such as those found in the masterspawner.script files (). Otherwise, those that use spawn_tables, or poi_spawner tables, or any of the other datatables in datatables/spawning generally are used in conjunction with theme_park.dungeon.generic_spawner.

To add a static spawn, first make sure that the worldsnapshot tab you are editing has all of the cells for it's buildings (if any) properly defined. If not, open the worldsnapshot in treexplorer and manually enter each cell below it's parent container's line.

Once done, attach the theme_park.dungeon.generic_spawner script to the parent object, if spawning in a building, or to a spawn_egg or area_spawner object if spawning in the world (TODO: make sure that bit about world spawns is accurate).

Then, under the objvars column, add the following for the spawn table:

spawn_table|4|relpath/to/table.iff

Make sure that the end of line character is there with separators ( |$| )

Areaspawner

Areaspawners can be used outside/inside buildings in the buildout Files, for an outside spawn you need to an object

-objectid	0	object/tangible/ground_spawning/area_spawner.iff px	py	pz	qw	qx	qy	qz systems.spawning.spawner_area	fltMaxSpawnTime|2|1.000000|fltMinSpawnTime|2|0.000000|fltRadius|2|0.000000|intDefaultBehavior|0|1|intGoodLocationSpawner|0|0|intSpawnCount|0|1|intSpawnSystem|0|1|registerWithController|0|1|strName|4|area_spawnerName|strSpawnerType|4|area|strSpawns|4|creatureName|$|

to your .tab File. The Coordinates seem to be relative to Tile you are in. Or with Inside Spawns, relative to the Parentcells.

The Areaspawner name is pure cosmetic, the NPCs that can be spawned can be found directly in the creatures.tab Table.

In my Tests it seemed to make no difference if spawned in various ways, example:

strName|4|tatooine_knives_valarian|strSpawnerType|4|area|strSpawns|4|tatooine/lady_valarian
strName|4|lady_valarian|strSpawnerType|4|area|strSpawns|4|lady_valarian
strName|4|tatooine_knives_valarian|strSpawnerType|4|area|strSpawns|4|lady_valarian

All three spawned the same NPC.

Full Examples:

-1899966199	0	object/tangible/ground_spawning/area_spawner.iff	0	865.623	80	1833.21	0.283795	0	0.921845	0	systems.spawning.spawner_area	fltMaxSpawnTime|2|5.000000|fltMinSpawnTime|2|0.000000|fltRadius|2|0.000000|intDefaultBehavior|0|1|intGoodLocationSpawner|0|0|intSpawnCount|0|1|intSpawnSystem|0|1|registerWithController|0|1|strName|4|clone_relics_darth_vader|strSpawnerType|4|area|strSpawns|4|clone_relics_darth_vader|$|
-1899966200	0	object/tangible/ground_spawning/area_spawner.iff	0	865.623	80	1836.21	0.283795	0	0.921845	0	systems.spawning.spawner_area	fltMaxSpawnTime|2|6.000000|fltMinSpawnTime|2|0.000000|fltRadius|2|0.000000|intDefaultBehavior|0|1|intGoodLocationSpawner|0|0|intSpawnCount|0|1|intSpawnSystem|0|1|registerWithController|0|1|strName|4|clone_relics_han_solo|strSpawnerType|4|area|strSpawns|4|clone_relics_han_solo|$|
-1899966201	0	object/tangible/ground_spawning/area_spawner.iff	0	865.623	80	1842.21	0.283795	0	0.921845	0	systems.spawning.spawner_area	fltMaxSpawnTime|2|7.000000|fltMinSpawnTime|2|0.000000|fltRadius|2|0.000000|intDefaultBehavior|0|1|intGoodLocationSpawner|0|0|intSpawnCount|0|1|intSpawnSystem|0|1|registerWithController|0|1|strName|4|luke_skywalker|strSpawnerType|4|area|strSpawns|4|luke_skywalker|$|
-1899966202	0	object/tangible/ground_spawning/area_spawner.iff	0	865.623	80	1845.21	0.283795	0	0.921845	0	systems.spawning.spawner_area	fltMaxSpawnTime|2|8.000000|fltMinSpawnTime|2|0.000000|fltRadius|2|0.000000|intDefaultBehavior|0|1|intGoodLocationSpawner|0|0|intSpawnCount|0|1|intSpawnSystem|0|1|registerWithController|0|1|strName|4|rtp_leia_organa_summoned|strSpawnerType|4|area|strSpawns|4|rtp_leia_organa_summoned|$|

Dynamic World Spawns

TODO

Instance Spawns

TODO: may be spawned by the scripts?