Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: spook1 on Tue 16/09/2008 22:23:52

Title: upgrade to 3.02.44
Post by: spook1 on Tue 16/09/2008 22:23:52
After a long time with other issues I decided to pick up my old game (v2.72).
I downloaded the latest AGS engine and stumble immediately over the first error:

room0.asc(36): Error (line 36): Type mismatch: cannot convert 'const string' to 'string'

it is referring to the following line, calling the agsCreditz.dll

addCreditLine("Werknaam SpaceSpy");

Will this be the first error in a long long que and should I refer back to v2.72, or can these issues be solved easily?
(my game contains 35 rooms already and many many sprites and views.

Thanks in advance for your interest in my issue,

Martijn
Title: Re: upgrade to 3.02.44
Post by: Khris on Tue 16/09/2008 23:19:56
My guess is you'll have to stick to 2.72 until the Creditz plugin is updated.
Title: Re: upgrade to 3.02.44
Post by: densming on Thu 18/09/2008 01:34:01
Don't know what your other errors are, but for this one, you could force a string instead of a const string, by doing this:

string TempString = "Werknaam SpaceSpy";
addCreditLine(TempString);


This may require a fair amount of tweaking to your game to recode in this manner, but otherwise I think you'll have to take KhrisMUC's advice and stick to 2.72.
Title: Re: upgrade to 3.02.44
Post by: spook1 on Thu 18/09/2008 08:34:54
Thanks for your advice.

I did not get any other errors, but I fugured onlyn the first one shows up.
Anyway, it is worth a try, maybe the only problem is in the creditz plugin.

My code now looks like:


string TempString;

function addCreditLine(string Text) {
  SetCredit(currentID,Text,colour,font,centered,xpos,generateoutline);
  currentID = currentID+1;
}

function addSpecialCreditLine(int image) {

currentID = currentID+1;

//SetCreditImage(int ID, int Slot, int center, int xpos, int pixtonext);
SetCreditImage(currentID,image,1,1,1);
}
function addCreditSpace() {
currentID= currentID + 1;
}

#sectionstart room_a  // DO NOT EDIT OR REMOVE THIS LINE
function room_a() {
  // script for room: First time player enters screen

SetEmptyLineHeight(20);
TempString ="Werknaam SpaceSpy";
addCreditLine(TempString);
addCreditSpace();
TempString = "Story: Timo, Bram, Bram, martijn en Vera";


and I get the error:

room0.asc(12): Error (line 12): type 'string' is no longer supported; use String instead

When I replace the decalration by String TempString, I get a similar error in line :


  SetCredit(currentID,Text,colour,font,centered,xpos,generateoutline);


But then again, i am afraid I will stumble over much much more errors..
Title: Re: upgrade to 3.02.44
Post by: Pumaman on Thu 18/09/2008 19:10:24
As you're using old-style scripting, make sure that "Enforce new strings" and "Enforce object-based scripting" are disabled in the game's General Settings.
Title: Re: upgrade to 3.02.44
Post by: spook1 on Thu 18/09/2008 20:35:28
thanks. I turned those off, still same error though. ??
Title: Re: upgrade to 3.02.44
Post by: Pumaman on Thu 18/09/2008 21:22:53
Those String-related changes happened in AGS 2.71, so if it worked in 2.72 it should also work in AGS 3.0. Scripting hasn't really changed in AGS 3.x.
Title: Re: upgrade to 3.02.44
Post by: spook1 on Fri 19/09/2008 08:55:51
Yes, I remember changing all string stuff a long time ago.
I was disappointed to learn that I had to redo all that.
I am happy now that that is not the case.

Still wondering what this error means then. The game worked fine in 2.72

The error reads:

room0.asc(35): Error (line 35): Type mismatch: cannot convert 'const string' to 'string'


for the script: (note the remark "// HERE IS THE ERRORR REPORTED")


string TempString;

function addCreditLine(string Text) {
  SetCredit(currentID,Text,colour,font,centered,xpos,generateoutline);
  currentID = currentID+1;
}

function addSpecialCreditLine(int image) {

currentID = currentID+1;

//SetCreditImage(int ID, int Slot, int center, int xpos, int pixtonext);
SetCreditImage(currentID,image,1,1,1);
}
function addCreditSpace() {
currentID= currentID + 1;
}

#sectionstart room_a  // DO NOT EDIT OR REMOVE THIS LINE
function room_a() {
  // script for room: First time player enters screen

SetEmptyLineHeight(20);
addCreditLine("Werknaam SpaceSpy"); // HERE IS THE ERRORR REPORTED

Title: Re: upgrade to 3.02.44
Post by: Pumaman on Fri 19/09/2008 18:37:31
It seems like the Creditz plugin is designed for a pre-2.71 version of AGS.

Is it definately the same agsCreditz DLL file as you were using with 2.72?
Title: Re: upgrade to 3.02.44
Post by: spook1 on Fri 19/09/2008 18:50:45
I amm sorry, but the game open fine, showing creditz and all in 2.72..

I am puzzled, probably something trivial then...?
Title: Re: upgrade to 3.02.44
Post by: RickJ on Sat 20/09/2008 00:32:47
Hi Martijn, long time no see ;).  Send me a download link and I'll take a look at it.  I've upgraded a ton-o-stuff so i should be able to help out easily. 

Cheers
Rick