Aller au contenu

Photo

Double question


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

#1
Who said that I

Who said that I
  • Members
  • 492 messages

Okay I got two questions

 

1) 

Is it possible to make a NPC stand still or cower while a hostile creature is around?

 

Basically I am recreating the episode "nightmares" from buffy the vampire slayer and just figured that it would not be very logical if the NPC is fighting when it is supposed to be scared.

 

2)

I have an spawn on conversation for this quest but I do not get the summon creature VFX for the summoning, it just spawns the spider.

 

#include "nw_i0_plotwizard"
#include "pqj_inc"
void main()
{
    // Set the variables
    SetLocalInt(GetPCSpeaker(), "p003state", 100);
// Get the PC who is in this conversation.
    object oPC = GetPCSpeaker();
 
    // Update the player's journal.
    AddPersistentJournalQuestEntry("p003", 1, oPC, FALSE);
 
    {
    effect eVFX;
    object oTarget;
    object oSpawn;
 
    // Spawn "zep_mspiderm016".
    oTarget = GetWaypointByTag("WP_ARACHNID");
    oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "zep_mspiderm016", GetLocation(oTarget));
 
    // Apply a visual effect.
    eVFX = EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_3);
    ApplyEffectToObject(DURATION_TYPE_INSTANT, eVFX, oSpawn);
}
}
 

 

Can anyone tell me how to fix this?

 



#2
Baaleos

Baaleos
  • Members
  • 1 322 messages


http://www.nwnlexico...etBehaviorState

This might allow you to make the npcs into cowards - as for making them immobile - you would have to paralyze them or Immobilize them with Cutscene paralysis / immobilize.

You could also repeatedly make the npc play the animation : ANIMATION_LOOPING_TALK_PLEADING   Which will kinda look like a begging animation (while standing)

 

As for your second question:

 

I don't think you need the braces around the effect/spawning bit.

However I think the reason for your effect not playing, is perception based.

 

When a creature is spawned, there is a small delay during which they are not perceived yet by the player.

If they are not perceived, how will the player be able to see any effects playing on the npc, if the npc itself is invisible at this time.

 

To solve this:

Play the vfx at the location of the npc instead. This way, your perception of the vfx is not tied to the creature itself.

ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVFX, GetLocation(oSpawn));

  • Who said that I aime ceci

#3
Who said that I

Who said that I
  • Members
  • 492 messages

 

This might allow you to make the npcs into cowards - as for making them immobile - you would have to paralyze them or Immobilize them with Cutscene paralysis / immobilize.

You could also repeatedly make the npc play the animation : ANIMATION_LOOPING_TALK_PLEADING   Which will kinda look like a begging animation (while standing)

 

As for your second question:

 

I don't think you need the braces around the effect/spawning bit.

However I think the reason for your effect not playing, is perception based.

 

When a creature is spawned, there is a small delay during which they are not perceived yet by the player.

If they are not perceived, how will the player be able to see any effects playing on the npc, if the npc itself is invisible at this time.

 

To solve this:

Play the vfx at the location of the npc instead. This way, your perception of the vfx is not tied to the creature itself.

ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVFX, GetLocation(oSpawn));

thanks bu I just fixed the second question on my own but thanks anyway and yay will check it out thanks! :D



#4
Who said that I

Who said that I
  • Members
  • 492 messages

okay am reading this but I am a bit confused by the link you send me Baaleos....



#5
Who said that I

Who said that I
  • Members
  • 492 messages

at the moment made my own little way around it, making the NPC paralyzed for the duration of the fight (paralyzed of fear mwuahaha) 



#6
Baaleos

Baaleos
  • Members
  • 1 322 messages

Sorry 

NW_FLAG_BEHAVIOR_HERBIVORE 0x00000008

Will never attack. Will alway flee.

 

 

 

 

 

This behavior state when used on an NPC will make them flee, but never attack.

Eg: Like rabbits, or Deer etc

Basically, you could use it to ensure that the NPC never attempts to strike the creature/monster.


  • Who said that I aime ceci

#7
Who said that I

Who said that I
  • Members
  • 492 messages

okay now it worked at first but then I added the persistence of the quest and then summoning of the hostile creature and now it does not work anymore.

 

#include "nw_i0_plotwizard"
#include "pqj_inc"
void main()
{
    // Set the variables
    SetLocalInt(GetPCSpeaker(), "p003state", 100);
// Get the PC who is in this conversation.
    object oPC = GetPCSpeaker();
 
    // Update the player's journal.
    AddPersistentJournalQuestEntry("p003", 1, oPC, FALSE);
 
 
effect eEffect;
    object oSelf = OBJECT_SELF;
    object oTarget;
    object oSpawn;
    effect eVFX;
 
 
    // Apply an effect.
    eEffect = EffectParalyze();
    ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEffect, oSelf, 50.0);
 
    // Spawn "zep_mspiderm016".
    eVFX = EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_1);
    oTarget = GetWaypointByTag("WP_ARACHNID");
    oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "zep_mspiderm016", GetLocation(oTarget));
    DelayCommand(0.5, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVFX, oSpawn));
 
}
 

 

 

Can anyone help me with this?



#8
Who said that I

Who said that I
  • Members
  • 492 messages

Sorry 

NW_FLAG_BEHAVIOR_HERBIVORE 0x00000008

Will never attack. Will alway flee.

 

 

 

 

 

This behavior state when used on an NPC will make them flee, but never attack.

Eg: Like rabbits, or Deer etc

Basically, you could use it to ensure that the NPC never attempts to strike the creature/monster.

great will check this out :) 



#9
Who said that I

Who said that I
  • Members
  • 492 messages

okay it worked like a charm! Now I just need to get the NPC to return to its original spot after the fight but I think a Waypoint could easily fix that :) 



#10
Baaleos

Baaleos
  • Members
  • 1 322 messages

If it is dynamic at all - you can also store the location information on the NPC itself.

 

Eg:

SetLocalLocation(oNPC,"START_LOCATION",lLoc);

 

 

You could have the creature run a script on Spawn to capture the location: lLoc

 

 

Eg:

 

onSpawn:

location lLoc = GetLocation(OBJECT_SELF);

SetLocalLocation(OBJECT_SELF,"Start_Location",lLoc);

 

 

Then when you need him to return to the start:

 

 

location lLoc = GetLocalLocation(oNPC,"Start_Location");

AssignCommand(oNPC,JumpToLocation(lLoc));  < - To teleport him there, or you can have him walk if you want.



#11
Proleric

Proleric
  • Members
  • 2 345 messages
A POST waypoint will do that automatically.

Fleeing combat trumps walkwaypoints, so NPC should only return when threat removed.
  • Who said that I aime ceci

#12
Who said that I

Who said that I
  • Members
  • 492 messages

A POST waypoint will do that automatically.

Fleeing combat trumps walkwaypoints, so NPC should only return when threat removed.

yeah I tested that and it works like a charm! Thanks everyone for your help, you guys are the best! :D:D