Climbing a chair

Started by cjhrules, Wed 13/10/2004 03:07:54

Previous topic - Next topic

cjhrules

Hi!
I Want my character to climb a chair. When he has done that I want him to perform an action but not automaticly. I want to use the "USE" function and don't want him just to "walk up the chair".

Any suggestions for a script?

Scummbuddy

have it be two animations? then when one is done, then if use blah is done, then run the second animation.
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

cjhrules

I have tried that but after the animation the character is placed back on the floor... I wan't him to be transfered to the walkable area on the chair and then stay there till he "uses" chair again.

BorisZ

Quote from: cjhrules on Wed 13/10/2004 12:15:55
I have tried that but after the animation the character is placed back on the floor... I wan't him to be transfered to the walkable area on the chair and then stay there till he "uses" chair again.

Then make second animation start on chair.

Scorpiorus

Yeah, after the first animation is done you need to move your character on a chair. There are character[].x / character[].y variables for that purpose:

At the very top of room script:

// room script file
int climbedTheChair = 0;

On interacting the chair:

int pc = GetPlayerCharacter();

if (climbedTheChair == 0)
{
   // approach the char:
   MoveCharacterBlocking(pc, NEAR_CHAIR_X, NEAR_CHAIR_Y, 0);

   // climbing up animation:
   SetCharacterView(pc, VIEW_HERE);
   AnimateCharacterEx(pc, LOOP_HERE, DELAY_HERE, 0, 0, 1);
   ReleaseCharacterView(pc);

   character[pc].x = ONCHAR_X_COORDINATE_HERE;
   character[pc].y = ONCHAR_Y_COORDINATE_HERE;

   climbedTheChair = 1;
}
else
{
   // approach the location to climb down from:
   MoveCharacterBlocking(pc, ON_CHAIR_X, ON_CHAIR_Y, 0);

   // climbing down animation:
   SetCharacterView(pc, VIEW_HERE);
   AnimateCharacterEx(pc, LOOP_HERE, DELAY_HERE, 0, 0, 1);
   ReleaseCharacterView(pc);

   character[pc].x = GROUND_X_COORDINATE_HERE;
   character[pc].y = GROUND_Y_COORDINATE_HERE;

   climbedTheChair = 0;
}

See if it works and let us know. ;)

SMF spam blocked by CleanTalk