Problems with error during the game

Posted By: Anonymous

Problems with error during the game - 06/12/02 20:04

I was wadering if anyoone could help me out get rid of this ugly mesage? It reads as follows:

The instruction at "0x00411a0d" referenced memory at "0x00004025". The meoory could not be read.

and heres how I coded the script to bring up a map of the maze.

FUNCTION updatekeys()
{
ON_T = mapon();
ON_Y = mapoff();
}

BMAP maze_map, <maze_s.bmp>;

PANEL maze_map_pan
{
POS_X 61;
POS_Y 265;
BMAP maze_map;
LAYER 3;
FLAGS REFRESH, OVERLAY;
}

FUNCTION mapon()
{
IF( KEY_T != 1) { maze_map_pan.VISIBLE = on; }
}

FUNCTION mapoff()
{
IF( KEY_Y != 1) { maze_map_pan.VISIBLE = off; }

}

any help would be apreciated
Posted By: Anonymous

Re: Problems with error during the game - 06/13/02 05:34

You don't understand the syntax. This should work (I'm no expert on panels tho):

ON_T = mapon();
ON_Y = mapoff();

BMAP maze_map, <maze_s.bmp>;

PANEL maze_map_pan
{
POS_X 61;
POS_Y 265;
BMAP maze_map;
LAYER 3;
FLAGS REFRESH, OVERLAY;
}

FUNCTION mapon() {maze_map_pan.VISIBLE = on;}

FUNCTION mapoff() {maze_map_pan.VISIBLE = off;}
Posted By: mudhole

Re: Problems with error during the game - 06/13/02 05:55

There's nothing wrong with your panels. It's these two lines that are causing the problem:

ON_T = mapon();
ON_Y = mapoff();

This means ON_T = the value returned from mapon. This causes the program to fail, as when you press T, it tries to run a function that doesn't exist.

You need to change the lines to:

ON_T = mapon;
ON_Y = mapoff;

No parenthesis means ON_T = the function mapon.

EDIT: You also need to change your functions to what Old Dude suggested to make them turn your panel on off correctly.
Posted By: Anonymous

Re: Problems with error during the game - 06/13/02 07:01

thanks dudes
Posted By: Anonymous

Re: Problems with error during the game - 06/14/02 04:02

Get rid of the "=" sign.
Should be:
On_T mapon;
On_Y mapoff;
© 2024 lite-C Forums