Import an older AGS Game

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

Previous topic - Next topic

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).

SMF spam blocked by CleanTalk