Import an older AGS Game

Started by Ghostlady, Mon 24/07/2023 04:59:42

Previous topic - Next topic

Ghostlady

Hello, I created a game in 2006. Is there a way to import those files into the current AGS version? I'm thinking of doing a redo of this game.
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

Crimson Wizard

Are you speaking of a project source, or compiled game? Do you remember which version of AGS was it made with?

Project source may be imported.

Compiled game may be unpacked using a tool, and parts of it imported into the newly created project. If your game is made with AGS 2.70 or earlier, then there's a chance that room scripts will be intact, because they were saved into the compiled rooms for some reason. But the global script and script modules cannot be, because currently there's no known script decompiler.

Ghostlady

It is a compiled game created with AGS 2.70
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

Crimson Wizard

#3
Here's an archive containing some tools that we develop along the engine (they are not distributed along with AGS yet, but they are built on our build server):
https://www.dropbox.com/s/6wfl3foo3jb9iyu/agstools-360.zip?dl=0

Among them there's a program called "agsunpak.exe". It's run from command line (windows console) simply as "agsunpak path_to_compiled_game path_to_unpack_folder".

For example:
Code: ags
agsunpak myoldgame.exe myoldgame_files
will unpackage myoldgame.exe into the folder myoldgame_files (I think you have to create this folder yourself).

After you unpackaged your game, open the editor, choose to open an existing game, and select unpacked file called "ac2game.dta". AGS will start an "import old game" process.

If that does not work:
- Download AGS 2.72, and use it to open ac2game.dta instead.
- save the project in 2.72.
- open modern editor and try importing this project again.

You likely will have compilation errors because global script won't be recovered (as i mentioned), but other things may be more or less intact.


UPDATE

I experimented with some very old game myself, and found that there theoretically may be an error in the 2.72 AGS Editor when you open the game for the first time, because it cannot arrange all the sprites in the "Main folder" in sprite manager.
The error message looks like:
QuoteSome orphaned sprites were found, but the Main folder doesn't have free space to recover them all. Remove some sprites from your Main folder, then try again.
I don't know what's the deal with that, and whether that will be a problem with your game.

But if you have this, to solve this problem do the following:
- Open the Sprite manager
- Create a number of subfolders
- Move all the sprites from the main folder into the first subfolder. (drag to select sprites, drag to move them to any subfolder)
- Save and close the editor.
- Open project again.

Repeat this process until it stops complaining.

Ghostlady

I still have the original folder with everything in it including the compiled folder. The ac2game.dta file is available.  The new AGS recognized this game and pulled it up in the list to "Continue an Existing Game" and "Continue a Recently Edited Game".  Continue an existing game will put me into the new AGS folder (do I need to copy all the files to there?) and the other will ask for an import but I am getting errors that it doesn't have access.  I don't know how to add an image with the errors.
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

Crimson Wizard

Quote from: Ghostlady on Tue 25/07/2023 21:27:08I still have the original folder with everything in it including the compiled folder. The ac2game.dta file is available.

Alright, so you do have the project source, so unpacking the compiled game is not necessary.

Quote from: Ghostlady on Tue 25/07/2023 21:27:08The new AGS recognized this game and pulled it up in the list to "Continue an Existing Game" and "Continue a Recently Edited Game".  Continue an existing game will put me into the new AGS folder (do I need to copy all the files to there?) and the other will ask for an import but I am getting errors that it doesn't have access.  I don't know how to add an image with the errors.

I'm sorry, I could not really understand what did you do. What do you mean by "Continue an existing game will put me into the new AGS folder", is it AGS program files? If so, then no of course you should not put any files there by hand...

If you're getting access errors, then likely your project is located in a directory where you do not have a write permissions. Prior to AGS 3 the old editors would store the game projects inside their own program folder by default, but this is not the case now. You should normally store your projects in "User Documents", or anywhere else on disk where you have write access (can create folders and files).

Khris

#6
First, make sure you have properly unpacked downloaded AGS Editor files. I for instance use D:\AGS\AGS_XXX for each editor version. This way I will never get any issues with disk access or read only errors or the like.

Next you should definitely make a backup copy of the main game source folder. Simply copy the folder, then paste it into the AGS 2.72 folder.

Next, open AGS 2.72, select "Load an existing game", then open the game folder and select the ac2game.dta file.
The game should open. Save and exit.

Now move the folder into a modern version's folder, like AGS 3.2.1 and try to open it there (same basic process, "open existing game", select the main game file)
And so on.

Ghostlady

