Aller au contenu

Photo

Cutscene heartbeat, and change.


  • Veuillez vous connecter pour répondre
7 réponses à ce sujet

#1
andysks

andysks
  • Members
  • 1 652 messages

Hi again. I am trying to do something, and I'm certain there's an easier way to proceed, or one that will show less problems. Bear with me.

 

We enter an area, where an NPC is under a heartbeat animation. We enter the trigger, and conversation begins. She is not the owner, since I thought that the animation will break if she was. The script she uses is this.

void main()
{
    
    if ( GetAILevel() == AI_LEVEL_VERY_LOW )
        return;

    
    if ( IsInConversation(OBJECT_SELF)  ||  GetIsInCombat() )
        return;

    
    
    PlayCustomAnimation(OBJECT_SELF, "kemo_back_8i", 1);                            
}

Something Lilacs gave I think.

Anyway, the animation is lie on the side.

During the conversation, I want this animation to break, and she stands up. I thought that this will work, but didn't. Setting the script set to 9, which is the default, I had the idea that since she no longer calls the custom heatbeat she will stand up.

void main(string sTag, int nScriptSet)
{
	object oMe = GetObjectByTag(sTag);
	
	SetCreatureScriptsToSet(oMe, nScriptSet);
	
	
}

So, I guess a variety of things.

One, my second script is gibberish.

Two, that this might work better by playing custom animation and lose the heatbeat.

Three, maybe a blocking script would do wonders here.

 

Any idea on how to do this kind of thing?



#2
Tchos

Tchos
  • Members
  • 5 072 messages

You have the animation set to looping.  Often, this will break on its own, which is why I use the heartbeat to refresh it, but if you want to return to the normal animation on demand, you need to set the animation to "idle".



#3
andysks

andysks
  • Members
  • 1 652 messages

The problem is that if it's not looping she will keep getting up and down, and I want her to speak some nodes first before getting up. So you say if I call ga_custom_animation "idleM" or even set it to idle from the conversation node option she will break the heartbeat? I did some more tests and at the moment... it kinda works.

 

I called ClearAllActions and PlayAnimation "119", which is standup fireforget.

She will stand up, talk a bit and get down again for a split second.

On the next node I call a "talknervous" custom animation looping, and it takes over the lying down one. But in this way she keeps talking nervous until the end of the conversation. I will see with "idle", and with non looping "talknervous" and hope to get lucky.



#4
4760

4760
  • Members
  • 1 213 messages

If I understand correctly, the NPC is lying on her side when the conversation starts:

void main()
{
     if ( GetAILevel() == AI_LEVEL_VERY_LOW )
        return;
    if ( IsInConversation(OBJECT_SELF)  ||  GetIsInCombat() )
        return;   
    PlayCustomAnimation(OBJECT_SELF, "kemo_back_8i", 1);                            
}

And she's supposed to stay in that position until a few words have been exchanged, correct? In that case, I'd use another script, which will be called when she needs to stand up:

/*
Removes all animations and revert to idle
sTag is the tag of the NPC who has to stop the current looping animation
*/

void main(string sTag)
{
	object oTalker = GetObjectByTag(sTag);
	PlayCustomAnimation(oTalker , "idle", 0); 
	PlayCustomAnimation(oTalker , "%",0); //	percent sign to set the looping animations to defaults.	
}

If the above script is named "ga_getup", in the conversation node when she has to stand up put ga_getup in the action tab and define sTag to be her tag.



#5
4760

4760
  • Members
  • 1 213 messages

She will stand up, talk a bit and get down again for a split second.

Isn't this because the "kemo_back_8i" called from a heartbeat script? Since it's looping, when I have to do this kind of animations (for example, a smith running "forge01" or a farmer "shoveling", I put the corresponding PlayCustomAnimation lines in the OnEnter script of the area.



#6
andysks

andysks
  • Members
  • 1 652 messages

This is how they made AJ lie down on the bed on MotB. I was just looking at that. But it's a bit hard to track the whole code. Anyway. Now the woman has default scripts, and no custom heartbeat. But the looping will cause the sit-fall effect.

 

Your script works really fine. She will just not perform the standup animation, which has one to put the hand on the ground and lift himself up. Well, nobody's perfect. I think this one will do it.

 

For a workaround on this I tried to add a line to your script to play the standup animation before reverting to idle, but it won't work. Thanks for the help :).



#7
4760

4760
  • Members
  • 1 213 messages

Like this you mean?

/*
Removes all animations and revert to idle
sTag is the tag of the NPC who has to stop the current looping animation
*/

void main(string sTag)
{
	object oTalker = GetObjectByTag(sTag);
	PlayCustomAnimation(oTalker,"standupB",0);
        // maybe add a delay to allow the previous animation to end
	PlayCustomAnimation(oTalker , "idle", 0); 
	PlayCustomAnimation(oTalker , "%",0); //	percent sign to set the looping animations to defaults.	
}

I just tried, and it looks good. Of course, the standard "prone" position is different, but this should at least make the NPC stand up rather than just go from lying to standing.



#8
andysks

andysks
  • Members
  • 1 652 messages

I will try it in a couple of hours and see what happens. I love realistic cutscenes sometimes and often go the extra mile to achieve the desired result. Maybe I'll post the video of this one once it's done :).