New function does not work

Started by static, Thu 10/07/2003 11:09:23

Previous topic - Next topic

static

I am trying to make a collision function. It should check the x coordinates of both objects/characters and then return a value if it's true.
But the problem is that I cannot make a new function. I even tried to
make simple ones like just displaying messages but they just do not work.

in global script:

function dice();{
Display ("It's a nice dice");
}

when character interacts with tree

dice();

I get this message:
Error(line 23): undefined token 'dice'

HELP

Barcik

You have to add 'import dice();' in the script header.
Currently Working On: Monkey Island 1.5

Timosity

also with this line:

function dice();{

you need to leave out the semi colon ie ";"

so the line looks like this:

function dice(){




so it works in all the scripts, do what Barcik says

but if you create a function in the global script, you can call it from the global script without importing it in the script header.

same in a room script

Scorpiorus

...but don't forget this function word when importing.

Example:

global script:

function dice() {
 Display ("It's a nice dice");
}

script header:

import function dice();

-Cheers

Barcik

Currently Working On: Monkey Island 1.5

SMF spam blocked by CleanTalk