
So I finally completed the new version of my combat resolution script. The portion that set the names of who and whoTarg have not changed. However, when I do a send chat reference these variables, they show up as object Object. When I log whoTarg I get "{"name":"Orc Warrior", ..ect... }" So I know it capturing the name. Here is the sendChat: sendChat(msg.who, '/emas '+ who +' attacks ' + whoTarg + ' and scores a hit!'); and the message in chat: " object t Object] attacks [object Object] and scores a hit!" I don't understand why it isn't working. var who = getObj('character', selectedToken.get('represents'));
if (!who)
{
who = selectedToken.get('name');
}
var whoTarg = getObj('character', targetToken.get('represents'));
if (!whoTarg)
{
whoTarg = targetToken.get('name');
}