Game Development Community

VMPlayer Problem

by CodingChris · in Torque Game Engine · 09/27/2007 (2:20 am) · 0 replies

Hi,
I've got a few problems with the VMPlayer resource. I made this to add something to the playlist:
function makemusic()
{
$musicplayer.AddSongToPlaylist("playlist1", $musicfile, $song, $artist);
$musicplayer.LoadPlaylist("playlist1");
$musicplayer.EnableRandom(true);
$musicplayer.Play();
canvas.popDialog(addtoplay);
}
and only get:
parse error
parse error

second problem:
I made this in common/main.cs
function initCommon()
{
   // All mods need the random seed set
   setRandomSeed();

   // Very basic functions used by everyone
   exec("./client/canvas.cs");
   exec("./client/audio.cs");
    exec("./vmplayer.cs");
	$musicplayer = new ScriptObject(VMPlayer);
	$musicplayer.OpenPlaylistsFromDisk("common/playlist.play");
$musicplayer.LoadPlaylist("playlist1");
$musicplayer.EnableRandom(true);
$musicplayer.Play();
	
}
...
function onExit()
{
   echo("Exporting client prefs");
   export("$pref::*", "./client/prefs.cs", False);
$musicplayer.SavePlaylistsToDisk("common/playlist.play");
   echo("Exporting server prefs");
   export("$Pref::Server::*", "./server/prefs.cs", False);
   BanList::Export("./server/banlist.cs");

   OpenALShutdown();
   Parent::onExit();
}
The playlist is created when shutdowning Torque, but when starting it I get this:
exec: invalid script file: common/playlist.play

Could anyone help me, please?