Show Posts

You can view here all posts made by this member. Note that you can only see posts made in areas to which you currently have access.

Topics - dayowlron

Pages: [1]
I will have several doors in my game so I created a function that I will call that will open and close my doors. Later when I get to adding sound I will put that in the one spot and will work for all my doors. All of my doors have a 5 image(frames numbered 0-4) animation for opening and closing. When a room loads I set the view for the door and then when the player wants to open or close the door I just call the function. When the door is open there is another walkable area that is enabled that allows them to go through the door. It is disabled when the player closes the door. This is where the problem occurs.
Code: [Select]

static function OpenDoor(Object*obj, int WalkableAreaToEnable) {
  if (obj.Frame==0) {
    obj.Animate(obj.Loop, 5, eOnce, eNoBlock, eForwards);
    if (WalkableAreaToEnable!=0) RestoreWalkableArea(WalkableAreaToEnable);

static function CloseDoor(Object*obj, int WalkableAreaToDisable) {
  if (obj.Frame==4) {
    obj.Animate(obj.Loop, 5, eOnce, eNoBlock, eBackwards);
    if (WalkableAreaToDisable!=0) RemoveWalkableArea(WalkableAreaToDisable);

My problem is when the walkable area is removed and then i call player.PlaceOnWalkableArea sometimes it works sometimes it doesn't.
I have walkable area #1 always available so its not like it can't find a walkable area.

EDIT: I have even tried putting the player.PlaceOnWalkableArea() call in the repeatedly_execute function and verified that it is being called.

Beginners' Technical Questions / Object.Name is blank
« on: 15 Jan 2018, 01:09 »
I am having trouble with something. I need to get the object name but it is returning an empty string.
Just including code related to the problem.
Code: [Select]
  LocationType l;
  Object *o;
  o=Object.GetAtScreenXY(mouse.x, mouse.y);
  l=GetLocationType(mouse.x, mouse.y);
  if (l==eLocationObject) {
    return String.Format("%d %s",o.ID, o.Name);
The object name field is filled in. It is called "oDoor". However my function is returning "1 ".

Pages: [1]