NAME

Archive::SCS::GameDir - Find the game dir and mount its archives

SYNOPSIS

my $scs = Archive::SCS::GameDir->new->mounted;
# $scs isa Archive::SCS

my $path = Archive::SCS::GameDir->new(game => 'ATS')->path;
# $path isa Path:Tiny

my $gd = Archive::SCS::GameDir->new;
my @files = grep !/^dlc_/, $gd->archives;
my $scs = $gd->mounted( @files, 'dlc_ks.scs', 'dlc_ok.scs' );

# Custom paths
$gd->set_library_paths( @steam_library_paths );
my $path = $gd->find('ATS')->path;
my $scs = $gd->find('/path/to/gamedir')->mounted;

DESCRIPTION

Finds the game install directory inside your home directory.

A number of default locations for the Steam library will be searched first. If your Steam library is in a non-standard location, there are four different ways in which you can supply additional paths to search:

  • Specify the list of search paths for an individual GameDir object using the set_library_paths() object method. Call find() afterwards.

  • Manipulate the existing default list of search paths in the @Archive::SCS::GameDir::LIBRARY_PATHS global variable.

  • Install a custom Archive::SCS::GameDir::Steam module that sets the global variable @library_paths.

  • Set the STEAM_LIBRARY environment variable.

METHODS

archives

@files = $gamedir->archives;

find

$gamedir = $gamedir->find;
$gamedir = $gamedir->find('ATS');
$gamedir = $gamedir->find('/path/to/gamedir');

game

$full_name = $gamedir->game;

game_short

$abbreviation = $gamedir->game_short;

mounted

$scs = $gamedir->mounted;
$scs = $gamedir->mounted(@files);

new

$gamedir = Archive::SCS::GameDir->new;
$gamedir = Archive::SCS::GameDir->new(game => 'ATS');
$gamedir = Archive::SCS::GameDir->new(game => '/path/to/gamedir');

path

$path_tiny = $gamedir->path;

library_paths

@steam_paths = $gamedir->library_paths;

set_library_paths

$gamedir = $gamedir->set_library_paths(@steam_paths);

version

$installed_version = $gamedir->version;

AUTHOR

nautofon

COPYRIGHT

This software is copyright (c) 2024 by nautofon.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.