Alternating character baselines

Started by Shaque, Mon 27/11/2006 19:58:47

Previous topic - Next topic

Shaque

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.
Knowledge is a right, wisdom is a choice.

Khris

Code: ags
// 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.

Shaque

#2
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.
Knowledge is a right, wisdom is a choice.

Da_Elf

the hill module that was written to solve my problems works really well in setting the baseline

Khris

The player.Baseline-command works really well, too ;)

SMF spam blocked by CleanTalk