upgrade to 3.02.44

Started by spook1, Tue 16/09/2008 22:23:52

Previous topic - Next topic

spook1

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

Khris

My guess is you'll have to stick to 2.72 until the Creditz plugin is updated.

densming

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.

spook1

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:

Code: ags

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 :

Code: ags

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


But then again, i am afraid I will stumble over much much more errors..

Pumaman

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.

spook1

thanks. I turned those off, still same error though. ??

Pumaman

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.

spook1

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:
Code: ags

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

Code: ags

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


Pumaman

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?

spook1

I amm sorry, but the game open fine, showing creditz and all in 2.72..

I am puzzled, probably something trivial then...?

RickJ

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

SMF spam blocked by CleanTalk