As nobody knows when these modules will be updated again - I'd not wait to solve this. As you seem to have solved it for you I'd stick with that.
Printable View
That's why I suggested my solution as an improvement. No problem to fix for me - but something others might benefit from, if implemented. To my understandig, Aridhro is planning to update the packages anyway, so he might consider this idea as well.
So you need to click the cast button for the spell sound to trigger?
If you use the official Sound Packages from SmiteWorks - yes, this is what triggers the sound.
However - as SilentRuin suggest - you can code the triggers yourself. In this case, it is recommended to rather use the chat action which gives you better control over what to trigger when (e.g. attack, damage applied, effect applied). Check AudioOverseer forum entries for recommendations on self-coding using chat.
Thanks
Actually I use VLC myself.
You could purchase the sound packs, make a copy, recreate the triggers as chat, and export that module to use in any campaign.
However - the fact that all those triggers have been created is actually the value-add of the sound pack, so you could also create the triggers directly from scratch.
Since I still believe in the Cast button solution to trigger sounds, I have created a small perl script to update the AE modules. I obviously will not post any updated modules as they are sold and under copyright.
The script was tested with Eberron, Fizban, PHB, Sword Coast, Tasha, Volo and Xanathar (the ones containing automated spells).
Update (1): now also works with Strahd (use db.xml from the module)
Update (2): updates spells added from AE modules in character sheets for existing campaigns (campaign db.xml). BEWARE: depending on extensions loaded, this might add unforeseen entries into the character sheets which the script will not handle well. Always do a backup before and test extensively afterwards. Don't blame me if your players complain.
PREREQUISITE:
- any perl environment (Cygwin, Linux, not tested on Windows - but I don't see a reason why it should not work there)
- XML::LibXML package installed
USAGE FOR MODULES:
- make a backup of your purchased AE mod file!
- open the AE mod file with a Zip tool and extract client.xml (e.g. on Windows, right click and "open with..." as .mod is not a Zip tool associated file name extension)
- place the client.xml into the folder where below script is located (I called it 'add_cast.pl')
- run the script './add_cast.pl' - it should pick up the right file name (client.xml). If later on you need to manipulate another file (e.g. db.xml), run './add_cast.pl db.xml'
- there will be a lot of debug output - I did not remove it to see what is actually done. A new file 'new_client.xml' was created (or 'new_db.xml' if you provided this file name)
- if you want to see what was actually done, run 'diff -bwic client.xml new_client.xml' (on Linux, or Cygwin). You will notice a few unrelated replacements in XML (<dice></dice> -> <dice />, some & #00; -> & tagname; stuff) which has no impact (as far as I have seen)
- rename 'new_client.xml' to 'client.xml' (careful, the original client.xml is still in the folder)
- place the 'client.xml' back in the AE mod file via Zip. Modern Zip tools will have an UI like a Windows Explorer and update the archive when "dropped" into. Every tool is different here, you will need to figure out.
If you now pull a spell from the AE modules within Fantasy Grounds to a character, it will have a 'Cast' action as the very first action (unless there already was a Cast action, in this case, no change was done on the spell).
USAGE FOR CAMPAIGN DB.XML (Attention: high risk!)
- make a backup of your campaign db.xml. Best create a copy of the whole folder.
- copy the campaign db.xml into the folder where below script is located
- run the script './add_cast.pl db.xml'
- if you want to see what was actually done, run 'diff -bwic db.xml new_db.xml'
- rename 'new_db.xml' to 'db.xml' (careful, the original db.xml is still in the folder)
- place the 'db.xml' back in the campaign folder
Characters should now have a 'Cast' action on their spells unless it was already present.
This script is provided under Creative Commons Zero v1.0 Universal permissions. Copy, modify, distribute and use as you like.
Code:#!/usr/bin/perl -w
use strict;
use XML::LibXML;
my $indenting = 0; # the additional "Cast" action is added as single line (default: 0). This does not look nice in the module XML. If you prefer a proper indenting, change the value to 1. Beware: indenting is hard coded in perl to 2 white spaces, and it will redo ALL indenting. No way to change that - sorry!
my $xpath = q!/root/reference/spelldata/category[contains(@name,'Spell')]/*!; # usually client.xml (in modules)
my $xaltpath = q!/root/spell/category[contains(@name,'Spell')]/*!; # usually db.xml (in modules)
my $xcharpath = q!/root/charsheet/*/powers/*[.//group/text()='Spells']!; # usually db.xml (characters)
my $filename = shift || 'client.xml'; # if needed, provide db.xml as argument on command line (or any other file name)
open my $fh, '<', $filename;
binmode $fh; # drop all PerlIO layers possibly created by a use open pragma
my $dom = XML::LibXML->load_xml(IO => $fh);
my @spelldata = $dom->findnodes( $xpath );
@spelldata = $dom->findnodes( $xaltpath ) unless(@spelldata);
@spelldata = $dom->findnodes( $xcharpath ) unless(@spelldata);
foreach my $spell ( @spelldata ) {
print 'Name: '. $spell->findvalue('./name') ."\n";
my @actiondata = $spell->findnodes( './actions/*' );
my $cast = 0;
my $id = 0;
foreach my $action (@actiondata) {
my $type = $action->findvalue('./type');
my $order = $action->findvalue('./order');
next unless($type && $order);
my ($name) = ($action->nodeName() =~ /-(\d+)$/);
$cast++ if($type eq "cast");
if($name) {
$id = $name if($id < $name);
} else {
$name = $action->nodeName();
}
print $name ." Action(". $order ."): ". $type ."\n";
}
$id = sprintf("id-%05d", ++$id);
unless ($cast) {
print "Creating \'cast\' as ". $id ."\n";
my ($actionlist) = $spell->findnodes( './actions' );
my $newid = $dom->createElement( $id );
$actionlist->addChild($newid);
my $neworder = $dom->createElement( 'order' );
$neworder->{type} = 'number';
$neworder->appendText('0');
$newid->addChild($neworder);
my $newcast = $dom->createElement( 'type' );
$newcast->{type} = 'string';
$newcast->appendText('cast');
$newid->insertBefore($newcast, $neworder);
@actiondata = $spell->findnodes( './actions/*' );
foreach my $action (@actiondata) {
my $type = $action->findvalue('./type');
my ($orderelements) = $action->getChildrenByTagName('order');
next unless($type && $orderelements);
my $order = $orderelements->firstChild;
my ($name) = ($action->nodeName() =~ /-(\d+)$/);
$name = $action->nodeName() unless($name);
$order->setData(($order->nodeValue) +1);
print "-> ". $name ." Action(". $order ."): ". $type ."\n";
}
}
print "\n";
}
if($indenting) {
foreach ($dom->findnodes('//text()')) {
$_->parentNode->removeChild($_) unless /\S/;
}
}
open my $out, '>', 'new_'. $filename;
binmode $out; # as above
$dom->toFH($out, $indenting);
Nice I will have to try it out.