In my game I want to do something like "Ben there, Dan that" and have a character that follows you around and you use to interact in certain puzzles. What I need to know are two things:
1) If I have the side character follow the main character how is that programmed?
2) When I use the side character icon to interact, do I use the User Modes 1 and 2 on objects? If so, how does that work?
1: check out FollowCharacter in the help menu
eg
cMan.FollowCharacter(cEgo, 5, 80); // character to follow, distance, eagerness
2: You can use interactions to side player (npc) in its property panel and you can ever set it as main character.
You can click on an object / hotspot and get npc to do things by 'calling' him in the script.
hope this helps.
To use the side character on stuff, just implement them as inventory item and use them like a regular one.
What does eagerness mean? Also how will calling look in the script
The parameters are explained in the manual, which is the very first resource you should exhaust before coming here.
"Calling him" in the script will look something like this:
function hStove_Useinv() {
if (player.ActiveInventory == iSidekick) {
cSidekick.Walk(123, 45, eBlock);
cSidekick.FaceLocation(cSidekick.x, cSidekick.y - 1); // up
Wait(20);
cSidekick.FaceLocation(player.x, player.y);
Wait(5);
cSidekick.Say("It's hot; what am I supposed to do, burn myself?");
}
else unhandled_event(1, 3);
}
When I program a character to follow another how do I get that character to stop following?
They're all in the manual.
QuotePass CHARTOFOLLOW as null to stop the character following.
So, just use
cMan.FollowCharacter(null); to stop say, the character cMan to follow any other character.