View Full Version : NPC Portrait

August 2nd, 2011, 10:00
I'm creating a new CoC module (A spanish version of Mask of Nyarlathotep) and i would like to add portraits to NPCs.

I'm draging images from the token (denizens images) and droping to the new NPC character sheet (over the Chaosium logo) but doesn't work... any ideas?



August 2nd, 2011, 10:09
unfortunately there is no way to add the portraits within the FG interface, they need to be linked directly in the xml db file.

I am not sitting at my FG computer so I can't remember the exact tags required, but if you open up the Denizens module and look at its database file you should be able to see how its done.

if you are going to do it edit the campaign db.xml file make a backup copy of it first!

August 2nd, 2011, 11:51
Just for the community knowledge:

<picture type='token'>denizens\[email protected] and Beasts</picture>

August 15th, 2011, 20:10
had a little time to look further into this.

I'm not sure why the original developer did this, but it seems they have deliberately disabled the ability to drop the pictures (in the form of tokens) directly onto the picture field.

if you look in the CoC ruleset folder you will see adventure_npcs.xml
if you open this file and go down to line 500 you will find the
reference to this picture

<tokenfield name="picture">

under this field you will find a script with the function ondrop
function onDrop()
return false;

as you can see its been set to false. Meaning it will not accept any drops.

if you want to enable it you can either just delete the entire 3 line function or you can change it from "return false;" to "return nil;" which will set off FG's default tokenfield handling, which will place the picture on the NPC sheet.

when you export the NPC to a module the picture will be exported with it.

August 16th, 2011, 12:57
It works!.

Thank you