I'm trying to spawn an npc at a point in my world. I have the world in one blender file and the npc in a second. I've looked at crystalcore to see how that achieves the same thing but I'm having trouble getting the imported mesh orientated correctly.
A few pictures to illustrate the problem:-



and the code I'm using to set up the spawn point:
<!--
- This library contains an entity template for a spawn point that spawns npcs.
-->
<library>
<addon plugin="cel.addons.celentitytpl" entityname="npc-spawnpoint" >
<propclass name="pclogic.spawn">
<action name="AddEntityTemplateType">
<par name="chance" float="1.0" />
<par name="template" string="$template" />
<par name="entity" string="$entname" />
</action>
<action name="SetTiming">
<par name="repeat" bool="true" />
<par name="random" bool="true" />
<par name="mindelay" long="1000" />
<par name="maxdelay" long="1000" />
</action>
<action name="SetEnabled">
<par name="enabled" bool="true" />
</action>
<action name="AddSpawnPosition">
<par name="sector" string="$sector" />
<par name="position" string="$node" />
<par name="yrot" float="0.0" />
</action>
<property name="namecounter" bool="false" />
<property name="spawnunique" bool="true" />
<action name="Spawn" />
</propclass>
</addon>
</library>
<?xml version="1.0" encoding="UTF-8"?>
<library>
<library path="/models/npc_test" file="library" />
<addon plugin="cel.addons.celentitytpl" entityname="npc_test-tpl">
<propclass name="pcmesh" tag="model">
<action name="LoadMesh">
<par name="factoryname" string="body" />
</action>
<action name="MoveMesh">
<par name="sector" string="$sector" />
<par name="position" vector="$pos" />
</action>
</propclass>
<propclass name="pcobject.mesh.select" />
<behaviour layer="behaviourlayer" name="npc_behave" />
</addon>
</library>
Finally my entities file for my world:
<world>
<library file="/library/npc_spawnpoint.xml" />
<library file="npc_test.xml" path="/npc_test" />
<library file="viewControls.xml" path="/entities/viewControls" />
<addon plugin="cel.addons.celentity" template="npc-spawnpoint" entityname="npc1-spawnpoint" >
<params>
<par name="template" value="npc_test-tpl" />
<par name="entname" value="npc1" />
<par name="sector" value="Scene" />
<par name="node" value="npc_test" />
</params>
</addon>
</world>
I've tried rotating the empty node in blender but that makes no difference. I've seen the yrot parameter in AddSpawnPosition but for some reason my model is misaligned in more than one axis. I don't understand why my mesh is being rotated?
Nev7n.