Ok, first of all, I'm sorry that I'm cluttering the section with my stupid questions.
I can't seem to get a hold on how to use the arrays right. I have a programming background, but PHP doesn't seem to have taught me anything about strongly typed languages, and so I'm stuck.
Basically, I have a script module (which I decided to use as a data junk yard) and it has an array of strings which my character is supposed to speak when he looks at the chair.
The code is (MCData.asc):
Code: ags
With a header (MCData.ash):
Code: ags
Then, in the room script, I have this code:
Code: ags
And I get an error:
There's something I grasped wrong, it seems. Appreciate any help.
I can't seem to get a hold on how to use the arrays right. I have a programming background, but PHP doesn't seem to have taught me anything about strongly typed languages, and so I'm stuck.
Basically, I have a script module (which I decided to use as a data junk yard) and it has an array of strings which my character is supposed to speak when he looks at the chair.
The code is (MCData.asc):
string TalkInanimateArray[];
TalkInanimateArray[0] = "I don't usually talk to inanimate objects. 1";
TalkInanimateArray[1] = "I don't usually talk to inanimate objects. 2";
TalkInanimateArray[2] = "I don't usually talk to inanimate objects. 3";
function getTalkInanimate(int number) {
return TalkInanimateArray[number];
}
With a header (MCData.ash):
import function getTalkInanimate(int number);
Then, in the room script, I have this code:
function oChair_Talk()
{
int i;
i = Random(2);
cMainCharacter1.Say(getTalkInanimate(i));
}
And I get an error:
Quoteroom1.asc(18): Error (line 18): Type mismatch: cannot convert 'int' to 'const string'
There's something I grasped wrong, it seems. Appreciate any help.