I can open the game with AGS 2.70 but when I try to save I get a write error. I never used to get this but have changed OS a couple of times since the game was created.  How do I get past this?  I think the import will work if I get past this also.
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

Ghostlady

My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

Crimson Wizard

#9
Quote from: Ghostlady on Tue 25/07/2023 22:50:41I can open the game with AGS 2.70 but when I try to save I get a write error.

You mention AGS 2.70, but the error screenshot indicates it happens in AGS 3.*, and that it happens during not saving, but an import process.
Could you please clarify what are you doing?


In regards to error itself, do you have this project open in more than one program at the same time, maybe? (like - the old editor and the new editor)

If not, do you actually have an access to that folder? Like, what happens if you try to create a file there by hand?
What if you run the Editor "as administrator"? Or try to put the game files in some another place?

Ghostlady

Let's take 2.70 out of the picture.  I pulled the game into the new version of AGS.  It started as an import.  It failed due to access reasons as above.  I had to get out of the import without it finishing.  I've tried numerous times to run it again and I get the same error.  I did not have the project open in multiple places.  For curiosity sake, I tried creating a "new" game and it got created and saved with no problem to the exact same documents folder that the import is having problems with. 
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

Crimson Wizard

Please tell which version of AGS you are using now?

Also when importing, did you choose to "Backup files"?

Ghostlady

Version 3.6
Yes I did select backup files.
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

Crimson Wizard

I am not really certain about this case, but there are another 2 known reasons why AGS may not be accessing files:
* Anti-virus does not like AGS for some reason, and is blocking its attempts to write or move files;
* Windows explorer may sometimes block the changes to compiled files, if you have the folder opened while AGS is working. But this usually happens with Compiled folder only, during game compilation.

Besides that, I've been testing the old game import process in 3.6.0, and apparently 3.6.0 has some error where it cannot save the imported game properly. I may suggest trying to import into an older version first, like 3.5.1, or even 3.2.1 (the latter may be got from here), and then proceed with the 3.6.0.

I do recommend making manual copies of the old project of course, just in case, before doing any import or upgrade to a newer version.

Ghostlady

Ok I'll try that and let you know.  Thank you for all the help.
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

Ghostlady

I downloaded both of these versions of AGS and they do not recognize the game in AGS.  It should be finding Oakhaven.

My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

Ghostlady

Ok, I got it figured out.  When I went into the latest version, 3.6.0, I had to create a new game to get past the opening menu.  Once I was in the new game I went to file and then did an "open" which let me navigate to the folder where I have the old game and it pulled in in!
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

Crimson Wizard

#17
Quote from: Ghostlady on Wed 26/07/2023 22:02:58I downloaded both of these versions of AGS and they do not recognize the game in AGS.  It should be finding Oakhaven.

The Recent game list contains games that you have opened in this particular version or earlier versions. If you have opened a game in AGS 3.6.0, then it won't be mentioned, for example, in AGS 3.5.1 or 3.2.1.

If it is not there, then simply use "Continue an existing game" and point to where the game is. You do not have to create a new game for that.

Ghostlady

I did try that but it wouldn't let me past that menu screen. 
Maybe you can help me with some of this conversion stuff.

// room script file

// total number of objects (including object number 0 which isn't used)
#define _THE_NUMBER_OF_OBJECTS_YOU_HAVE_ 15

// called when the puzzle is solved:
function on_puzzle_solved() {
  SetGlobalInt(10,  GetGlobalInt(10) + 1);
  SetGlobalInt(30,  GetGlobalInt(30) + 1);
  PlaySound(18);
    gGui7.Visible = true;
    gGui7.Centre();
    string herscore;
    StrFormat(herscore,"Puzzles: %d",GetGlobalInt(10)); 
  ScoreHer.SetText(herscore);
  ScoreHer.TextColor = cWoman.SpeechColor;
  Wait(120);
    gGui7.Visible = false;
  GiveScore(1);
  gGui3.Visible = true;
  cWoman.ChangeRoom (3);
}

int button_pressed=0, ob=-1;
int correct = 0;

