Best upgrade path from AGS 2.72

Started by simulacra, Tue 14/07/2020 21:55:20

Previous topic - Next topic

simulacra

Hi, first post in 10 years!

I am looking into doing a modernized remake of a full-length AGS game relased on CD-ROM in 2005. I have read the on-line manual for upgrading, but run into trouble when trying to import the old project.

There are problems, converted room scripts all start with binary garbage, like this:

Code: ags

zisý,s¥mï‚kwH>â,¬­Å'kïwtLÛQ*ò‚mhS7{mº‘ZAÆ'(mNBo¶‘+.p(%ý,Câ€"=Gc(J#`â€"o!TUT5,SfLï[QS$Ûe¼‹\Cxwsÿ6{sºhCAgf÷,zT'ï>7%R1~h·‘5~z%G=â,¬r·Å'mI(ZR3,hµ“^=Æ'wwXî{mg…hC‚xtSÛR¬‘L2mjM"~`µbCxwsÿö`QˆkLcQT--OQâ€"pLPLJ	,T'G4†ZtN;41pXÙÅ'AqbȠh=tviÿ6{sºhCAgfÿî;.gaHï]WYÿPH›=H!/ZJ,bDgqAb(Q(QQ*ÃœAqbȠh=‚|fQB,q¶Å'f.p(%ý,Câ€"=Gc(J#`â€"


Most converted scripts only consist of this.

Some scripts do get converted, but the converted code doesn't work. For instance, this:



gets converted into this (where hotspot2_a() and unhandled_event(1,3) are non-existing functions):

Code: ags

function hHotspot2_UseInv()
{
if (player.ActiveInventory == inventory[1]) {
hotspot2_a();
}
else {
 unhandled_event(1, 3);
}
}


The project was started in AGS 2.71 (I think) originally. Is there anything that can be done about this other than rewriting all scripts from scratch? Or did I miss something important along the way?

All input and help is appreciated!  :)

Details on the game: https://www.mobygames.com/game/windows/force-majeure-ii-the-zone

Crimson Wizard

Hello.

The garbage problem is a bug in AGS 3.5.0 which has been fixed in the recent patch. It's not yet posted properly on this website, but may be downloaded here as an installer:
https://github.com/adventuregamestudio/ags/releases/download/v.3.5.0.25/AGS-3.5.0.25-P3.exe
or zip file that you need to unpack into editor folder:
https://github.com/adventuregamestudio/ags/releases/download/v.3.5.0.25/AGS-3.5.0.25-P3.zip


If above does not work for some reason, you may try first upgrading to AGS 3.2.1, and then to latest version.

Not sure about the second issue, but it may be a consequence of the first one.

simulacra

Thank you! <3

No garbage in import this time!

The second problem persists, and I think I see what the problem is. There was a function called "unhandled_event" in GlobalScript, and the error was dropped because the converter couldn't know if this was a local room function or located in GlobalScript. I think the problem is that these functions are not imported correctly in the GlobalScript header.

Code: ags

 unhandled_event(1,3); //wrong
GlobalScript.unhandled_event(1,3) //correct


I am kind of curious about the space that drops before the incorrect line, perhaps the converter was looking for the function in GlobalScript but for some reason dropped a space when not finding it. Or doing that when not finding it locally?

Another issue is that rooms with interaction variables drop a lot of lines (100 to be precise) with:

Code: ags

int IntVar_ = 0;
int IntVar_ = 0;
int IntVar_ = 0;

{100 lines}


before the correctly defined interaction variables. These are easy to just delete, but of course causes precompilation to fail if not because the variable is already defined. Interestingly, there are exactly 50 lines of code in the converted script:

Code: ags

int IntVar_Global_1 = 0;
export IntVar_Global_1;

{x 25 = 50 lines of variable definitions and export statements}


I get some warnings from dialogue scripts:

Code: ags

narrator: The Zone wanderer freezes and looks straight through me.
narrator: There is brief silence. Nothing is heard. Nothing is said.
narrator: "If properly activated, this object has the power to deconstruct reality itself."
narrator: The voice is cold, almost mechanical.
//return - commented out to prevent error
@1  // option 1
narrator: "I am not. You are the one who must have been looking for such things."


Any good way to show dialogue before options are shown?

Crimson Wizard

#3
Sorry for delayed reply.

1) Regarding "unhandled_event", this is a standard callback function that you may add to GlobalScript.asc. I don't exactly know how older room scripts were supposed to work. But since room script now is calling this function from GlobalScript, there indeed should be an "import" declaration either in GlobalScript.ash (easy way) or every roomxxx.asc where it is called from:
Code: ags

import function unhandled_event (int what, int type);


2) IntVar_ issue looks like a bug in conversion. Maybe if you could send me an old room files, I could analyse them and fix it if it's not too complicated.

3) Regarding dialog, what exactly was the warning that you mentioned?
I think the script is missing a "@S" line to mark the starting point. You may create a new dummy Dialog to see how it should look like.

SMF spam blocked by CleanTalk