Strange Error on hotspot? CJ

Started by Timosity, Wed 15/10/2003 18:15:02

Previous topic - Next topic

Timosity

I got a report on an error in my game,

It occurred with an interaction on a hotspot.

here's the error:

Quote
An error has occured. Please contact the game author for support, as this problem is caused by the game rather than the interpreter.
(ACI version 2.56.627)

(Room 33 script line 146)
Error: RunRegionInteraction: invalid region speicfied

and this is the script for the hotspot:

 // script for hotspot4: Interact hotspot
if ((character[LAZ].x<220) || (character[LAZ].y>123)){
Display("You're not close enough.");
}

else {
SetGlobalInt(104,0);
MoveCharacter(LAZ,228,100);
while (character[LAZ].walking) Wait(1); // this is the line the error reports
FaceLocation(LAZ,220,100);

if (GetGlobalInt(100)==0){

Display("You clear the mechanism by quickly spinning the lock several turns to the right. Which three numbers do you wish to try?");  

GUIOn(25);
}

else {
ObjectOff(0);
LoseInventory(26);
LoseInventory(36);
LoseInventory(35);
SetGlobalInt(100,0);
Display("You close the locker.");
}
}



I can't replicate the error, and I got a good description of what the player did.

Any Ideas on the reason of the error, maybe something to do with a walkable area? there is no 'region' near or associated with the action.

or maybe it's because the player was standing exactly at 228,100 when interacting with the hotspot?

(Also good find cause I forgot to remove the top menu gui before turning gui25 on, which allows you to bring up inventory or options menu which appears under gui25. and put a Wait(1) after the facelocation.)

~Tim

Pumaman

Do you have any regions in that room? Did the player cross from one to another during the MoveCharacter where it gave the error?

Timosity

There are 2 regions in the room and it is impossible to walk over them when interacting with the hotspot.

They are further to the left and to top of screen going to two rooms, you can't cross them when interacting with the hotspot, if your not close to the hotspot it gives you a message you're not close enough, and when you are close enough it moves you to the specific spot (which was where the error occurred and is nowhere near a region)

The player used the keyboard to walk within range, maybe the mouse was over the region (actually it couldn't be if it was being used to interact with the hotspot)

I'm stumped on this, and I can't recreate it either, It seems like one of those things that happens once in a blue moon, but it will happen to serveral people at some stage.

Edit: not really an edit, but I just looked at the game again and I think I found the problem, I found a 1 by 1 black pixel that was a region right near the point the character walks to, I must have been in regions and clicked the button when I was finding the spot to walk to. It was hard to find aswell cause it just looked like a normal black pixel on the background. but more than likely this was the culprit.

Thanks for replying CJ, as I thought It must be something to do with regions and It didn't seem like it was. This was the ultimate pixel hunting puzzle.

Pumaman

Hmm, even so I'm puzzled as to how it got there. Did you import a mask which had a stray pixel in it?

Timosity

#4
I copied over the walkable mask and edited it, but no, I didn't import a mask specifically for that region. I did however import the mask for the walkable area, and as far as I can see there were no stray pixels in it, but I could have edited the walkable area since and maybe it was there when I copied it to the region initially.

It puzzled me too, I couldn't draw a black line to replicate it, and it was definately there, I've got an older verion where it is still there, I clicked the mouse on it and it took me to region 15, which is white and draws a white line.

maybe it happened sometime in upgrading versions of AGS???

or maybe something to do with copying the walkable area mask to set the other regions and not deleting the unnecessary bits properly?

I still don't know how it ended up being a black region (in colour anyway), and it was a while ago when I did that part and only flukily found out about it with a beta tester.

Oh well, It's probably a very rare occurance, I have no idea if it was something I did, or a minor bug somewhere.

Anyway I think I've fixed the problem, although I couldn't replicate the error in the first place.

Pumaman

Yeah, what probably happened was there was a stray pixel (eg. colour 47) in the original mask you imported - you've probably drawn over it since on the walkable areas, but hadn't done on the regions.

If you selected it in the editor, because it does range checking it would instead select the nearest valid region (15) but the pixel was in fact a different colour.

I'll modify the GetRegionAt error message to be more helpful in future.

Timosity

Thanks CJ, it must have been something like that, I did that part a couple of months ago and didn't pick it up then, so I couldn't pinpoint when it happened, but It's the only possible likely reason for it occurring.

SMF spam blocked by CleanTalk