Scripting error (DisplayMessage: Invalid number)

Started by Baily63, Sun 18/03/2007 16:03:50

Previous topic - Next topic

Baily63

     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! :'( :'( :'(

Ashen

#1
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?
I know what you're thinking ... Don't think that.

Baily63

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?

Ashen

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.
I know what you're thinking ... Don't think that.

Baily63

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

Ashen

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.
I know what you're thinking ... Don't think that.

Baily63

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.

Khris

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

Dualnames

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.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)


SMF spam blocked by CleanTalk