Second Character

Started by dasjoe, Fri 17/10/2003 18:51:44

Previous topic - Next topic

dasjoe

Anyone got an idea how to add a second player character to the game?
The character should not be player-controlled.
He should follow the main character in every room and do some funny stuff.
Just like Max (Sam & Max) and Joey (Beneath a steel sky).
... it's quite easy being the best.

AJA

#1
To make a character follow another character ->
manual:

QuoteFollowCharacter
FollowCharacter (CHARID, int chartofollow)

Tells the character CHARID to follow CHARTOFOLLOW around, wherever he goes. You could use this command to have a group of main characters who go around together, or for example when the hero has rescued someone from the bad guy, they can follow the hero home.
Pass CHARTOFOLLOW as -1 to stop the character following.

Example:

FollowCharacter(MAN,EGO);

will make character MAN follow the characterEGO wherever he goes.
See Also: FollowCharacterEx



--------------------------------------------------------------------------------

FollowCharacterEx
FollowCharacterEx (CHARID, int chartofollow, int dist, int eagerness)

Does the same thing as FollowCharacter (see above), but allows you to set extra parameters. DIST sets how far away from CHARTOFOLLOW that CHARID will stand. If DIST is 1, they will try to stand very close; if DIST is for example 20, they will stand about 20 pixels away.
EAGERNESS sets on average how long the character will stand around before checking if he needs to move again. Setting this to 0 means that he will always be on the move until he reaches CHARTOFOLLOW; setting this to 99 means that he will pause and think for a while on route. Values in between specify different lengths of idle time.

The default values are DIST=10 and EAGERNESS=97.

As a special case, setting DIST=0 and EAGERNESS=0 makes CHARID behave as if it is chasing CHARTOFOLLOW - it will try and get there as quickly as possible. Setting EAGERNESS=0 also tells the character not to stop when they reach CHARTOFOLLOW, but instead to randomly wander around the character - useful perhaps for a very energetic dog or something.

Example:

FollowCharacterEx(MAN,EGO,5,80);

will make character MAN follow character EGO standing about 5 pixels near him and waiting for a while before he makes his move.
See Also: FollowCharacter

InCreator

Yeah, and set funny stuff as his Idle View.
In matter fact, you could find out, how to use different Idle views randomly for one character, I'll be needing that too.

dasjoe

hmm... maybe you can create a global counter that counts every gamecycle. and after, say 400 cycles (10 secs) you could change the characters idle-animation.
... it's quite easy being the best.

SMF spam blocked by CleanTalk