My npc sits on a bench and the player can talk to her, after some lines she(the npc) will get up and walk to a waypoint to preform an ambient animation there.
In theory I got that working but I could not make it smooth enough or without strange results.
The script is as this:
UT_QuickMove("cook_helper_01","ap_helper_sleep");
Ambient_Stop(oHelper);
Ambient_Start(oHelper, AMBIENT_SYSTEM_ENABLED, AMBIENT_MOVE_INVALID, AMBIENT_MOVE_PREFIX_NONE, 58);
oHelper is my npc with the tag "cook_helper_01".
She gets up and walks to the waypoint (tagged "ap_helper_sleep") and changes her ambient behaviour to 58(sleeping on back).
The problem is that she floats in the air besides the bed and not lie on the bed.
Ideally I would like her to even preform another animation before 58 like sitting down and lie back or so.
I did change the script to have the npc destroyed and a double made visable but she gets destroyed too early and doesn't preform her move at all.
the second script is this:
UT_QuickMove("cook_helper_01","ap_helper_sleep");
WR_SetObjectActive(GetObjectByTag("cook_helper_01"),FALSE);
WR_SetObjectActive(GetObjectByTag("cook_helper_sleep"),TRUE);
Is there a way to either delay the destruction of the first creature or make her preform a series of animations to get a smooth result?
npc ambient behaviour after conversation
Débuté par
Apolyon6k
, mars 07 2011 10:27
#1
Posté 07 mars 2011 - 10:27
#2
Posté 07 mars 2011 - 09:08
Hi Apolyon6k,
That ambient behaviour (58) is a looping animation and it doesn't have an enter animation. You could take a look at ANIM_base.xls and try to use other animations to make the change smoother, but I think that there is no way to achieve the "lie back" effect. Anyway, if you have seen that sequence of animations somewhere in the single player campaign, then it can be done.
If you have problems placing the creature on the bed and playing the laying animation, then maybe you have to set to 1 the PHYSICS_DISABLED variable of the creature. That will make it ignore the physics rules, so it won't collide with the bed or other placeables.
Maybe the best way to do it would be to move your creature towards the bed. Play a sitting animation and then:
a - Place the creature on the bed ( try to use SetPosition() ) and play the sleeping animation.
b - Set the moving creature inactive and set active another creature (like you pointed).
If you need to delay something, use the delay event function:
http://social.biowar....php/DelayEvent
Send an event of type EVENT_TYPE_CUSTOM_EVENT_01 to your creature. Then, process that event in your creature's script and set it inactive.
In this case, if you don't need "cook_helper_01" any longer, youd could also use Safe_Destroy_Object(). One of its parameters is the delay time, but I think that the target creature will disappear suddenly instead of playing the disappear animation. So, you might not like it.
You could also draw a trigger around the destination waypoint. Then set inactive the entering creature.
The last option that comes to my mind is to use CommandMoveToMultiLocations() and process the EVENT_TYPE_REACHED_WAYPOINT event.
That ambient behaviour (58) is a looping animation and it doesn't have an enter animation. You could take a look at ANIM_base.xls and try to use other animations to make the change smoother, but I think that there is no way to achieve the "lie back" effect. Anyway, if you have seen that sequence of animations somewhere in the single player campaign, then it can be done.
If you have problems placing the creature on the bed and playing the laying animation, then maybe you have to set to 1 the PHYSICS_DISABLED variable of the creature. That will make it ignore the physics rules, so it won't collide with the bed or other placeables.
Maybe the best way to do it would be to move your creature towards the bed. Play a sitting animation and then:
a - Place the creature on the bed ( try to use SetPosition() ) and play the sleeping animation.
b - Set the moving creature inactive and set active another creature (like you pointed).
If you need to delay something, use the delay event function:
http://social.biowar....php/DelayEvent
Send an event of type EVENT_TYPE_CUSTOM_EVENT_01 to your creature. Then, process that event in your creature's script and set it inactive.
In this case, if you don't need "cook_helper_01" any longer, youd could also use Safe_Destroy_Object(). One of its parameters is the delay time, but I think that the target creature will disappear suddenly instead of playing the disappear animation. So, you might not like it.
You could also draw a trigger around the destination waypoint. Then set inactive the entering creature.
The last option that comes to my mind is to use CommandMoveToMultiLocations() and process the EVENT_TYPE_REACHED_WAYPOINT event.
Modifié par _L_o_B_o_, 07 mars 2011 - 09:11 .





Retour en haut