#sectionstart room_a  // DO NOT EDIT OR REMOVE THIS LINE
function room_a() {
  // script for Room: Repeatedly execute
  if (IsButtonDown(LEFT)) {
    if (button_pressed==0) {
      button_pressed = 1;
      ob = GetObjectAt(mouse.x, mouse.y);
     
      if (ob!=-1) {
          int width  = GetGameParameter(GP_SPRITEWIDTH, GetObjectGraphic(ob), 0, 0);
          int height = GetGameParameter(GP_SPRITEHEIGHT, GetObjectGraphic(ob), 0, 0);
         
          //MoveObjectDirect(ob, mouse.x-width/2, mouse.y+height/2, 7);
          //while (IsObjectMoving(ob)) Wait(1);
      }
    }
  } else {
    button_pressed=0;
    if (ob!=-1) {
      SetObjectBaseline(ob, 0);   
      ob=-1;
     
      int i = 1; correct = 1;
      while (i < _THE_NUMBER_OF_OBJECTS_YOU_HAVE_) {
        int width  = GetGameParameter(GP_SPRITEWIDTH, GetObjectGraphic(i), 0, 0);
        int height = GetGameParameter(GP_SPRITEHEIGHT, GetObjectGraphic(i), 0, 0);
        correct=correct*(GetHotspotAt(GetObjectX(i)+width/2, GetObjectY(i)-height/2)==i);
        //Display("object number %d (correct=%d)", i, correct); //debug
        i++;
      }
   
      if (correct == 1) {
        on_puzzle_solved(); //call an event function
      }
    }
  }

This doesn't work anymore, getting an error - room5.asc(50): Error (line 50): undefined symbol '_THE_NUMBER_OF_OBJECTS_YOU_HAVE_'
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

Crimson Wizard

#19
Quote from: Ghostlady on Thu 27/07/2023 01:35:50I did try that but it wouldn't let me past that menu screen. 

Why not, what had happened?

Quote from: Ghostlady on Thu 27/07/2023 01:35:50Maybe you can help me with some of this conversion stuff.

There's something weird about this, the macro name does not work in the contemporary versions of AGS if it starts with underscore.
Changing the name to "THE_NUMBER_OF_OBJECTS_YOU_HAVE" makes that work.

Ghostlady

Quote from: Crimson Wizard on Thu 27/07/2023 01:50:54
Quote from: Ghostlady on Thu 27/07/2023 01:35:50I did try that but it wouldn't let me past that menu screen. 

Why not, what had happened?
Nothing, I couldn't get past that menu window.  It just sat there not letting me move.

Quote from: Ghostlady on Thu 27/07/2023 01:35:50Maybe you can help me with some of this conversion stuff.

There's something weird about this, the macro name does not work in the contemporary versions of AGS if it starts with underscore.
Changing the name to "THE_NUMBER_OF_OBJECTS_YOU_HAVE" makes that work.

That worked.  :smiley:
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

Crimson Wizard

Quote from: Crimson Wizard on Thu 27/07/2023 01:50:54
Quote from: Ghostlady on Thu 27/07/2023 01:35:50I did try that but it wouldn't let me past that menu screen. 

Why not, what had happened?
Nothing, I couldn't get past that menu window.  It just sat there not letting me move.

Oh, you needed to click on Continue button after selecting that option.

Ghostlady

It kept highlighting one of the other games so when I hit continue it would open one of them.  That menu is what I couldn't get past so I created a new game to get past the menu.

Ok, The game is up and running. Yahoo.  There was tons of dialog I had to convert from SaySpecialCharacter to Character.Say.  So now what I am seeing is my dialog text is no longer in the dialog gui but splayed across the top of the screen.
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

Crimson Wizard

#23
Quote from: Ghostlady on Thu 27/07/2023 03:37:04It kept highlighting one of the other games so when I hit continue it would open one of them.  That menu is what I couldn't get past so I created a new game to get past the menu.

When you select "Continue an existing game" and press Continue, then the list of games is ignored, and a Browse files dialog is opened instead.
The list of games is only active when you select "Continue a recently edited game".


Quote from: Ghostlady on Thu 27/07/2023 03:37:04There was tons of dialog I had to convert from SaySpecialCharacter to Character.Say.  So now what I am seeing is my dialog text is no longer in the dialog gui but splayed across the top of the screen.

AGS never had a function called SaySpecialCharacter, that had to be a custom function from your global script or one of the script modules. Is it still there in the script or not at all? (Since you said that you  had an original game folder with everything in it, I supposed that global scripts should stay intact? maybe I misunderstood something.)

Character.Say works only in few standard styles; this style may be selected in General Settings (Dialogs -> Speech style), but neither of them displays speech on the gui dialog's label. This is something you should script yourself.

Ghostlady

I looked in the old files for global script and it is the same in the imported script.
Each character had their own Gui/Color Text function.

Global script:
#sectionstart SaySpecial2  // DO NOT EDIT OR REMOVE THIS LINE
function SaySpecial2(Character *thechar, string message) {
  slabel2.TextColor = thechar.SpeechColor;
  slabel2.SetText(message);
  thechar.SayAt(0, 0, 0, message); // say text but hidden (width 0), so voice speech plays
  slabel2.SetText("");
}

#sectionstart SaySpecial3  // DO NOT EDIT OR REMOVE THIS LINE
function SaySpecial3(Character *thechar, string message) {
  slabel3.TextColor = thechar.SpeechColor;
  slabel3.SetText(message);
  thechar.SayAt(0, 0, 0, message); // say text but hidden (width 0), so voice speech plays
  slabel3.SetText("");
}

Room script you would see this:
if ((stone == 0) && (convers == 0)) {
   gGui6.Visible = true;   
   SaySpecial2(cWoman, "What are these stones for Paulina?");
   gGui6.Visible = false;
   gGui13.Visible = true;
   SaySpecial4(cPaulina, "There is one missing.  If you can find it, I'll explain it all to you.");
   SetGlobalInt(350,  GetGlobalInt(350) + 1);
   gGui13.Visible = false;
   convers = 1; }

What has changed with the function or text?  If I remove the "SaySpecial#" from the lines in the room script, the game will compile but the text doesn't go into the text gui.  If I keep it in the game won't compile.
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

Crimson Wizard

Quote from: Ghostlady on Thu 27/07/2023 19:23:41What has changed with the function or text?  If I remove the "SaySpecial#" from the lines in the room script, the game will compile but the text doesn't go into the text gui.  If I keep it in the game won't compile.

So what errors are there during compilation? Fixing these errors would be the right way to go.

Ghostlady

Here's the error:
Failed to save room room2.crm; details below
room2.asc(147): Error (line 147): Type mismatch: cannot convert 'const string' to 'string'
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

Crimson Wizard

Quote from: Ghostlady on Thu 27/07/2023 20:48:49room2.asc(147): Error (line 147): Type mismatch: cannot convert 'const string' to 'string'

I think you may fix this by changing the function declaration to have "const string":
Code: ags
SaySpecialN (Character *thechar, string message)
to
Code: ags
SaySpecialN (Character *thechar, const string message)

This has to be changed in both function and its declaration in the script's header (if you have one).

Ghostlady

I changed this on the global script and the global header script and in a room for one character.  I now get this error on the
GlobalScript.asc(350): Error (line 350): Parameter type does not match prototype
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

Crimson Wizard

Quote from: Ghostlady on Thu 27/07/2023 21:03:32I changed this on the global script and the global header script and in a room for one character.  I now get this error on the
GlobalScript.asc(350): Error (line 350): Parameter type does not match prototype

This means that there's still this function's declaration somewhere, which was not changed, and now it does not match the function body.

Ghostlady

Ok I think that fixed it.  Thank you so much for your help!
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

Ghostlady

I have been playing and saving to find the errors from going from the old version to new.  Its been good with saves and loads until now.   
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

Crimson Wizard

Quote from: Ghostlady on Fri 28/07/2023 22:02:19I have been playing and saving to find the errors from going from the old version to new.  Its been good with saves and loads until now.

This means that your game has 1 custom script module now, while the save was made with game which has 0 script modules.

In AGS saves are broken by almost any addition of anything.

https://adventuregamestudio.github.io/ags-manual/GameSavesCompatibility.html

Ghostlady

Ah, I added a globel variable to replace a GetGraphicalVariable command.  Ok, good to know.  I started over and it was resolved.
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

Crimson Wizard

If you have a lengthy game, it's a common advice to create some kind of "teleport" function, which would setup a game state corresponding to the particular "chapter". This may make play testing easier, without relying on older saves.

Ghostlady

That's a good idea. I believe I've done that in the past. Trying to get back into the swing of AGS things, been away too long.
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

Ghostlady

#36
How do I get to my music and sound files within AGS?  It looks like the PlaySound command is not valid with this version.  It is playing a sound file but it seems quite low and hard to hear.
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

Crimson Wizard

Quote from: Ghostlady on Sun 30/07/2023 03:14:15How do I get to my music and sound files within AGS?  It looks like the PlaySound command is not valid with this version.  It is playing a sound file but it seems quite low and hard to hear.

Contemporary AGS supports running all the old commands, if they are enabled in Backwards Compatibility section of General Settings. The backwards support is also one of the official features of this engine, so if something does not work right, that might be considered an engine mistake, and planned for fixing.


But besides that, what is your goal? is it to keep as much of the old script as possible, or to convert your game to the new scripting style?

The new audio system is explained in the manual, these two topics may be useful:
https://adventuregamestudio.github.io/ags-manual/MusicAndSound.html
https://adventuregamestudio.github.io/ags-manual/AudioInScript.html

Ghostlady

#38
Ok I found them in the Explore Project under Audio.  I don't even know how I missed that.  The sounds seem lower in this newer version.  I can definitely hear a difference pulling the game up in both versions.  I'll do some tweeking to get the sounds louder.

My goal is to keep much of the old script as possible.  I am trying to make it more current with better playability.  For example, in the old version, if you hit Alt Tab to maneuver out of the game screen temporarily to hit a webpage for example, the game display becomes all garbled with bright pink lines running through it and you have to close it out.  With the new version it does not do that.  Alt Tab will take you out and put you back in with no problems.  Also, the display seems too stretched on the older version. There is one bug I want to fix and also add a "skip" option on most of the puzzles.  Currently there is no voice and am considering adding that too.
Overall, it's playing great from a version created 17 years ago without much coding effort on my part!!!

Many many thanks to everyone who kept working on this software!
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

Crimson Wizard

Hmm, I know that for old commands like PlaySound, there are two things that control the volume level:
- old function SetSoundVolume
- SetDigitalMasterVolume, which is now also set as System.Volume.

The resulting volume should be a multiple of these two factors (if seen as percentages).

Ghostlady

I'll check those out.  One other thing.  In the old version, if there is music playing, I can travel from room to room without it interrupted.  What it is doing now is restarting the music from the beginning each time I enter a room.  Its the same song.  How do I fix that?
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

Crimson Wizard

Quote from: Ghostlady on Sun 30/07/2023 21:10:32I'll check those out.  One other thing.  In the old version, if there is music playing, I can travel from room to room without it interrupted.  What it is doing now is restarting the music from the beginning each time I enter a room.  Its the same song.  How do I fix that?

Please tell how the music was commanded to play? Is it by script command, or using "play music on room load" setting?

In the last case, the Editor would convert this setting to a command in script, which will start a music anew every time you enter a room.
If that's the case, then you need to add a condition that checks if this music is already playing. With old commands that would be IsMusicPlaying() probably.

Ghostlady

It's in the Event where the player enters the screen before fade in:

#sectionstart room_b  // DO NOT EDIT OR REMOVE THIS LINE
function room_b() {
  aMusic3.Play();
  // script for Room: Player enters screen (before fadein)
mouse.DisableMode(eModeWalkto);

I'll try the  IsMusicPlaying()  command.
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

Crimson Wizard

#43
IsMusicPlaying may be a wrong check actually, because it does not let to test if particular music is playing.

If you are using imported audio clips, then there are few other methods, but the most straightforward is to save the current music channel, returned by the aMusicN.Play() command, in a global variable of type AudioChannel, and check that. In this case the code would be:
Code: ags
    if (musicChan == null || musicChan.PlayingClip != aMusic3)
        musicChan = aMusic3.Play();



There's another option, which I will mention just in case, where you write a custom function that scans all the channels and checks if particular clip is playing:
Code: ags
bool TestIfClipPlaying(AudioClip* clip)
{
    for (int i = 0; i < System.AudioChannelCount; i++)
    {
        AudioChannel* ch = System.AudioChannel[i];
        if (ch.IsPlaying && ch.PlayingClip == clip)
            return true;
    }
    return false;
}

If you put this function in a global script, you then may use it in every room like
Code: ags
    if (!TestIfClipPlaying(aMusic3))
        aMusic3.Play();



or even....
Code: ags
// Start the clip unless it's already playing, returns the audio channel which has it playing
AudioChannel *PlayIfNotPlaying(this AudioClip*)
{
    for (int i = 0; i < System.AudioChannelCount; i++)
    {
        AudioChannel* ch = System.AudioChannel[i];
        if (ch.IsPlaying && ch.PlayingClip == this)
            return ch;
    }
    return this.Play();
}

which may be used like
Code: ags
    aMusic3.PlayIfNotPlaying();

Ghostlady

PERFECT! I used the first suggestion and it's working as expected.
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

Ghostlady

Is there a way to globally turn up the volume whenever a sound is being played?
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

Crimson Wizard

#46
Quote from: Ghostlady on Sun 06/08/2023 01:45:30Is there a way to globally turn up the volume whenever a sound is being played?

Please clarify what do you mean by this? Do you mean changing the sound volume in game, or altering it for a particular sound temporarily while it plays and then lowering back down? or something else?

On a side note, as this no longer seem related to upgrading a game, I might suggest opening a new forum thread for the new technical questions.

Ghostlady

#47
I was thinking of changing the sound volume in game but if I can do a particular sound file and turn up the volume while it is playing in the room that will work.

I'll create a new post for any new questions not related to upgrading a game. 
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

Ghostlady

I've added some extra backgrounds into a room to allow some things to animate.  It doesn't seem to be working. It's marked in the properties that animate is active. Is there some code I need to add due to adding a new function to older code?
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

Khris

One thing that can cause the animation not to play is having SetBackgroundFrame() in your room script.

Ghostlady

I don't have that set in the room script. Actually it's a very small script with not too much going on.  That's why I was thinking it's an old game script vs current AGS version issue.

Here's the script:

// room script file

#sectionstart room_a  // DO NOT EDIT OR REMOVE THIS LINE
function room_a() {
  // script for Room: Repeatedly execute
if (Hotspot.GetAtScreenXY(mouse.x, mouse.y) == hLeft) {
      mouse.UseModeGraphic(eModeUsermode3); }

}
#sectionend room_a  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart hotspot1_a  // DO NOT EDIT OR REMOVE THIS LINE
function hotspot1_a() {
  // script for Hotspot 1: Interact hotspot
player.ChangeRoom(94); 
}
#sectionend hotspot1_a  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart room_b  // DO NOT EDIT OR REMOVE THIS LINE
function room_b() {
  // script for Room: Player enters screen (before fadein)
mouse.DisableMode(eModeWalkto);
PlaySound(32); 
}
#sectionend room_b  // DO NOT EDIT OR REMOVE THIS LINE
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

Crimson Wizard

#51
Quote from: Ghostlady on Thu 17/08/2023 19:29:10I don't have that set in the room script. Actually it's a very small script with not too much going on.

Do you have this in any of the global script perhaps? You may search for SetBackgroundFrame in the whole project using Find dialog in AGS.
What is the value of BackgroundAnimationDelay?

I don't think there's any other condition under which this won't run.

Ghostlady

#52
I couldn't find how to "Find dialog in AGS" but I searched the two global scripts and neither of them have SetBackgroundFrame.  The BackgroundAnimationDelay is set to 25.

I have another room that uses background animation, which is set to 25, and it came in with the old game and it works perfectly.
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

Crimson Wizard

The "Find" dialog is in Edit menu, which is only visible when any script is open.


Can you double check that the room has a second background? Do you see it in the list of backgrounds when you open  "Background" list in the room editor, and is it visibly different from the first one?

Could you perhaps upload your room file to let us check it out?

Ghostlady

I figured it out.  I forgot about the saving and you can't add anything new to the rooms and I was using a save.  Instead I teleported straight to the room and now it is animating.
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

Crimson Wizard

#55
Quote from: Ghostlady on Mon 21/08/2023 04:27:51I figured it out.  I forgot about the saving and you can't add anything new to the rooms and I was using a save.

This is strange. When you restore a save the room's backgrounds still should be in place since these are not written to a save but taken from the current room file. Room bgs animate by default, so unless there was a "fixed bg" parameter set at the time the save was done, I cannot explain why animation was not playing.

Ghostlady

These are the items done and the timeline:
1. Imported old game into latest AGS software
2. Had to make numerous coding changes to get a final run
3. Started playing the game and making new saves since I am updating numerous things
4. Decided I wanted to animate a particular room that was not animated previously
5. Updated that room with a total of 5 images where before there was only one
6. I used a save from item #3 since I was near the end of the game and didn't want to play it again to this point
7. Got to this room and it was not animating
8. Changed my first room to teleport me to the room I wanted animated (#5) and it immediately started animating
9. I did not have a fixed bg for this room or in the global script.
Hope this helps.
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

Crimson Wizard

#57
No, unfortunately, this is not what I experience if I try to test this.
I created a small dummy game in AGS 2.72, with 2 rooms, each having only 1 bg.
Imported this game to AGS 3.6.0. Started the game, went to room 2 and saved in there.
Quit, added more bg frames to the room 2. Started the game and loaded the save. Room 2 was animating.

Possibly there could be other factors, but I am not sure this is worth testing further, since the problem seem to have been solved.

Ghostlady

The only difference is that I probably overwrote a save and not created a new one.  But like you said probably not worth testing anymore.
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

SMF spam blocked by CleanTalk