sitting, sleeping and jumping
Moderator: Event DM
- frogmella
- Apprentice Scholar
- Posts: 816
- Joined: Wed Sep 18, 2002 12:35 pm
- Location: London, UK -- GMT
sitting, sleeping and jumping
can any of you experts give me some guidance about the following..
1) SITTING: I've created some placeable seats (cushion, stool etc). I have attached to them the Avlis script 'sitting'. The problem is that the chr always seems to sit doen and face the same direction - no mater how I orient the seat (the green arrow). I want to make sure the chr faces a certain direction.
2) SLEEPING: I'm creating a series of waypoints for an animal. When it gets to one, I want it to sleep - is this possible? (Is there an animation?) And if so, what script?
3) JUMPING: My animal appears to go into a hollow log and out the other end. I think I have to create a waypoint at each end of the log and jump it from one to the other. Is this possible? What would the script look like? And is it possible to build in a dely?
I know I'm asking a lot, but I'm trying to learn and you guys are further down the road.
many thanks
frogs
1) SITTING: I've created some placeable seats (cushion, stool etc). I have attached to them the Avlis script 'sitting'. The problem is that the chr always seems to sit doen and face the same direction - no mater how I orient the seat (the green arrow). I want to make sure the chr faces a certain direction.
2) SLEEPING: I'm creating a series of waypoints for an animal. When it gets to one, I want it to sleep - is this possible? (Is there an animation?) And if so, what script?
3) JUMPING: My animal appears to go into a hollow log and out the other end. I think I have to create a waypoint at each end of the log and jump it from one to the other. Is this possible? What would the script look like? And is it possible to build in a dely?
I know I'm asking a lot, but I'm trying to learn and you guys are further down the road.
many thanks
frogs
I suck but if the NPC animal was to interact with the PC then this delay jump could be used by putting the waypoint at the other end of the log.
Change the NPC_TAG_HERE in code below to the tag of your NPC and place this script in the Action_Taken Event of your NPC's dialog:
NWScript:
// wrapper function for delay jumping
void CustomDelayFunction (object oObject1, location lLocation)
{
// Make Object1 jump to the location
AssignCommand(oObject1,ActionJumpToLocation(lLocation));
// end wrapper function
}
// Begin main function
void main()
{
// Get the tag of the NPC
object oNPC = GetObjectByTag("NPC_TAG_HERE");
// Get the location of the destination waypoint
location lWP_D = GetLocation(GetObjectByTag("WP_TAG_HERE"));
// Delay jump the NPC to the waypoint destination
DelayCommand(1.5,CustomDelayFunction(oNPC, lWP_D));
}
I didnt test this shortend script but I used a much larger version with a NPC that teleports himself and the PC to a waypoint and it worked well.
Hope that helps some but as I said I suck
I'll put the full version of what I used incase it helps out somewhere eles
NWScript:
// wrapper function for delay jumping
void CustomDelayFunction (object oObject1, object oObject2, location lLocation)
{
// Make some effects around PC, NPC, and location
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_3),oObject1);
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_3),oObject2);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_3),lLocation);
// Make Object1 jump to the location
AssignCommand(oObject1,ActionJumpToLocation(lLocation));
// Make Object2 jump to the location
AssignCommand(oObject2,ActionJumpToLocation(lLocation));
// Set Object1 as enemy
SetIsTemporaryEnemy(oObject2,oObject1);
// end wrapper function
}
// Begin main function
void main()
{
// Get the PC that is in conversation
object oPC = GetPCSpeaker();
// Get the tag of the NPC
object oNPC = GetObjectByTag("NPC_TAG_HERE");
// Get the location of the destination waypoint
location lWP_D = GetLocation(GetObjectByTag("WP_TAG_HERE"));
// Have the NPC cast a fake spell - for effect only
AssignCommand(oNPC,ActionCastFakeSpellAtObject(SPELL_DESTRUCTION,oNPC,PROJECTILE_PATH_TYPE_DEFAULT));
// Delay jump the PC and NPC to the waypoint destination
DelayCommand(1.5,CustomDelayFunction(oNPC,oPC,lWP_D));
}
_Wake_
Change the NPC_TAG_HERE in code below to the tag of your NPC and place this script in the Action_Taken Event of your NPC's dialog:
NWScript:
// wrapper function for delay jumping
void CustomDelayFunction (object oObject1, location lLocation)
{
// Make Object1 jump to the location
AssignCommand(oObject1,ActionJumpToLocation(lLocation));
// end wrapper function
}
// Begin main function
void main()
{
// Get the tag of the NPC
object oNPC = GetObjectByTag("NPC_TAG_HERE");
// Get the location of the destination waypoint
location lWP_D = GetLocation(GetObjectByTag("WP_TAG_HERE"));
// Delay jump the NPC to the waypoint destination
DelayCommand(1.5,CustomDelayFunction(oNPC, lWP_D));
}
I didnt test this shortend script but I used a much larger version with a NPC that teleports himself and the PC to a waypoint and it worked well.
Hope that helps some but as I said I suck


