Some odd error message.[Solved]

Started by Icey, Thu 09/08/2012 02:55:48

Previous topic - Next topic

Icey

I don't know exactly were it came from in the game so I don't know how to fix it. :\

---------------------------
Adventure Game Studio
---------------------------
An internal error has occurred. Please note down the following information.
If the problem persists, post the details on the AGS Technical Forum.
(ACI version 3.21.1115)

Error: prepare_script: error -18 (no such function in script) trying to run 'room_Load'   (Room 1)

---------------------------
OK   
---------------------------

Crimson Wizard

Not completely sure, but possibly that's because you bound an non-existing function name with "On load" room event.

Check Room 1's events and see if there's a function room_Load in the list. Then open the Room 1's script and check if there's same function in there.

Khris

I'm certain this is due to deleting the function after linking and thus creating it.
If you want to remove a linked function from a script, either delete just the contents or make sure you also empty the text field next to the associated event.

Icey

No no, see I actually had that function there for a reason and I never deleted anything that had to do with it cause I usually use room_load in a lot of rooms. I thought that if I removed the line in the event list then re-add it, it would make it work but I was wrong. I tried putting the main character in room 2 and the problem happened again and the same goes for any other room. Could it be because of something in another script?

Khris

If you open room1.asc, is this line anywhere in there?
Code: ags
function room_Load() {


Because, according to the error you're getting, it's missing in your first room script.

And if it isn't there, what's removing "room_Load" from the event field and putting it back the same way supposed to do...?

Icey

#5
That line is there and it seem to me that the problem occurs in each room where that line is seen.

It seems when the room load thingy is not in the event field it works fine. but that will have to apply to every room where it is.

Khris

Capitalization is important.
Double check that the function name is in the field, exactly like it's spelled in the script:



For instance, when I change the name in the script to room_load, I get the exact same error as you.

Icey

Ok, I will check when I get home. It's funny cause I've been working on this game for a grip now and I have a lot of rooms with that function and it's almost like the game just switched up on me cause how is it possible that I changed the name the function in every room. Even new rooms I try to mak and use the function still messes up.

Icey

#8


This is how it looks but the problem still occurs.

I noticed (sorry if I already said this) that when removing the event line that after_load becomes the same.

Khris

I can't think of anything else that could cause this except:
1) the error message says Room 1, so this is the event pane and script of room 1, right?

I'm still sure this is a pebkac though.
If you can't find anything else that's wrong, I could take a look at the source files if you uploaded them.

Icey

Ok, thanks khris.
I'm going to try to look through the game a little more and if I can't fix the problem I'll upload it and PM you the files.

Khris

#11
Found it.
At compile time, AGS puts all the headers in front of each subsequent script. In Notes.asc and Notes.ash, you had put a /* right at the start but you never closed it. Thus, all scripts further below, including the entire GlobalScript and every room script, didn't contain anything but a single, unclosed comment block.

This also isn't the first time somebody did this, didn't you already do this once before?

Icey

Wow I can't believe it was because of the Notes, I would have never thought to look there. Thanks khris, I thought the game was done for.

Also, nah I never had this problem before that's why I wasn't that good at fixing it alone.

Icey

Wait somethings wrong again, I took out the notes scripts and then I got a problem for something that was already working in the global script. When I fixed it I got the same problem again.

Code: AGS
function Button25_OnClick(GUIControl *control, MouseButton button)
{ 
	Summon = "Ifrit";
	Display("Current Summon is now %s",Summon);
Label39.Text = String.Format("%s", Summon);
}

function Button24_OnClick(GUIControl *control, MouseButton button)
{
		Summon = "Ghost_Cat";
		Display("Current Summon is now %s",Summon);
Label39.Text = String.Format("%s", Summon);
}

function Button26_OnClick(GUIControl *control, MouseButton button)
{
		Summon = "Shiva";
		Display("Current Summon is now %s",Summon);
Label39.Text = String.Format("%s", Summon);
}

function Button27_OnClick(GUIControl *control, MouseButton button)
{
		Summon = "Zangard";
		Display("Current Summon is now %s",Summon);
Label39.Text = String.Format("%s", Summon);
}

Khris

You didn't say anything about the error or what you did...

But being a thorough guy, I tried compiling the game after fixing the notes script.
You forgot all the "="s after Label39.Text, yes.
When I put them back in, the game compiled, and I was able to play it just fine.

So do you mean you're getting the original " error -18 (no such function in script) trying to run 'room_Load' " again?

You didn't by any chance remove all the text in Notes.ash but keep the /* ...?

Icey

#15
Well I deleted the whole module and then was prompted that I didn't with another error cause I didn't include the "="s

But after fixing them, the same error came up again.


Nvm, I fixed it. I imported the module back into the game and took out the stuff in the Notes.ash. My theory on the whole thing is that possibly even when you delete a module, the .asc and .ach still stay in the game folder.

Khris

What same error...?
The -18 one?

Could you please read over your posts and make sure you're clear before posting them? It'll take really long otherwise.

Like I said, I opened your game, ended the comment blocks in the two Notes scripts with */, then added the missing equal signs. After that, I could play fine.

Icey

Yep that one, but it's ok you gave me the answer to my problems here.

QuoteYou didn't by any chance remove all the text in Notes.ash but keep the /* ...?

I got it fixed but I didn't know it was because I was missing the */. But then again I guess I wasn't paying attention cause I just noticed you said that it wasn't closed. But still, thanks a bunch dude.

Khris

At some point you must have fixed the /* issue because otherwise you wouldn't have gotten the error about the missing equal signs. Oh well.

Seriously, helping you with something like this is so tiring because it feels like only about 50% of what I write gets through, the rest gets lost somewhere between you not paying attention and not understanding code fully.
And when you write back, I can't simply read your answer and go from there, I have to decipher your post first. Missing words, bad grammar, wild jumps in mid-sentence.
It's really annoying.

I told you that the /* didn't turn just the Notes script but everything else into a big comment block. How do you manage to still screw up after I told you exactly what the problem is?
I'll tell you why, it's because you can't focus, and you're doing everything in a hurry.

And you're not only wasting your time but also the time of the people who are trying to help you.
Next time, chill down. Don't post back immediately, then again after that. You can edit your post. Try to understand what the problem is and fix it, don't go botching around because you might get lucky.
It's no wonder your games are buggy as hell.

Icey


SMF spam blocked by CleanTalk