/usr/pkg/bin/pod2html: perllib/Trn.pm: unterminated list at =head in paragraph 214. ignoring. /usr/pkg/bin/pod2html: perllib/Trn.pm: unexpected =back directive in paragraph 216. ignoring. /usr/pkg/bin/pod2html: perllib/Trn.pm: unterminated list at =head in paragraph 220. ignoring. /usr/pkg/bin/pod2html: perllib/Trn.pm: unexpected =back directive in paragraph 222. ignoring. /usr/pkg/bin/pod2html: perllib/Trn.pm: unterminated list at =head in paragraph 226. ignoring. /usr/pkg/bin/pod2html: perllib/Trn.pm: unexpected =back directive in paragraph 228. ignoring. /usr/pkg/bin/pod2html: perllib/Trn.pm: unterminated list at =head in paragraph 232. ignoring. /usr/pkg/bin/pod2html: perllib/Trn.pm: unexpected =back directive in paragraph 234. ignoring. /usr/pkg/bin/pod2html: perllib/Trn.pm: unterminated list at =head in paragraph 238. ignoring. /usr/pkg/bin/pod2html: perllib/Trn.pm: unexpected =back directive in paragraph 240. ignoring. /usr/pkg/bin/pod2html: perllib/Trn.pm: unterminated list at =head in paragraph 244. ignoring. /usr/pkg/bin/pod2html: perllib/Trn.pm: unexpected =back directive in paragraph 246. ignoring. /usr/pkg/bin/pod2html: perllib/Trn.pm: unterminated list at =head in paragraph 250. ignoring. /usr/pkg/bin/pod2html: perllib/Trn.pm: unexpected =back directive in paragraph 252. ignoring. /usr/pkg/bin/pod2html: perllib/Trn.pm: unterminated list at =head in paragraph 256. ignoring. /usr/pkg/bin/pod2html: perllib/Trn.pm: unexpected =back directive in paragraph 258. ignoring. /usr/pkg/bin/pod2html: perllib/Trn.pm: unterminated list at =head in paragraph 262. ignoring. /usr/pkg/bin/pod2html: perllib/Trn.pm: unexpected =back directive in paragraph 264. ignoring. /usr/pkg/bin/pod2html: perllib/Trn.pm: unexpected =back directive in paragraph 265. ignoring. Trn - Perl Module to modify Trn datastructures in memory

NAME

Trn - Perl Module to modify Trn datastructures in memory


ABSTRACT

This module includes functions to read, and modify trn objects. The objects are represented as array of resources, each having resource type, size, and data.


DESCRIPTION

You first need either to greate new Trn with Trn::new or read trn structure from disk using TrnRead::read. Then you can modify the trn structure in memory with functions defined here (or simply reading values from hash table or assigning new values to them). When you are done you can write trn back to disk using TrnWrite::write.


Trn::new

Trn::new is used to bless any other hash to be Trn hash or just to return new empty Trn hash.

USAGE

\%trn = Trn->new(); \%trn = Trn->new(\%hash);


Trn::file_type

Trn::file_type is used either to set or get file type.

USAGE

$file_type = $trn->file_type(); $file_type = $trn->file_type($file_type);


Trn::version_major

Trn::version_major is used either to set or get file major version number. Currently this matches 2 (nwn2).

USAGE

$version_major = $trn->version_major(); $version_major = $trn->version_major($version_major);


Trn::version_minor

Trn::version_minor is used either to set or get file minor version number. Currently this matches 3 (1.03?).

USAGE

$version_minor = $trn->version_minor(); $version_minor = $trn->version_minor($version_minor);


Trn::resource_count

Trn::resource_count is used either to return or set the number of resources in the trn/trx file.

USAGE

$resource_count = $trn->resource_count(); $resource_count = $trn->resource_count($resource_count);


Trn::resource_type

Trn::resource_type is used either to return or set the resource type for given resource number. This can be 4 letter string, and is normally 'TRRH' (header), 'TRRN' (terrain), 'WATR' (water), or 'ASWM' (walkmesh).

USAGE

$resource_type = $trn->resource_type($index); $resource_type = $trn->resource_type($index, $resource_type);


Trn::resource_size

Trn::resource_size is used either to return or set the resource size for given resource index.

USAGE

$resource_size = $trn->resource_size($index); $resource_size = $trn->resource_size($index, $resource_size);


Trn::new_resource

Trn::new_resource is used to add new resource to the trn/trx file. Resource data and type must be given, and size can be given (normally it is take from the length of the resource_data. This returns the new index used to store the resource.

USAGE

$resource_index = $trn->new_resource($resource_data, $resource_type); $resource_index = $trn->new_resource($resource_data, $resource_type, $resource_size);


Trn::resource_data

Trn::resource_data is used either to return or set the resource data for given resource index. If resource data is set then the resource_size is also set.

USAGE

$resource_data = $trn->resource_data($index); $resource_data = $trn->resource_data($index, $resource_data);


SEE ALSO

trnunpack(1), TrnRead(3), and TrnWrite(3).


AUTHOR

Tero Kivinen <kivinen@iki.fi>.


HISTORY

Created to do walkmesh height setter.