Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - spydaniel

#1
Quote from: Calin Leafshade on Tue 27/07/2010 00:16:38
use a different walkable area for the gap.

then you can enable and disable that walkable area when you open and close the door.

use RemoveWalkableArea(int ID) and RestoreWalkableArea(int ID)

I completely forgot about using another walkable area. Thanks for the help :D

About the door object, would I set the baseline to 0 so that the character is on top of the sprite and not behind it?
#2
I know you can set width and height blocking on objects, but that just won't work for certain perspectives which are on an angle.

Is it possible to block the characters path where filled in pixels exist but not where they don't (transparency)?

#3
I wanted to share what I managed to do with you're help Khris.

This is my room script:

Code: ags
int pushcounter = 0;

function room_FirstLoad()
{
cEgo.IgnoreWalkbehinds = true;
RemoveWalkableArea(2);
oStoneBlock.Solid = true;
oStoneBlock.BlockingHeight = 100;
oStoneBlock.BlockingWidth = 165;
}

function oStoneBlock_Interact()
{
player.Walk(oStoneBlock.X - 10, oStoneBlock.Y - 2, eBlock);
oStoneBlock.Move(oStoneBlock.X +19, oStoneBlock.Y, cEgo.WalkSpeedX, eBlock, eAnywhere);
pushcounter += 1;

if (pushcounter == 10)
{
  oStoneBlock.Clickable = false;
  oStoneBlock.Move(oStoneBlock.X, oStoneBlock.Y + 90, 50, eBlock, eAnywhere);
  oStoneBlock.Baseline = 10;
  RestoreWalkableArea(2);
}
}


Here is the compiled room to test it out: Room

I changed the magnifying glass icon to one of my own too XD
#4
Thanks again Khris, works perfectly.

In my room, I have a square hole in which the object is meant to slot into, but I'm not sure of a few things.

I want the player to be able to walk over the hole when the object has fell into the hole, but not when it isn't, so I have done this:

Code: ags
function hHotspot1_WalkOn() //Push player up 1 pixel
{
cEgo.StopMoving();
cEgo.Move(cEgo.x, cEgo.y - 1, eBlock, eWalkableAreas);
}

function hHotspot2_WalkOn() //Push player left 1 pixel
{
cEgo.StopMoving();
cEgo.Move(cEgo.x - 1, cEgo.y, eBlock, eWalkableAreas);
}

function hHotspot3_WalkOn() //Push player right 1 pixel
{
cEgo.StopMoving();
cEgo.Move(cEgo.x + 1, cEgo.y, eBlock, eWalkableAreas);
}


Is this the only way to block the player from walking over the hole or is there a better way?

Also, would I use a hotspot to run a script to get the object to move down into the hole? And then make the object un-interactive?
#5
Thanks Khris, got it to work, but I have another question about this.

Is it possible to get the player to walk up to the object's left side and have them face it? Just so it looks like they are pushing the object.
#6
I want the player to be able to push an object that will be in one of my rooms, but I can't find a command to do this?

I want the object to move so many pixels along the x,y from its current location, how would I do this?
SMF spam blocked by CleanTalk