Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Shaque on Mon 27/11/2006 19:58:47

Title: Alternating character baselines
Post by: Shaque on Mon 27/11/2006 19:58:47
I have a question regarding setting baselines for characters. Well, only one really, but I change his view occasionally and one of the views requires that the baseline be set to the middle of the sprites. I have a normal view and an isometric view, but when I try to set a walkable area with an overhead view, I want to be able to alternate the baseline to account for overhead areas. Otherwise, I have to shift the walkable mask down a few pixels til it looks right. I would much rather import a predrawn set of masks. I'm not using seperate characters, only several views on the one character. My AGS version is up to date and I know the script function for changing the baseline, but I'm not very good with scripting and I don't really know where to put it or how to make it change back to normal baseline when I need it to. Can anyone help me? Thanks in advance.
Title: Re: Alternating character baselines
Post by: Khris on Mon 27/11/2006 20:32:04
// inside repeatedly_execute
  if (player.View==OVERHEAD)
    player.Baseline=player.y-30;
  else
    player.Baseline=0;


Adjust OVERHEAD to match the name/number of the overhead view, 30 should be the amount of pixels the baseline has to move up.
Title: Re: Alternating character baselines
Post by: Shaque on Thu 30/11/2006 15:45:20
I got an error using this, but I can play around with the script and find the results I need. I appreciate your help. Thanks.

Edit: I got it working and its exactly what I wanted. Thanks heaps.
Title: Re: Alternating character baselines
Post by: Da_Elf on Thu 30/11/2006 16:08:02
the hill module that was written to solve my problems works really well in setting the baseline
Title: Re: Alternating character baselines
Post by: Khris on Thu 30/11/2006 16:58:58
The player.Baseline-command works really well, too ;)