Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: nightmarer on Thu 10/06/2021 19:15:48

Title: Room background splitted and moved (solved)
Post by: nightmarer on Thu 10/06/2021 19:15:48
Hello.

I'm getting a weird error while loading one room.
This is how it looks in AGS.
(https://imgur.com/hdC98AV)
https://imgur.com/hdC98AV (https://imgur.com/hdC98AV)
This is how it is shown when running the game.
(https://imgur.com/nJp4CMN)
https://imgur.com/nJp4CMN (https://imgur.com/nJp4CMN)
Anyone has an idea why is this happening?

Regards.
Title: Re: Room background splitted and moved
Post by: Crimson Wizard on Thu 10/06/2021 19:34:47
The only thing this may normally happen if you created more than 1 room viewports in script.

If not, that's some kind of new bug, I have never seen this before.
Title: Re: Room background splitted and moved
Post by: nightmarer on Thu 10/06/2021 21:26:42
It happened to another room of the game sometime before, but it seemed to fixed without doing anything.
Let me share the code of the room, so you will see there's anything weird about it.

Quote// COURTYARD
function room_Load()
{
  transicion(true);
  object[0].SetView(514, 0, 0);
  object[0].Animate(0, 5, eRepeat, eNoBlock);
  object[1].SetView(513, 0, 0);
  object[1].Animate(0, 5, eRepeat, eNoBlock);
  object[2].SetView(512, 0, 0);
  object[2].Animate(0, 5, eRepeat, eNoBlock);
  object[3].SetView(511, 0, 0);
  object[3].Animate(0, 5, eRepeat, eNoBlock);
  object[4].SetView(510, 0, 0);
  object[4].Animate(0, 5, eRepeat, eNoBlock);
  object[5].SetView(291, 0, 0);
  object[5].Animate(0, 5, eRepeat, eNoBlock);
  object[6].SetView(515, 0, 0);
  object[6].Animate(0, 5, eRepeat, eNoBlock);
  object[7].SetView(516, 0, 0);
  object[7].Transparency=(80);
  object[7].Animate(0, 5, eRepeat, eNoBlock);
  FadeOut(64);
  Wait(5);     
  FadeIn(1);   
}

function room_AfterFadeIn()
{
  SetTimer(1, 500);
  Isaac.Walk(246, 240, eBlock, eWalkableAreas);
  transicion(false);
}

function room_FirstLoad()
{
  Isaac.Think("Oh my fucking god.");
}

function room_Leave()
{
  stopper();//AudioStop
}

function room_RepExec()
{
  if(!Spider.Moving && IsTimerExpired(1)) {
    Spider.Walk(Random(175)+200, Random(130)+20, eNoBlock, eWalkableAreas);
  }
}

function room_LeaveBottom()
{
  Isaac.ChangeRoom(29, 136, 753, eDirectionDownLeft);
}
Title: Re: Room background splitted and moved
Post by: Crimson Wizard on Thu 10/06/2021 21:42:22
Are these parts of a room background on these screenshots, or they are big objects? Does the character walk properly around the room?
Title: Re: Room background splitted and moved
Post by: nightmarer on Thu 10/06/2021 21:56:16
OK, I think that now I know what is happening, I think that I asigned the objets to wrong views in the same room and everything is doing a mess. Sorry for the inconvenience.
Title: Re: Room background splitted and moved (solved)
Post by: eri0o on Thu 10/06/2021 22:05:56
nightmarer, you can give name to objects and use the names, and you can also give names to views and use their names - the name you write in the view becomes UPPERCASE_VERSION_OF_IT. Maybe you know this, but just wanted to check it out.
Title: Re: Room background splitted and moved (solved)
Post by: nightmarer on Thu 10/06/2021 22:13:32
Thanks eri00.

Sometimes I used object names, but sometimes I prefer to use the numbers just for doing everything faster, and that is why I sometimes mess everything.
Title: Re: Room background splitted and moved (solved)
Post by: Khris on Fri 11/06/2021 10:47:34
Using numbers isn't faster because a) auto-complete will help with typing the object name b) you'll spend less time fixing error like this one :-D