Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Baily63 on Sun 18/03/2007 16:03:50

Title: Scripting error (DisplayMessage: Invalid number)
Post by: Baily63 on Sun 18/03/2007 16:03:50
     Hi! It's me, again. You're probrably going to see me around quite a bit.  :) It didn't take me that long to run into another problem. I made a NPC, and said that to interact or talk to her, a message would pop-up to resemble her talking. Like, I click on her and she says something. Anyways, when I test the game, it says

"An error has occured. Please contact the game author for support, as this is likely to be a scripting error and not a bug in AGS.
(ACI version 2.72.920)

in global script (line 44)

Error: DisplayMessage: Invalid number to dsplay."

I do have the message i want to display and it is set to say that message when i speak to her, but I havn't put anything into the scripting place. Please help, and I'm not too bright so please explain the easy way. I'm too stupid so I don't understand the manual. PLEASE HELP! :'( :'( :'(
Title: Re: Scripting error
Post by: Ashen on Sun 18/03/2007 16:10:06
What's line 44 of the Global Script? What exactly is the interaction for the NPC character?

Is it possible you're trying to display a Room Message (numbered < 500) from a Global interaction (which a Character interaction would be)? IIRR, that'd generate the error message you get, if you tried it in a room that didn't have a message of theat number.

EDIT:
Also, if you want it to display as speech, why not use Character.Say instead of DisplayMessage?
Title: Re: Scripting error (DisplayMessage: Invalid number)
Post by: Baily63 on Sun 18/03/2007 17:01:33
Where's that option?
I need to know!
Also, I made a game guide for my game, and whenever i open it, when i close it, i have o set it so that you apear in a certain room. Is there a way to make it so that I can apear in the room I opened the guide?
Title: Re: Scripting error (DisplayMessage: Invalid number)
Post by: Ashen on Sun 18/03/2007 17:09:31
Which option?
Character.Say and DisplayMessage are scripting commands, not Interaction Editor commands. I'm not sure if the Interaction Editor allows you to display Global Messages as character speech like you can with Room messages.

But you haven't answered my questions yet, so it's hard to give more detailed help:
Quote
What's line 44 of the Global Script? What exactly is the interaction for the NPC character?


How do you 'open the guide'? Is it an Inventory Item, a button on a GUI, what? Please BE SPECIFIC. The more details you give, the easier it is to get help. Characetrs can checnge room with the Character.ChangeRoom script command, or the 'Player - Go to a different room / (at specific coordinates)' Interaction Editor command. Where to put that, depends on how you access the guide.
Title: Re: Scripting error (DisplayMessage: Invalid number)
Post by: Baily63 on Sun 18/03/2007 17:26:55
I don't know what line 44 is, or any of ur question.  :-[ Do you know the script for the speech thing? And also the guide I just decided to show at the beginning and never show it again. (It was a hotspot before).
Title: Re: Scripting error (DisplayMessage: Invalid number)
Post by: Ashen on Sun 18/03/2007 17:38:32
QuoteI don't know what line 44 is
Well then, open the Global Script ('Script' menu -> 'Edit Global Script' or Ctrl-G) and check.

Quoteor any of your question.  :-[
You said:
Quote
I made a NPC, and said that to interact or talk to her, a message would pop-up to resemble her talking. Like, I click on her and she says something.

So, HOW have you done that? What interactions / scripting have you used?

Quote
Do you know the script for the speech thing?
I'm not sure what you mean. Look up Character.Say in the manual.
Title: Re: Scripting error (DisplayMessage: Invalid number)
Post by: Baily63 on Sun 18/03/2007 18:11:33
I havn't used any interactions except for display message when you talk to her, but as you answered before, it doesn't work. Ty for the advice though I'm going to search up the "say" thing.
Title: Re: Scripting error (DisplayMessage: Invalid number)
Post by: Khris on Mon 19/03/2007 01:21:57
Quote from: Baily63 on Sun 18/03/2007 17:01:33Also, I made a game guide for my game, and whenever i open it, when i close it, i have o set it so that you apear in a certain room. Is there a way to make it so that I can apear in the room I opened the guide?
From that I guess the game guide is a room itself.
Going back to the previous room is done like that:
  player.ChangeRoom(player.PreviousRoom);
Add a RunScript-action to the "Exit"-button of the guide, click the "Edit script"-button and put the command in the code window.
Title: Re: Scripting error (DisplayMessage: Invalid number)
Post by: Dualnames on Wed 21/03/2007 20:53:48
your problem is quite simple you've add a message to something but the message and that something are in different rooms. Use Display function it's better than messages.
Title: Re: Scripting error (DisplayMessage: Invalid number)(solved)
Post by: Baily63 on Thu 22/03/2007 00:20:42
kk ty all