Walkable area bug: instant teleportation in scrolling room (FIXED)

Started by Le Woltaire, Thu 11/01/2007 22:10:22

Previous topic - Next topic

Le Woltaire

Hi,

Me and my friends are still testing my new game and we got some really
strange bugs:

The first one is a bug on a walkable area:
It's a very big scrolling room (1200px X 240px) with ten animating objects.
The room consists also of a five frames background animation.
The walkable area is quite narrow. When the character explores the room
and reaches the right end he gets sometimes instantly teleportated to
the left end of the room. I can't find any reasons for that.
Could this be an AGS related problem?:

example screen:



The main walkable area is in blue. The red arrow indicates the teleportation way.



The second one is strange as well:
The character get's fixed on the screen after he used an object.
The strange thing is, that this doesn't happen on my computer,
but on the computer of one of my testers.
Can it be, that a bug only happens on certain systems?

Thank you!



Rui 'Trovatore' Pires

You mean you actually managed to replicate that first issue consistently? I've seen it *often* on some completed games with scrolling rooms, but was never really able to replicate it.

As for the second, if your walkable area is too narrow, there's no telling what can go wrong - but one of them could indeed be having your character end up in a non-walkable area. This is rather a bug in AGS, methinks - the character shouldn't have been able to go to that spot *anyway* - but a workaroun could be to use the function whose name I forget but which teleports a character to a point in an enabled walkable area instantly.
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

Le Woltaire

Quote from: Rui "Trovatore" Pires on Thu 11/01/2007 22:14:44
You mean you actually managed to replicate that first issue consistently?

It doesn't happen every time. Let's say in about 30 percent of all cases you get teleportated. But you get always teleportated to the same spot in the walkable area. The game remains always playable...


Quote from: Rui "Trovatore" Pires on Thu 11/01/2007 22:14:44
As for the second, if your walkable area is too narrow, there's no telling what can go wrong - but one of them could indeed be having your character end up in a non-walkable area.

The second problem is not really walkable area related...
It just happens like this:

The character uses an inventory item on a hotspot. Normally he should play some animation and a global integer gets modified to 1:


Code: ags

// script for hotspot4: Use inventory on hotspot

    if (character[B].activeinv==20) 
        {FaceLocation(B,1000,120);AnimateCharacterEx(B,5,3,0,0,0);
          Wait(15);SetObjectGraphic(6,584);ObjectOn(6);
          LoseInventory(20);Wait(40);
          SetObjectView(6,29);AnimateObjectEx(6,7,3,0,0,1);ObjectOff(6);
          FaceLocation(B,2000,120);Wait(30);
          DisplaySpeech(B,"Ha, it worked!");
          SetGlobalInt(66,1);} 


When the character reenters the room a walkable area gets disabled because of the global int. This is how it is on my computer. And it's all right.

Code: ags

  // script for room: Player enters screen (before fadein)

if (GetGlobalInt(66)==1)   
         {ObjectOn(7);DisableHotspot(4);RemoveWalkableArea(4);}


But at my friends computer  he uses the inventory and the walkable area number 4 gets instantly disabled when using the inventory item instead of being disabled when reentering the room...



Pumaman

Hmm, if you could upload the game for me to take a look at the teleportation issue, that'd be interesting.

Le Woltaire

Quote from: Pumaman on Fri 12/01/2007 20:15:45
Hmm, if you could upload the game for me to take a look at the teleportation issue, that'd be interesting.

Hi,

I have some problems with my host right now...
I will try to upload the game and send you a personal message about this.


The second problem I had seems to be solved, it was actually quite simple, I just misunderstood some information from bug reporting.



Pumaman

I have traced the cause of this issue, and am posting it here for reference because a couple of other people have had the same problem.

When you make a scrolling room, make sure that you move the Right Edge out to near the actual width of the room -- even if you're not using the Player Walks Off Right interaction.

This is because the PlaceOnWalkableArea function (which is indirectly called by StopMoving, which in turn is called by Character.Walk) will not place the character outside the screen edges. This is by design, and is to stop the function accidentally triggering the Player Walks Off Edge interactions. However, it means that if you have a scrolling room and do not move the edges, the character will seem to get "teleported" back to within the left hand area of the room sometimes when this function gets called.

LUniqueDan

I Loooooooooooooooooooooooooooooooooooooove you Chris.
(Le Woltaire too, btw.)
Anyone finally.
:-*
"I've... seen things you people wouldn't believe. Destroyed pigeon nests on the roof of the toolshed. I watched dead mice glitter in the dark, near the rain gutter trap.
All those moments... will be lost... in time, like tears... in... rain."

Pumaman

Oh, something I forgot to add -- if you have a vertically scrolling room, you'd need to move the Bottom Edge in a similar manner.

SMF spam blocked by CleanTalk