Hello, I'm really stuck here.
My situation is the following:
When the mouse is over a hotspot (or obj or char), I made the cursor change to the appropriate MODE.
Additionally, I wanted to display the name of the hotspot next to the cursor.
I figured I could use a transparent GUI with one label and change the GUI's pos and label's text in the repeatedly_execute().
My first attempt though was to achieve this by using a TextOverlay which seems to be a more elegant way (at least in my opinion).
First I tried to store the Overlay's ID in an int I declared in line 2 of the global script (outside any function).
In game_start() I had
Ã, id=CreateTextOverlay(0, 0, 100, 2, 1, "");
and in the global repeatedly_execute() I had
Ã, SetTextOverlay(id, x+5, y+5, 100, 2, 1, line); (with x and y holding the mouse coords)
Then I tried another approach:
In game_start() I had
Ã, int id;
Ã, id=CreateTextOverlay(0, 0, 100, 2, 1, "");
Ã, SetGlobalInt(9, id);
and in the global repeatedly_execute() I had
Ã, int id;
Ã, id=GetGlobalInt(9);
Ã, SetTextOverlay(id, x+5, y+5, 100, 2, 1, line);
Both methods work fine as long as EGO stays in the first room.
But as soon as a new room is loaded, the game crashes with the following error message:
(room 4, script line 66) RemoveOverlay: Invalid Overlay ID passed
(line 66 of the global script holds the SetTextOverlay command)
(Perhaps I should add that I don't use the global repeatedly_execute(); I wrote my own called rep_ex() and call it in every room's repeatedly_execute() to disable the cursor's auto-change in rooms where I don't want it. But I believe it doesn't matter. And the global repeatedly_execute() is empty of course.)
I know this post is awfully long, but I wanted to be exact. Sorry
Please help, any hint is appreciated.
My situation is the following:
When the mouse is over a hotspot (or obj or char), I made the cursor change to the appropriate MODE.
Additionally, I wanted to display the name of the hotspot next to the cursor.
I figured I could use a transparent GUI with one label and change the GUI's pos and label's text in the repeatedly_execute().
My first attempt though was to achieve this by using a TextOverlay which seems to be a more elegant way (at least in my opinion).
First I tried to store the Overlay's ID in an int I declared in line 2 of the global script (outside any function).
In game_start() I had
Ã, id=CreateTextOverlay(0, 0, 100, 2, 1, "");
and in the global repeatedly_execute() I had
Ã, SetTextOverlay(id, x+5, y+5, 100, 2, 1, line); (with x and y holding the mouse coords)
Then I tried another approach:
In game_start() I had
Ã, int id;
Ã, id=CreateTextOverlay(0, 0, 100, 2, 1, "");
Ã, SetGlobalInt(9, id);
and in the global repeatedly_execute() I had
Ã, int id;
Ã, id=GetGlobalInt(9);
Ã, SetTextOverlay(id, x+5, y+5, 100, 2, 1, line);
Both methods work fine as long as EGO stays in the first room.
But as soon as a new room is loaded, the game crashes with the following error message:
(room 4, script line 66) RemoveOverlay: Invalid Overlay ID passed
(line 66 of the global script holds the SetTextOverlay command)
(Perhaps I should add that I don't use the global repeatedly_execute(); I wrote my own called rep_ex() and call it in every room's repeatedly_execute() to disable the cursor's auto-change in rooms where I don't want it. But I believe it doesn't matter. And the global repeatedly_execute() is empty of course.)
I know this post is awfully long, but I wanted to be exact. Sorry

Please help, any hint is appreciated.