DICE PACKS BUNDLE
Page 44 of 46 First ... 344243444546 Last
  1. #431
    Quote Originally Posted by Arnagus View Post
    Well, cast is an existing trigger used by the Smiteworks/Syrinscape packages.
    When you do it all yourself (like I did with AudioOverseer), yes - chat is a good choice.
    But it is now implemented differently, therefore the suggestion.
    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.
    Free(Forums/Forge) Extension(FGU 5E):
    Paid (Forge) Extension(FGU 5E):

  2. #432
    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.

  3. #433
    So you need to click the cast button for the spell sound to trigger?

  4. #434
    Quote Originally Posted by Leprekorn View Post
    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.
    Last edited by Arnagus; July 30th, 2023 at 09:32. Reason: Removing double "http://" in link

  5. #435

  6. #436
    Quote Originally Posted by Arnagus View Post
    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.
    Actually I use VLC myself.
    Free(Forums/Forge) Extension(FGU 5E):
    Paid (Forge) Extension(FGU 5E):

  7. #437
    Quote Originally Posted by Arnagus View Post
    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.
    Am I able to change the triggers myself to chat instead?

  8. #438
    Quote Originally Posted by Leprekorn View Post
    Am I able to change the triggers myself to chat instead?
    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.
    Last edited by Arnagus; July 31st, 2023 at 21:09.

  9. #439
    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:
    1. make a backup of your purchased AE mod file!
    2. 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)
    3. place the client.xml into the folder where below script is located (I called it 'add_cast.pl')
    4. 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'
    5. 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)
    6. 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)
    7. rename 'new_client.xml' to 'client.xml' (careful, the original client.xml is still in the folder)
    8. 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!)
    1. make a backup of your campaign db.xml. Best create a copy of the whole folder.
    2. copy the campaign db.xml into the folder where below script is located
    3. run the script './add_cast.pl db.xml'
    4. if you want to see what was actually done, run 'diff -bwic db.xml new_db.xml'
    5. rename 'new_db.xml' to 'db.xml' (careful, the original db.xml is still in the folder)
    6. 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);
    Last edited by Arnagus; August 11th, 2023 at 13:39. Reason: Added additional AE module compatibility for db.xml, handles character updates in campaign db.xml.

  10. #440

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
STAR TREK 2d20

Log in

Log in