NWScript:
// wrapper function for delay jumping
void CustomDelayFunction (object oObject1, object oObject2, location lLocation)
{
// Make some effects around PC, NPC, and location
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_3),oObject1);
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_3),oObject2);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_3),lLocation);
// Make Object1 jump to the location
AssignCommand(oObject1,ActionJumpToLocation(lLocation));
// Make Object2 jump to the location
AssignCommand(oObject2,ActionJumpToLocation(lLocation));
// Set Object1 as enemy
SetIsTemporaryEnemy(oObject2,oObject1);
// end wrapper function
}
// Begin main function
void main()
{
// Get the PC that is in conversation
object oPC = GetPCSpeaker();
// Get the tag of the NPC
object oNPC = GetObjectByTag("NPC_TAG_HERE");
// Get the location of the destination waypoint
location lWP_D = GetLocation(GetObjectByTag("WP_TAG_HERE"));
// Have the NPC cast a fake spell - for effect only
AssignCommand(oNPC,ActionCastFakeSpellAtObject(SPELL_DESTRUCTION,oNPC,PROJECTILE_PATH_TYPE_DEFAULT));
// Delay jump the PC and NPC to the waypoint destination
DelayCommand(1.5,CustomDelayFunction(oNPC,oPC,lWP_D));
}
_Wake_
Re: sitting, sleeping and jumping
This problem is due to the use nodes.. Make sure the USE Node 1 is present.. if it isnt, the PC/NPC will always face northfrogmella wrote:can any of you experts give me some guidance about the following..
1) SITTING: I've created some placeable seats (cushion, stool etc). I have attached to them the Avlis script 'sitting'. The problem is that the chr always seems to sit doen and face the same direction - no mater how I orient the seat (the green arrow). I want to make sure the chr faces a certain direction.
and the PC/NPC, will always face USENODE1 when sitting
- Jordicus
- Team Member; Retired with Honors
- Posts: 8042
- Joined: Tue Jan 21, 2003 3:46 pm
- Location: Whitehall, PA (GMT -4)
- Contact:
sitting: if you are using an invisible object to represent a cushion, then the invisible object MUST be on the ground. flat on the floor. if it raises up at all from the ground level, then the NPC/PC will sit facing north
sleeping:
change the 1000 to whatever duration you want them to lie down for. and change oPC to the appropriate tag/object for the NPC you need. However, I'm not positive what would happen if you assign that animation to an animal. I think it should work, but you'd have to try and find out for sure.
sleeping:
Code: Select all
AssignCommand(oPC, PlayAnimation(ANIMATION_LOOPING_DEAD_FRONT, 1.0f, 1000.0f))
You see things and you say, "Why?" But I dream things that never were and say, "Why not?" George Bernard Shaw
- Jordicus
- Team Member; Retired with Honors
- Posts: 8042
- Joined: Tue Jan 21, 2003 3:46 pm
- Location: Whitehall, PA (GMT -4)
- Contact:
IIRC, USENODE1 and such are all part of the walkmesh properties. you'd probably have to use GMax or something like that so see themfrogmella wrote:@ Gimlor
... where can I find/check on the status of USENODE1? It's not in the properties for my usable seat. Thanks in advance for the help.
f
You see things and you say, "Why?" But I dream things that never were and say, "Why not?" George Bernard Shaw