Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: spook1 on Mon 21/11/2005 11:20:02

Title: character indentifier as a variable
Post by: spook1 on Mon 21/11/2005 11:20:02
In my game I have a set of caharcaters that should move in sync with the main character, but with an oofset.

FOLLOW_EXACTLY does not help here, sinde it does not provide the option of an offset.

I intend to make a small loop:

while (i <MaxChars)
  Char.x = cMainChar.x + Char.xoffset;
  Char.y = cMainChar.y + CHar.yoffset;
  i++;
}

Can thsi be done?? I am a bit confused by the obsoletness of a number of Charprperties.

Martin
Title: Re: character indentifier as a variable
Post by: Gilbert on Mon 21/11/2005 11:30:53
Yes.
Simplest way is that when you create the characters in the editor, bear in mind that they're created as consequent entries.
Just check in the editor about their assigned range, say, #5-9, you can just access them directly using the character[] array. Like for example:

ii=5;
while (ii<=9){
character[ii].blah bla bla
Ã,  ii++;
}