Aller au contenu

Photo

x2_am_sp_barmaid ??


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

#1
Groove Widdit

Groove Widdit
  • Members
  • 391 messages
Can anyone help me with x2_am_sp_barmaid on spawn script? I put in on spawn and the barmaid wipes the floor a couple times, then walks over to the corner and stops. I think sh'e's supposed to walk waypoints, but I have no idea how to do it. Thankzx, george.

#2
meaglyn

meaglyn
  • Members
  • 817 messages
I don't have the original x2_am scripts in front of me. But I've spent some time with the reworked
version by Nereng (http://nwvault.ign.c....Detail&id=2433).

The barmaid is not generally setup with regular waypoints. She may have a post and night one.
The post in the bar and the night at her house so she can go get some sleep after serving all
those driinks.

The barmaid job relies on there being a bartender and at least one patron in the bar for her to
start conversations with. The conversation file is important as it really drives the barmaid. Without
that she won't do much.

I think you also need the x2_am_heart and possibly userdefined scripts on the barmaid.

This barmaid script will talk to patrons (PC and NPCs) and actually provide them drinks and take money from them. It's pretty cool when it's all working but it has a high setup cost.

This one is a lot simpler to setup and is driven mostly by the barmaid herself:
http://nwvault.ign.c...Detail&id=2266.

#3
Groove Widdit

Groove Widdit
  • Members
  • 391 messages
Okay thanks. She actually did try to talk to one of the bar patrons. It looked good until she just stalled.

#4
Knight_Shield

Knight_Shield
  • Members
  • 444 messages
Here is the barmaid script I use.

//////////////////////////////////////////////
// XE-Ryder KoJ's NPC Barmaid OnUserDefined //
//////////////////////////////////////////////
/* This script has evolved over time and been greatly revised.
Proper credit goes to David Gaider for the idea and original,
then we have to credit Adam Miller for working it a bit better.
This is where I got it and customized it quite a bit further. If
someone else had a hand in this I am unawares, I pass it to you,
the reader to enjoy.

Place this in the OnUserDefined event of your barmaid and I
suggest slowing her movement down a bit so they'll saunter around
the tavern instead of power-walking! Set the nRandom number to the
number of NPC's in the bar. Place a waypoint at the bar
with tag WP_BAR and a Bartender with tag BARTEND close enough to
give her the drinks. Place a waypoint where she should rest with
tag WP_REST and a Cook with tag COOK close enough for her to confide
in. While on her break you can make her face any way you like by entering
it, look for the comment below. DIRECTION_WEST is the default.

Make sure your NPC's have voicesets and they will speak once in awhile.
Enter the direction to face while resting where indicated below so they
don't look into a wall while on break. Follow tuning notes and comments
below to get it working very easily. Don't forget to cut the OnSpawn
script off the bottom and place in the OnSpawn event! Enjoy! XE :-) */
void main()
{
// If no one is about - Exit to save CPU!
if (GetAILevel() == AI_LEVEL_VERY_LOW) return;
int nUser = GetUserDefinedEventNumber();
object oCustomer = GetLocalObject(OBJECT_SELF, "CUSTOMER");

int nRandom = Random(8); // Set this to the approx number of NPC's in the room
object oBar = GetWaypointByTag("WP_BAR"); // Place this waypoint where she gets drinks from
object oRest = GetWaypointByTag("WP_REST"); // Place this waypoint where she returns to rest
object oCook = GetObjectByTag("COOK"); // Place an NPC Cook in the kitchen with this tag
object oBartend = GetObjectByTag("BARTEND");// Place an NPC Bartender at bar with this tag
if (nUser == 1001) // OnHeartbeat event
{
if (!GetIsObjectValid(oCustomer) && GetLocalInt(OBJECT_SELF, "BARMAID_STATE") < 1)
{ //Valid customer and state
oCustomer = GetNearestCreature (CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_NOT_PC, OBJECT_SELF, nRandom);
if (oCustomer != oCook && oCustomer != oBartend && oCustomer != OBJECT_SELF && GetIsObjectValid(oCustomer))
{ //Customer is not cook, bartend or self & is valid
SetLocalInt (OBJECT_SELF, "BARMAID_STATE", 1);
SetLocalObject (OBJECT_SELF, "CUSTOMER", oCustomer);
ActionMoveToObject(oCustomer);
switch(Random(4))
{
case 0: ActionSpeakString ("Can I get you something?");
ActionDoCommand(PlayVoiceChat(VOICE_CHAT_YES,oCustomer)); break;
case 1: ActionSpeakString ("What would you like?"); break;
case 2: ActionSpeakString ("How are we doing over here?"); break;
case 3: ActionSpeakString ("Another round?");
ActionDoCommand(PlayVoiceChat(VOICE_CHAT_GOODIDEA,oCustomer)); break;
}
ActionWait(5.0); //Wait, then order drinks from bar
ActionDoCommand (SetLocalInt(OBJECT_SELF, "BARMAID_STATE", 2));
ActionMoveToObject(oBar);
switch(Random(4))
{
case 0: ActionSpeakString ("I need two ales and a bottle of mead.");
ActionDoCommand(PlayVoiceChat(VOICE_CHAT_CANDO,oCook)); break;
case 1: ActionSpeakString ("Two whiskeys with a water back please."); break;
case 2: ActionSpeakString ("They want a pitcher of ale and a loaf of bread");
ActionDoCommand(PlayVoiceChat(VOICE_CHAT_CANTDO,oCook)); break;
case 3: ActionSpeakString ("A bottle of wine and two glasses then.");
ActionDoCommand(PlayVoiceChat(VOICE_CHAT_TASKCOMPLETE,oCook)); break;
}
ActionWait(8.0); //Wait, then deliver the drinks
ActionDoCommand (SetLocalInt(OBJECT_SELF, "BARMAID_STATE", 3));
ActionMoveToObject(oCustomer);
switch(Random(4))
{
case 0: ActionSpeakString ("Enjoy this friend."); break;
case 1: ActionSpeakString ("That'll be 5 platinum. I'm just kidding. 15 electrum, please.");
ActionDoCommand(PlayVoiceChat(VOICE_CHAT_LAUGH,oCustomer)); break;
case 2: ActionSpeakString ("You look like you could use this."); break;
case 3: ActionSpeakString ("Ice brewed in the Frigid North, friend. Enjoy.");
ActionDoCommand(PlayVoiceChat(VOICE_CHAT_THANKS,oCustomer)); break;
}
ActionWait(3.0); // Wait, then back to bar to take a break
ActionDoCommand (SetLocalObject(OBJECT_SELF, "CUSTOMER", OBJECT_INVALID));
ActionMoveToObject(oRest);
//Enter the direction for her to face while on break or comment line below out!
DelayCommand(4.0,AssignCommand(OBJECT_SELF,SetFacing(DIRECTION_WEST)));
ActionWait(5.0);
switch(Random(4))
{
case 0: ActionSpeakString ("Slow night tonight, eh Thallin?");
ActionDoCommand(PlayVoiceChat(VOICE_CHAT_YES,oBartend)); break;
case 1: ActionSpeakString ("My feet are killing me."); break;
case 2: ActionSpeakString ("Well they sure tip well here."); break;
case 3: ActionSpeakString ("Look at that tender morsel!");
ActionDoCommand(PlayVoiceChat(VOICE_CHAT_LAUGH,oBartend)); break;
}
ActionWait(5.0);//Wait then reset our variable for next go around
ActionDoCommand (SetLocalInt(OBJECT_SELF, "BARMAID_STATE", 0));
}
}
}
if (nUser == 1004) // OnDialogue event so you can talk to them.
{
SetLocalObject (OBJECT_SELF, "CUSTOMER", OBJECT_INVALID);
SetLocalInt (OBJECT_SELF, "BARMAID_STATE", 0);
}
}

*******************************************************************

////////////////////////////////////////
// XE-Ryder KoJ's NPC Barmaid OnSpawn //
////////////////////////////////////////
/* This script has evolved over time and been greatly revised.
Proper credit goes to David Gaider for the idea and original,
then we have to credit Adam Miller for working it a bit better.
This is where I got it and customized it quite a bit further. If
someone else had a hand in this I am unawares, I pass it to you,
the reader to enjoy.

You do not have to use this code for the OnSpawn handler so long
as the script you DO use in this event has the Hearbeat and OnDialogue
events uncommented. WalkWayPoints() is optional and if you place numbered
waypoints it may cause the barmaid to behave a bit odd. Enjoy! XE :-) */
#include "NW_I0_GENERIC"
void main()
{
SetSpawnInCondition(NW_FLAG_HEARTBEAT_EVENT);
SetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT);
SetListeningPatterns();
//WalkWayPoints();
}

#5
Groove Widdit

Groove Widdit
  • Members
  • 391 messages
Cool, thanks!

#6
Groove Widdit

Groove Widdit
  • Members
  • 391 messages
It works great! My bar is awesome now.

#7
meaglyn

meaglyn
  • Members
  • 817 messages
That's the same one I pointed to in my post. It's a lot easier to get working right isn't it :)

#8
Groove Widdit

Groove Widdit
  • Members
  • 391 messages
Yeah, pretty much plug & play.