Talk:Witcher 3 Global Functions

My perl code for dumping all the functions and classes from the game is below:

use strict; use warnings; use File::Find;

$/ = "\r\n";

my $filename = 'D:/functionDump.txt'; my $start_dir = "D:/Games/The Witcher 3 Wild Hunt/content/content0/scripts"; # top level dir to search

print "Dumping functions from $start_dir into $filename\n";

my @files; open(my $fh, '>', $filename) or die "Could not open file '$filename' $!"; find(sub { push @files, $File::Find::name unless -d; }, $start_dir);

my $skip_nl = 1;

for my $file (@files) {   open(my $cur_file, '<:encoding(UCS-2le)', $file) or die "Could not open file '$filename' $!"; print "Dumping functions from $file\n"; my $level = 0; my $is_class = 0; while(<$cur_file>) {		chomp; s/^\s+//; #remove leading whitespace s/\s+$//; #remove trailing whitespace if (/\bclass\b/ && !/.*".*\bclass\b.*".*/) {			$is_class = 1; if ($skip_nl == 0) {				print $fh "\n"; }			print $fh "$_\n"; $skip_nl = 0; }		#if (/\bstate\b/ && !/.*".*\bstate\b.*".*/) #{			#print $fh "\n$_\n"; #}		if (/\bfunction\b/ && !/.*".*\bfunction\b.*".*/) {			if ($level > 0 && $is_class == 0) {				#skip functions for things that aren't classes like states }			else {				if ($level > 0) {					print $fh "  "; }				else {					$skip_nl = 0; }				s/\{.*\}?.*$//; #remove trailing {} s/;\s*$//; #remove trailing ; s/\s+$//; #remove trailing whitespec print $fh "$_\n"; }		}		if (/{/) {			$level += 1; }		if (/}/) {			$level -= 1; if ($level == 0 && $is_class == 1) {				$skip_nl = 1; $is_class = 0; print $fh "\n"; }		}	}	close $cur_file; }

close $fh;