Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Nixxon on Tue 09/03/2004 15:10:40

Title: Getchar, If, and all things nasty
Post by: Nixxon on Tue 09/03/2004 15:10:40
Howdy :)
I'm having trouble getting my EGO to speak after he reaches a certain location. I've tried a number of methods to no avail. Here's what seems to be the best possible sollution i could think of.

// script for room: Repeatedly execute
GetCharacterAt(220, 200);
if(GetCharacterAt(220, 200) == 1) {
DisplaySpeech (EGO, "Well lick my pouch and call me a peasant");
}  

But no cigar? And clues? Thankis :D  8)
Title: Re:Getchar, If, and all things nasty
Post by: SSH on Tue 09/03/2004 15:15:00
If you have pixel-perfect click detection on and 220,200 happens to be a transparent pixel, this may be why it isn't working. How about:

if ((player.x==220) && (player.y==200)) {
DisplaySpeech(EGO, "just procreating work female genitalia");
}

Title: Re:Getchar, If, and all things nasty
Post by: TerranRich on Tue 09/03/2004 15:18:55
And why did you put "GetCharacterAt" twice?
Title: Re:Getchar, If, and all things nasty
Post by: Nixxon on Tue 09/03/2004 15:23:57
Quote from: terranRICH on Tue 09/03/2004 15:18:55
And why did you put "GetCharacterAt" twice?
The "manual" implied I had to.

Thanks SHH, just pasted your code but alas -
 // script for room: Repeatedly execute
if ((player.x==220) && (player.y==200)) {
DisplaySpeech(EGO, "just procreating work female genitalia");
}

Runtime error: function still open, missing "}"

Odd since the "}" is there in tact  ??? :-\
Any ideas? Really appreciated :)

Title: Re:Getchar, If, and all things nasty
Post by: SSH on Tue 09/03/2004 15:36:14
Did you delete the functions's "}" as well? Edit the whole room script using "{}" button on room main page and then check that there a re TWO closing braces after the DisplaySpeech (assuming nothing else in room rep_ex...)

I just checked the manual's entry for GetCharacterAt and I can't see anything about putting it twice.
Title: Re:Getchar, If, and all things nasty
Post by: Nixxon on Tue 09/03/2004 15:44:22
Cheers SSH :)
It was not so boldly stated in the if/else statments page, I understand it's hard to imagine reading the manual through lamens eyes. It sometimes tends to leave you less knowledgeable than when you started reading it. Then again, maybe I have shit for brains? S'all good ;)