1- How to make waypoints for NPC's but not so frequently like standard. I mean - NPC will be walking through the city by waypoints, but sometimes NPC will be stand for a few seconds in one waypoint, another time will be back to last waypoint, not go forward...
Use scripted waypoints.
/* Use of scripted way points to give the impression that the DM comes from the library and sits behind his desk.
*/
#include "ginc_wp"
#include "ginc_misc"
void main()
{
int iCurrentWP = GetCurrentWaypoint();
string sMessage = "Damn... Lost a book." ;
if (iCurrentWP == 1)
{
PlayCustomAnimation(OBJECT_SELF, "scratchhead", 1);
string sMessage = "I really thought I put it there." ;
ActionSpeakString(sMessage,TALKVOLUME_TALK);
}
if (iCurrentWP == 2)
{
sMessage = "Unless I left it in the drawer?";
FaceAndPause(iCurrentWP, 3.0); // 3 s before next action
PlayCustomAnimation(OBJECT_SELF, "meditate", 1);
ActionSpeakString(sMessage,TALKVOLUME_TALK);
}
if (iCurrentWP == 3)
{
sMessage = "Ah, yes, I remember: I definitely put it back in the library.";
FaceAndPause(iCurrentWP, 2.0); // stay put 2 s
ActionSpeakString(sMessage,TALKVOLUME_TALK);
SetNextWaypoint(1); // go back to first WP
}
}
2 - Also with NPC - i need some talks like NPC#1 will start talking random phrases (only text above his head, not conversation with PC answers) to another NPC and then that another NPC will respond some random text (also above his head). Like "Good Day sir" and answer "Have a nice day madame".
Run a script to display random barkstrings from their heartbeat script.
Here's one I made for example:
void main()
{
// do nothing if convo already started...
object oSelf = OBJECT_SELF;
int bConversationEnCours = GetLocalInt(oSelf, "bConversationEnCours");
if (bConversationEnCours == 1)
{
SetOrientOnDialog(oSelf, FALSE); // Prevent turning when spoken to
}
else
{
// lines for NPC
string sMessage;
string sTalker = GetTag(oSelf);
int nRandom = d6(1); // number of possible phrases
int nChance = Random(100 +1); // Roll a random percentage between 1 and 100
// If creature is currently in combat, just do the normal Heartbeat Script and that's it
if(GetIsInCombat(oSelf))
{
ExecuteScript("nw_c2_default1", oSelf);
if(nChance <= 25) // une chance sur quatre de dire quelque chose.
{
int nRand = d3(); // Roll a single 3 sided die and note the result
switch (nRand)
{
case 1:
sMessage = "Take this!";
break;
case 1:
sMessage = "Die, fiend!";
break;
case 1:
sMessage = "I'll get you down!";
break;
}
}
}
else
{
// we don't want the NPC to talk about them!
if (((sTalker == "c_dahlia") && (nRandom == 1))||((sTalker == "c_eldwina") && (nRandom == 2))||((sTalker == "c_rosibella") && (nRandom == 3))||
((sTalker == "c_ar") && (nRandom == 4))||((sTalker == "c_baruc") && (nRandom == 5))||((sTalker == "c_bob") && (nRandom == 6)))
nRandom = (nRandom==6?--nRandom:++nRandom);
// we don't want to run this if a conversation is already in progress
if (GetLocalInt(oSelf,"bConversationEnCours") == 1) return;
if (GetGlobalInt("nLangue") == 1) // français
{
// French part removed for clarity
}
else // anglais
{
switch (nRandom)
{
case 1:
sMessage = "Dahlia would have misplaced her robe ?";
break;
case 2:
sMessage = "Eldwina hates reptiles!";
break;
case 3:
sMessage = "Rosibella only worships Angharrad. I'd like to pray Chauntea as well from time to time.";
break;
case 4:
sMessage = "Ar is a better bluffer than diplomat, but he always succeeds in resolving touchy situations.";
break;
case 5:
sMessage = "It's been a while since Baruc last fought, but he's still a weapon master.";
break;
case 6:
sMessage = "Surprising how Bob, a smith, can craft so many different types of items.";
break;
}
}
}
if ((nChance < 10) && (GetDistanceBetween(GetFirstPC(), oSelf)<5.0f)) ActionSpeakString (sMessage, TALKVOLUME_TALK); // 1 chance out of 10 for a villager to say something.
SetLocalInt(oSelf, "nNumLigne", nRandom);
}
// Execute the default Heartbeat script so the creature does the other stuff it should
ExecuteScript("nw_c2_default1", oSelf);
}