Just when I thought everything was working...
I have a very simple 3-frame "grab" animation.
I thought I was doing everything right, but what do I know?
Here it is:
Quote
MoveCharacterBlocking(1, 216, 215, 1);
FaceLocation(1, 216, 220);
Wait(40);
SetCharacterView(1, 11);
AnimateCharacter(1, 0, 10, 0);
ReleaseCharacterView(1);
DisplaySpeech(1, "Jeez, I really need to get these things cleaned one day.");
Wait(40);
SetCharacterView(1, 11);
AnimateCharacter(1, 0, 10, 0);
ReleaseCharacterView(1);
Wait(40);
DisplaySpeech(1, "Deleted to keep puzzle anonymous");
DisplaySpeech(1, "Don't cheat by reading my speech!");
ObjectOn(6);
Don't tell me to use the character's name instead of number, it dosent work.
Also, I tried to split the script in thirds and do the animation via the interactions editor...
The animation worked but it happens before everything else (even when I put "Quick Animation" after "Run Script");
Thanks to all and all to thank
Just a quick question, do you have to actually change the view, I mean, would it be possible to place the grab animation in the characters view, after all you have 15 loops to use (or is it 16).
For instance for my character loops 0-3 are the directions as normal, loops 4-7 are the grab loops for the same directions as the loop (IE the down loop is 0 and the down grab loop is 4). Then I just call
AnimateCharacterEx(CHAR, character[CHAR].loop + 4, 0, 0, 0, 1);
Then you don't have to mess with the set view and release view and all that junk...
hmm, how can I do that without messing up the walking wiew?
Excellent idea, Alynn. Thanks for the tip!
rtf: You probably have to check "No diagonal loops" for the character so the grabbing loops aren't used for the diagonal walk cycles.
aha! Thanks!
Also, just some thing added to above, here is how I handle grabing, you might try it, it works great for me...
function Grab(int obj, int curLoop) {
AnimateCharacterEx(ALYNN, curLoop + 4, 0, 0, 0, 1);
ObjectOff(obj);
AnimateCharacterEx(ALYNN, curLoop + 4, 0, 0, 1, 1);
}
Of course put it in your header file then later on in the game... if the char is picking up object 2 you just call
Grab(2, character[CHAR].loop);
I also have the following for things like touching something but not actually taking...
function AnimateArmUp(int curLoop){
AnimateCharacterEx(ALYNN, curLoop + 4, 0, 0, 0, 1);
}
function AnimateArmDown(int curLoop){
AnimateCharacterEx(ALYNN, curLoop + 4, 0, 0, 1, 1);
}
Which I commonly use like
int loop = character[CHAR].loop;
AnimateArmUp(loop);
DisplaySpeech(CHAR, "This is sticky.");
AnimateArmDown(loop);
just more FYI :)