Error: prepare_script: error -18 (no such function in script) (SOLVED)

Started by superwap, Mon 11/08/2008 05:52:37

Previous topic - Next topic

superwap

Hello partners. I´m Walter, from Argentina. Sorry but I understand a little english.
I have a problem. Next, I write the pc advice:

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

It appears when I run my game in the Editor mode or compiled...
For example: I Edit a room, then use Hotspots, go to Events, and write:
Interact hotspot: hPasto_Interact
Look at hotspot: hPasto_Look
...
Pick up hotspot: hPasto_PickUp

When the game´s running, I Pick up the hotspot "Pasto" and the machine say: "Es solo pasto!"
but when I Look at hotspot (eye´s icon), the game finished and appear the next message:

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

In the script appears this:

// room script file

function hPasto_Interact()
{
  Display("Es solo pasto!");
}

function hPasto_PickUp()
{
  Display("No quiero tocar eso");
}

But... to pick up the hotspot "pasto" the game say: "es solo pasto!" when I wish it say "No quiero tocar eso", and to look at the hotspot "pasto" the game say error.

Please, write me an e-mail to: superwap8@hotmail.com
Thank´s very very much!
Walter "Superwap". (an student in Argentina) :)
Excuse me for my bad english and the long post.

Gilbert

Most probably, a function was set to be called hHotspot1_Interact() in the editor but does not exist in the script (only hPasto_Interact() ). Check whether the names of the functions in the script match those in the editor. If you cannot find the problem you may try uploading the room file for us to check.

olafmoriarty

I think your problem is that you've tried to change function names manually (I don't even know if it's possible to make things work that way), but that AGS wants to run the functions by the names they would have had if you'd created them automatically.

I assume that most of your problems would be gone if you changed the name of the hotspot (listed somewhere under the properties) from "hHotspot1" to "hPasto".

Optionally, rename your script functions from "hPasto_Interact" to "hHotspot1_Interact" etcetera.

zabnat

Quote from: olafmoriarty on Mon 11/08/2008 13:10:58
I assume that most of your problems would be gone if you changed the name of the hotspot (listed somewhere under the properties) from "Hotspot1" to "Pasto".
Or better yet, change the name of the function assigned with event from events-tab to whatever the function was manually renamed.
So check the events-tab for your hotspot and check that the names of function assigned to different events are the same as the function names you have in your script.

superwap

Well... I thank you all. I change function names manually from "hPasto" to "hHotspot1" in every place ("events list" and "room script file"). Previously, I delete each name in events list and I started again with each corresponding name.
Now, the game is still on track.
Thank you everyone for your great help.
Greetings! and I am at your disposal
Superwap!

SMF spam blocked by CleanTalk