Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // --------------------------------------------------------------------------------
- // This script generates static placeables from placeables.2da.
- // --------------------------------------------------------------------------------
- //
- // #!/usr/bin/perl -w --
- // #
- //
- // use strict;
- //
- // use NWN::Gff;
- // use NWN::GffRead;
- // use NWN::GffWrite;
- //
- // while (defined(my $line = <>)) {
- // my ($app, $static, $name) = split(/\s+/, $line, 3);
- //
- // next if ($name =~ /\*\*\*\*/);
- // $name =~ s/"//g;
- // $name =~ s/\s*$//s;
- // $name =~ s/\s*\([A-Za-z0-9]+\)\*$//;
- // $name =~ s/\s*\*$//;
- //
- // my $res = sprintf("plc_static_%05d", $app);
- // my $utp = undef;
- //
- // if (-f "temp0/$res.utp") {
- // $utp = NWN::GffRead::read('filename' => "temp0/$res.utp");
- // } else {
- // $utp = NWN::GffRead::read('filename' => "temp0/plc_static_00001.utp");
- //
- // $utp->{'Tag'} = $res;
- // $utp->{'TemplateResRef'} = $res;
- // $utp->{'PaletteID'} = 4;
- // }
- //
- // if ($name =~ /VFX: Flame/) {
- // $utp->{'PaletteID'} = 231;
- // } elsif ($name =~ /Lightshaft/ || $name =~ /Shaft of Light/) {
- // $utp->{'PaletteID'} = 230;
- // } elsif ($name =~ /Portal [0-9]/) {
- // $utp->{'PaletteID'} = 232;
- // }
- //
- // $utp->{'Appearance'} = $app;
- // $utp->{'Static'} = ($static == 1);
- // $utp->{'LocName'} = { '0' => $name };
- //
- // NWN::GffWrite::write($utp, 'filename' => "temp0/$res.utp");
- // }
- //
- // --------------------------------------------------------------------------------
- //
- //
Advertisement
Add Comment
Please, Sign In to add comment