[SOLVED] Walkable areas, and stairs

Started by Frodo, Sun 28/07/2019 19:29:52

Previous topic - Next topic

Frodo

I recently replaced the backgrounds and sprites in my game, changing RON stuff for my own art. 

Changing the backgrounds meant I had to re-do all the Hotspots, Walkable areas, etc. 

Now my character still walks fine left to right, and in & out of rooms.  But he won't climb up the stairs anymore.  He just walks to bottom of the stairs... and stops.   :confused:

I don't understand why this is happening.  The Walkable areas look fine (see picture).  I even tried to add 'Walkable Area 2', but that made no difference. 
I couldn't find any explanation for this in either the help manual, or the forums, or YouTube tutorials. 

It worked fine when I used the RON graphics - he went up and down the stairs with no problem.  So why does it not work now?
Does anyone know how to fix this? 

[imgzoom]https://i.imgur.com/KW7GtVG.png[/imgzoom]



Cassiebsg

I can't see anything that would explain it from that pic... as a sugestion, try checking if you have any characters/objects that might be blocking the stairs path.

Run your game and check walkable areas (I think it's ctrl+A), that might help you figure out if there's anything blocking it
There are those who believe that life here began out there...

Frodo

I still can't figure out what's blocking him from going up the stairs.   :undecided:

Maybe I'll just add a Hotspot at bottom of the stairs, to teleport him to top of the stairs. 

Crimson Wizard

#3
Maybe a dumb question, but are you certain that your changes get into the game you run? Have you tried changing anything else in same room which is easier to see?

Have you tried using Cassiebsg's advice and display walkable areas at runtime? -
Code: ags

function on_key_press(eKeyCode key)
{
    if (key == eKeyCtrlA) Debug(2, 0);
}


If nothing else helps, could you upload your room for us to check it out?

Khris

Yes, please press Ctrl+A and check if there isn't a huge hole in the walkable area.

Quote from: Frodo on Mon 29/07/2019 13:31:58Maybe I'll just add a Hotspot at bottom of the stairs, to teleport him to top of the stairs. 
That is really weird, and more work than fixing this.

Frodo

Sorry.  This is what it looks like when I run the game and press Ctrl & A.  I don't see any holes or anything in the Walkable area.   :confused:

[imgzoom]https://i.imgur.com/OrcnbSN.png[/imgzoom]


I haven't changed any of the code - just the art (and resetting the Hotspots and Walkable areas).

And here's the room code:


Code: AGS

// room script file
bool LightsOn = true;
bool EnteredWelcomeRoom = false;
int y_offset = 40;
int x_offset =  0;

bool mirrorsCreated = false;




function room_FirstLoad()
{
mouse.Mode = eModeInteract;
cCook.Tint(10, 10, 10, 80, 80);
cDeryl.Tint(100, 10, 10, 80, 80);
cAbby.Tint(10, 100, 10, 80, 80);
cEmma.Tint(10, 10, 100, 80, 80);
}

function room_Leave()
{
player.RemoveTint();
cShadow.Transparency= 0;
}



function oFrontDoor_Interact()
{
player.Think("That's the front door.  I'm not gonna leave yet - I don't have everyone's autograph yet.");
}

function oFrontDoor_Look()
{

}

function hOutside_Interact()
{
  player.Think("That's the front door.  I'm not gonna leave yet - I don't have everyone's autograph yet.");
}

function hOutside_Look()
{
  player.FaceDirection(eDirectionLeft);
  player.Think("That's the way I came in.");
}
/*
function hDoor2_Interact()
{
if (EnteredWelcomeRoom == false) {
 player.Think("Let's see what's inside."); 
 player.ChangeRoom(4, 120, 375);
 EnteredWelcomeRoom = true;
}
else player.ChangeRoom(4, 120, 375);
}

function hDoor2_Look()
{
player.Think("A big red door.  For guests that are welcome.  What happens to guests that AREN'T welcome?");
}

function hDoor3_Interact()
{
player.ChangeRoom(5, 250, 375);
}

function hDoor3_Look()
{

}

function hDoor4_Interact()
{
player.ChangeRoom(6, 230, 375);
}

function hDoor4_Look()
{

}

function hDoor5_Interact()
{
  player.ChangeRoom(12);

}

function hDoor5_Look()
{

}

function Door6_Interact()
{
player.ChangeRoom(7, 230, 375);
}

function Door6_Look()
{

}


function hDoor7_Interact()
{
player.ChangeRoom(8, 230, 375);
}

function hDoor7_Look()
{

}



function hStairs_Interact()
{
player.ChangeRoom(16);
}

function hStairs_Look()
{

}
*/


 function room_LeaveTop()
{
  player.ChangeRoom(13, 940, 333);
}



function oClock_Interact()
{
player.Think("I'm not going to mess with it.  I might break it.");
}

function oClock_Look()
{
player.Think("Oh, cool!  It's an old Grandfather Clock.  Beautiful carvings in the wood.");
}

function hShelf_Look()
{
player.Think("That's one VERY high shelf!");
}

function hShelf_Interact()
{
  player.Think("Urgh!  I can't reach it.");
}



function oGargoyle1_Look()
{
  player.Think("Looks scary!");
}



function oGargoyle1_Interact()
{
  player.Think("Are you gonna come alive, and eat me, the moment I step too close?");
}


function oGargoyle2_Look()
{
  player.Think("Looks scary!");
}


function oGargoyle2_Interact()
{
  player.Think("Are you gonna come alive, and eat me, the moment I step too close?");
}


function hGrandfatherClock_Interact()
{
  if (player.HasInventory(iMedallion))  {
    player.Think("I already took the medallion from the clock.");
  }
  else
  if (player.HasInventory(iAutBookCameron)) 
  {
    player.Think("A medallion is glinting inside the Clock.  Eliza's medallion?");
    player.Think("I'll open the glass door and take it.");
    player.AddInventory(iMedallion);
  } 
    else
    player.Think("I'm not going to mess with it.  I might break it.");
}

function hGrandfatherClock_Look()
{
  if (player.HasInventory(iAutBookCameron)) 
  {
    player.Think("There's something glinting in the clock.");
  }
  else
  player.Think("Oh cool!  It's an old Grandfather Clock.  Beautiful carvings in the wood.");
}

function hGoldRecord1_Look()
{
  player.Think("It's one of their Gold Records.  This one's for the 'When All Hope Fades' Album.");
}

function hGoldRecord1_Interact()
{
  player.Think("Look, but DON'T touch!");
}

function hGoldRecord2_Interact()
{
  player.Think("Look, but DON'T touch.");
}

function hGoldRecord2_Look()
{
  player.Think("It's one of their Gold Records.  This one's for the 'Salvation Shines Through' Album.");
}

function hRadiator1_Look()
{
  player.Think("It's a radiator.  What else do you want me to say?");
}

function hRadiator1_Interact()
{
player.Think("I don't want to.");
}



function hRadiator2_Look()
{
  player.Think("It's a radiator.  What else do you want me to say?");
}

function hRadiator2_Interact()
{
 player.Think("I don't want to.");
}


function hGargoyle1_Look()
{
  player.Think("ARRRGGGHHHHHHH!  A DEMON!!!  A DEMON!!!");
  player.Think("Oh wait, it's not alive.  Phew!");
}

function hGargoyle1_Interact()
{
  player.Think("My, what sharp teeth you have.");
}

function hGargoyle2_Look()
{
  player.Think("Are you a girl gargoyle or a boy gargoyle?");
}

function hGargoyle2_Interact()
{
  player.Think("Hmmm.  Are you just waiting to eat me up the moment I step too close?");
}

function hOffice_Look()
{
  player.FaceDirection(eDirectionUp);
  player.Think("A big door.  I guess visitors aren't allowed in here.");
}

function hGroundFloorStairsUp_Look()
{
  player.Think("There's a lady who's sure all that glitters is gold.  And she's buying a stairway to heaven.");
}

function hLivingRoomDoor_Look()
{
  player.FaceDirection(eDirectionUp);
  player.Think("This door leads to the Living Room.");
}

function hHighShelf_Look()
{
  player.Think("That's one VERY high shelf.");
}

function hHighShelf_Interact()
{
  player.Think("Urgh!  It's too high up.");
}

function hArtGalleryDoor_Look()
{
  player.FaceDirection(eDirectionUp);
  player.Think("The Art Gallery.  What amazing wonders lie beyond this door?");
}

function hBasementDoor_Look()
{
  player.FaceDirection(eDirectionDown);
  player.Think("It says 'Basement'.");
}

function hDiningRoomDoor_Look()
{
  player.FaceDirection(eDirectionDown);
  player.Think("Behind this door is the Dining Room.  Where the band eat all their meals.");
}



function hKitchenDoor_Look()
{
  player.FaceDirection(eDirectionRight);
  player.Think("Someone's in the kitchen with Dinah.  Strumming on the old banjo.");
}




function oRemoteControlHelicopter_Look()
{
  player.Think("It's one of those remote control helicopters.  What's it doing up there?");
}

function oRemoteControlHelicopter_PickUp()
{
  player.Think("And how exactly am I supposed to reach it?");
}






function hGroundFloorStairsUp_Interact()
{

  player.Think("Should I count the stairs.");
}




function hOffice_Interact()
{
  if (player.HasInventory(iManagerKey))
  player.ChangeRoom(5, 180, 340);

  else {
  player.Think("I can't get in there.  The door is locked.");
  }
}

function hLivingRoomDoor_Interact()
{
 player.ChangeRoom(6, 175, 345);
}


function hArtGalleryDoor_Interact()
{
 player.ChangeRoom(7, 170, 345);
}


function hBasementDoor_Interact()
{
  if (player.HasInventory(iBlueCup))
  player.ChangeRoom(30, 1360, 380);

player.Think("I can't go down there.  The door is locked.");
}

function hDiningRoomDoor_Interact()
{
 player.ChangeRoom(8, 185, 350);
}

function hKitchenDoor_Interact()
{
  player.ChangeRoom(9, 200, 330);
}



function oRadiatorOff_Look()
{
  player.Think("It's just a Radiator.  Nothing exciting.");
}


function oRadiatorOn_Look()
{
  player.Think("It's just a Radiator.  Nothing exciting.");
}



function oRadiatorOff2_Look()
{
 player.Think("It's just a radiator.  Nothing exciting.");
}



function RadiatorOn2_Look()
{
 player.Think("It's just a radiator.  Nothing exciting.");
}


function oRadiatorOn2_Interact()
{

}

function region2_WalksOnto()
{
    if (Game.DoOnceOnly("FirstTime")){
    dJasonMeetsManager.Start();
    }
}





function oRemoteControlHelicopter_UseInv()
{
  if (player.ActiveInventory==iHelicopterRemote) {
  player.Walk(1316, 318);
  player.Think("I'll use this remote to guide the helicopter down from the shelf.");
  oRemoteControlHelicopter.Visible = false;
  player.AddInventory(iRemoteControlHelicopter);
  player.LoseInventory(iHelicopterRemote);
  }
  else
  player.Think("I can't use that with the Remote Control Helicopter.");
}

function region4_WalksOnto()
{
  if (player.HasInventory(iAutBookCameron)) {
    player.Think("What's that glint over there?  It's coming from the Grandfather Clock.");
}
}

function region5_WalksOnto()
{
  if (player.HasInventory(iBlueCup)) {
    cAaron.Say("The Manger unlocked the door for us.");
    cAaron.Say("We can go down to the music studio now.");
    cAaron.Walk(1760, 323, eBlock);
    cAaron.ChangeRoom(30, 1460, 410);
    cAbby.Walk(1760, 323, eBlock);
    cAbby.ChangeRoom(30, 1580, 455);
    cCameron.Walk(1760, 323, eBlock);
    cCameron.ChangeRoom(30, 1170, 370);
    cEliza.Walk(1760, 323, eBlock);
    cEliza.ChangeRoom(30, 2125, 440);
    cDeryl.Walk(1760, 323, eBlock);
    cDeryl.ChangeRoom(30, 950, 385);
}
}


function oRemoteControlHelicopter_Interact()
{
  player.Think("Urgh!  I can't reach it - it's too high!");
}

Laura Hunt

Maybe your player sprite is just too wide and doesn't fit in the stairs' walkable area? This is SO confusing  :confused:

Khris

Try filling the rest of the room with walkable area 2 and see what happens.

Frodo

Quote from: notarobotyet on Tue 30/07/2019 08:18:09
Maybe your player sprite is just too wide and doesn't fit in the stairs' walkable area? This is SO confusing  :confused:

I hadn't thought about my new player sprite being too wide.
But I just made the walkable area REALLY wide on the stairs, and it doesn't make any difference.   :sad:

Frodo

Quote from: Khris on Tue 30/07/2019 08:44:51
Try filling the rest of the room with walkable area 2 and see what happens.

Now that's interesting!  When I fill the room with Walkable Area 2, my guy can walk up the walls to get to the floor above... but he still won't climb up the stairs.  He just stands at the bottom.
Which kinda indicates there's something wrong with the stairs themselves.  Not sure what, at the moment.   :confused:

I have to go out now, but when I get back, I'll fiddle around with the stairs and see if I can find what's wrong. 

Khris

AFAIK AGS doesn't care about the player's sprite width; which is why you have to draw very narrow walkable areas if you have a wide player sprite. It should only check the player's feet coordinates against the drawn area.

Any solid object, which would also be blocking, should be visible as hole in the Ctrl+A screen. There's one to the left of the stairs, which I assume is from the left statue? But still not nearly wide enough to block the player.
The only other thing I can think of is like a region event that calls  player.StopMoving();?

I would love to take a look; feel free to send the zipped up source files my way.

Frodo

The holes to the left of the stairs are from the player, and another character. 

I added hotspots on the stairs, as a way around the problem until I can figure it out.  Not ideal, but at least I can get up to the 1st Floor. 

I never used player.StopMoving.   :confused:

Khris, I sent you a PM.   :smiley:

Khris

I found the reason; there's a hotspot covering most of the stairs, and clicking it in WalkTo mode makes the character walk to the WalkTo point, which is at the bottom of the stairs.
If you click near the edge of the stairs, outside the hotspot, the player will walk there just fine.

Frodo

AHA! 

Khris, you figured it out.  Thankyou!   :cheesy:
And such a simple reason.   :embarrassed:

The Hotspot on the stairs was to add some interactivity - when he looks at the stairs, he sings Stairway To Heaven. 
I didn't realise it would interfere with actually climbing the stairs, lol.
When I remove that Hotspot, my little rocker guy will climb up the stairs no problem. 

Strange that it worked when I had RON sprites though.  But I don't care.  I can walk up the stairs again. 

Thanks Khris.   :wink:

Cassiebsg

Well, I think that if you want to keep the look interaction, you could just code the interaction on the hotspot to perform a walk to click_x, click_y.  ;)
There are those who believe that life here began out there...

SMF spam blocked by CleanTalk