Aller au contenu

How do I make people dance ?


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

#1
Guest_Iveforgotmypassword_*

Guest_Iveforgotmypassword_*
  • Guests
I've never done anything with NPC's before other than conversations and waypoint walking so I really haven't got a clue how to do this..

What script and where do I put it to make an npc dance permanently as my tavern really needs some go go dancers in it ! It's ready, the rugs are in place and the customers are waiting but the ladies are on strike. I saw this in a module I played but when I was nosing around in the area I couldn't find anything different with the properties of the npc's.

Thank you.

#2
kevL

kevL
  • Members
  • 4 056 messages
Do you remember Joy dancing in the Pheonix Tail Inn at Crossroad Keep? This is what they put in her heartbeat slot:

//31_joy_dance_hb

// Joy dances.

// TDE 9/11/06

void main()
{
// Joy only dances in the Inn
if ( GetTag(GetArea(OBJECT_SELF)) != "2101_ck_inn")
return;
		
if (GetLocalInt(GetModule(),"Stop Ambient Life"))
{
SetFacingPoint(GetPosition(GetObjectByTag("0_wp_players_face")));
return;
}

SetFacingPoint(GetPosition(GetObjectByTag("0_wp_players_face")));
	
int nRandom=Random(2);
if (nRandom==0)
{
PlayCustomAnimation(OBJECT_SELF,"dance02", 1);
}
else 
{
PlayCustomAnimation(OBJECT_SELF,"dance01", 1);
}
}


... i'm tempted to snag a bunch of this Avant-Garde jazz i've been listening to lately; like to see a gal pole dance that

#3
Guest_Iveforgotmypassword_*

Guest_Iveforgotmypassword_*
  • Guests
kevL.. Excellent, I can see what I need to do now but I think I'll go for an on enter script with a few moderations. I think my little ladies will be kept extremely busy from now on. I might even stick in a band to give the dj a rest.

Thank you very much

ps. Shame there aren't any decent pole and mirror placeables !

Modifié par Iveforgotmypassword, 14 janvier 2012 - 04:28 .


#4
Lugaid of the Red Stripes

Lugaid of the Red Stripes
  • Members
  • 955 messages
No pole and mirror, but there are alternatives:

http://social.biowar...t_media_id=7998

#5
kevL

kevL
  • Members
  • 4 056 messages
... the red room ... ( % succubi lava dance % )


right-o,

#6
Guest_Iveforgotmypassword_*

Guest_Iveforgotmypassword_*
  • Guests
Lugaid of the Red Stripes.. Impressive stuff !

#7
Kaldor Silverwand

Kaldor Silverwand
  • Members
  • 1 585 messages
I use an entertainer heartbeat script that allows dancing, singing, and playing the lute, flute, or drum in my Harvest of Chaos: King's Festiuval + Queen's Harvest campaign.

Here is the script:

// bb_entertainer_hb
// by Brendan Bellina
// November, 2008
// Updated March, 2009 to add sing type and ability for musicians and dancers to sing

// Generic entertainer heartbeat script.

// Inspired by entertainer heartbeat scripts from OC 2100_Crossroad_Keep_A2
// 21_flutewoman_hb
// 21_guitarman_hb
// 31_joy_dance_hb

// Set entertainer heartbeat script to this script.
// Set local variable BB_ENTERTAINMENT_TYPE on entertainer to indicate type of entertainment:
// flute
// lute
// dance
// drum
// sing
// Set local int variable BB_ENTERTAINMENT_OFF to 1 to prevent the entertainer from using animations
// Requires waypoint wp_entertainers_face near entertainer
// For flute requires sound object snd_flute_1 near entertainer (play sound Flute)
// For lute requires sound object snd_lute_1 near entertainer (play sound Lute)
// For drum requires sound object snd_drum_1 near entertainer (play sound bb_drum)
// For vocalist requires conversation (see DoCall function comments) (must be barkstrings)
// To have a musician or dancer also sing, just create a conversation 00_bark_tag or
// assign a conversation variable bb_barkConv (see DoCall function comments)
// To stop all entertainers in the module from using animations set the module int variable BB_NO_ENTERTAINMENT to 1

void DoCall(object oSpeaker)
{
// if bb_barkConv is specified then use that
// else if ConversationPrefix is specified use ConversationPrefix + SpeakerTag
// else use "00_bark_" + SpeakerTag
// The reason the NPC's conversation is not used is because it is reserved for
// non-barking.
string sConversation = GetLocalString(oSpeaker, "bb_barkConv");
if (sConversation == "")
{
string sConversationPrefix = GetLocalString(oSpeaker, "ConversationPrefix");
if (sConversationPrefix == "")
sConversationPrefix = "00_bark_";

sConversation = sConversationPrefix + GetTag(oSpeaker);
}
AssignCommand(oSpeaker, SpeakOneLinerConversation(sConversation));
}

void PlayRandomSingingAnimation()
{
ClearAllActions();
int nAnimationType, nAnimation;
float fSpeed = 0.75;
nAnimationType = Random (5) + 1;
switch (nAnimationType)
{
case 1: nAnimation = ANIMATION_FIREFORGET_HEAD_TURN_LEFT; break;
case 2: nAnimation = ANIMATION_FIREFORGET_HEAD_TURN_RIGHT; break;
// * combo, head to the Left, then Head to the Right
case 3: nAnimation = ANIMATION_FIREFORGET_HEAD_TURN_LEFT;
ActionPlayAnimation(nAnimation, 0.75);
nAnimation = ANIMATION_FIREFORGET_HEAD_TURN_RIGHT;
break;
case 4: nAnimation = ANIMATION_LOOPING_LOOKUP; break;
case 5: nAnimation = ANIMATION_LOOPING_LOOKDOWN; break;
}
ActionPlayAnimation(nAnimation, fSpeed);
}

void main()
{
if ( (GetAILevel() < AI_LEVEL_LOW) || (GetArea(OBJECT_SELF) != GetArea(GetFactionLeader(GetFirstPC()))) )
return; // exit if no one around

if (GetLocalInt(GetModule(),"BB_NO_ENTERTAINMENT")) // No entertainment allowed
{
SetFacingPoint(GetPosition(GetNearestObjectByTag("wp_entertainers_face")));
}
else // Entertainment allowed
{
SetFacingPoint(GetPosition(GetNearestObjectByTag("wp_entertainers_face")));

string sEntType = GetLocalString(OBJECT_SELF,"BB_ENTERTAINMENT_TYPE");
int nEntOff = GetLocalInt(OBJECT_SELF,"BB_ENTERTAINMENT_OFF");

if (sEntType != "" && sEntType != "NONE" && !nEntOff) // Do animation unless none specified or temporarily off
{
DoCall(OBJECT_SELF); // sing a song

// Do Entertainment animation
if (sEntType == "flute" || sEntType == "lute" || sEntType == "drum")
{
int nRandom=Random(10);
if (nRandom==0)
{
if (sEntType == "flute")
{
PlayCustomAnimation(OBJECT_SELF,"idlefidgetflute", 1);
SoundObjectStop(GetNearestObjectByTag("snd_flute_1"));
}
else if (sEntType == "lute")
{
PlayCustomAnimation(OBJECT_SELF,"idlefidgetguitar", 1);
SoundObjectStop(GetNearestObjectByTag("snd_lute_1"));
}
else // if (sEntType == "drum")
{
PlayCustomAnimation(OBJECT_SELF,"idlefidgetdrum", 1);
SoundObjectStop(GetNearestObjectByTag("snd_drum_1"));
}
}
else
{
if (sEntType == "flute")
{
if (nRandom==1)
{
PlayCustomAnimation(OBJECT_SELF,"idleflute", 1);
SoundObjectStop(GetNearestObjectByTag("snd_flute_1"));
}
else
{
PlayCustomAnimation(OBJECT_SELF,"playflute", 1);
SoundObjectPlay(GetNearestObjectByTag("snd_flute_1"));
}
}
else if (sEntType == "lute")
{
if (nRandom==1)
{
PlayCustomAnimation(OBJECT_SELF,"idleguitar", 1);
SoundObjectStop(GetNearestObjectByTag("snd_lute_1"));
}
else
{
PlayCustomAnimation(OBJECT_SELF,"playguitar", 1);
SoundObjectPlay(GetNearestObjectByTag("snd_lute_1"));
}
}
else // if (sEntType == "drum")
{
if (nRandom==1)
{
PlayCustomAnimation(OBJECT_SELF,"idledrum", 1);
SoundObjectStop(GetNearestObjectByTag("snd_drum_1"));
}
else
{
PlayCustomAnimation(OBJECT_SELF,"playdrum", 1);
SoundObjectPlay(GetNearestObjectByTag("snd_drum_1"));
}
}
}
} // end if (sEntType == "flute" || sEntType == "lute" || sEntType == "drum")
else if (sEntType == "dance")
{
SetFacingPoint(GetPosition(GetNearestObjectByTag("wp_entertainers_face")));

int nRandom=Random(3);
if (nRandom == 0)
{
PlayCustomAnimation(OBJECT_SELF,"dance01", 1);
}
else if (nRandom == 1)
{
PlayCustomAnimation(OBJECT_SELF,"dance02", 1);
}
else
{
PlayCustomAnimation(OBJECT_SELF,"dance03", 1);
}

} // end if (sEntType == "dance")
else if (sEntType == "sing")
{
if (Random(5) == 1)
PlayRandomSingingAnimation();
} // end if (sEntType == "sing")
}
}
return;
}

#8
Arkalezth

Arkalezth
  • Members
  • 3 188 messages
Give them some drinks.

(Sorry, I had to say it :D ).

#9
Guest_Iveforgotmypassword_*

Guest_Iveforgotmypassword_*
  • Guests
Kaldor Silverwand..Thank you very much I'm going to copy and paste this and investigate it at my leisure in a separate test area, there is so much going on in it I'm confused but I can see this becoming a permanent script and my taverns getting more lively many thanks indeed..

I wonder if you know anything about this..

I stuck in a few bards and gave them instruments the only thing is they do the actions but the instruments are gone. Now I do realise that there are quite a few scantily clad women jiggling about but I'd rather they didn't play with themselves it's really not good for businesss ! One thing I noticed was that your PlayCustomAnimation doesn't use capitals for the type of animation used, mine does is this the cause ? Also I put in an extra bit on the end as it says there's one in the script section.

Mine look like.. Play CustomAnimation(oTarget,"PLAYLUTE",TRUE,1.0). Is this the cause or is it something far more sinister and is there something I have to do to get them to retain their instruments ?

Thank you... Tsongo.

#10
PJ156

PJ156
  • Members
  • 2 982 messages
I understand you may want to to this your own way Tsongo but I used Uncle FB's scripts for this.


My inn's are lively at night with music and dancing. By day the musicians and dancers are in the market chatting or sleeping. If you use his guard scripts for the dancers and play with the code I imagine you could also have your dancers change from night to day clothes (just in case semin nudity looks out of place in your market square :)

PJ

Modifié par PJ156, 15 janvier 2012 - 11:13 .


#11
Guest_Iveforgotmypassword_*

Guest_Iveforgotmypassword_*
  • Guests
PJ156.. Thanks for the tip about the scripts I'll have a look and see if I can add the odd bit of reality here and there ( blacksmiths hammering etc). But I really don't think I can manage all the time changes etc as this is in a city and I'd just get bogged down in detail. I'm itching to get on with the plot but have already created 3 side quests in the same area ( they just sort of happened ).and have to deal with them before it's too late to save back tracking.

The one thing that is bugging me is that the bards don't hold their instruments and if they refuse for too long they will be sacked. Is this a known issue or can it be fixed ?

It's really quite interesting putting life into places and I can see the fascination perhaps I'll have a go in a village later but I don't really want to jump in at the deep end just yet.

Thank you..

ps.don't worry about scantily clad women in the market they're staying in the bar as it's a 24 hour place of "entertainment" and even my hookers look quite tame then again it is only springtime perhaps a return in summer could see a liberalisation of attitudes ;)

#12
kamal_

kamal_
  • Members
  • 5 240 messages
I believe the console command is /dancemonkeyboy  :P

#13
PJ156

PJ156
  • Members
  • 2 982 messages

Iveforgotmypassword wrote...

I'm itching to get on with the plot but have already created 3 side quests in the same area ( they just sort of happened ).


I know that sooo well :)

PJ

#14
PJ156

PJ156
  • Members
  • 2 982 messages
Also it's not all or nothing. You can have a dancer or musician stay in the same room all day. They will stay in one place if you put all of the waypoints in one place or move around as you wish. Dancing or playing to suit. the whole city does not have to use the script, just the dancers if thats all you want.

PJ

#15
Guest_Iveforgotmypassword_*

Guest_Iveforgotmypassword_*
  • Guests
PJ156.. That's what I think I might do just put in the odd bit here and there do you just stick it in the on heartbeat bit as I've never used that before ? The dancers are permanent features in one of the taverns and they don't really roam around either they just dance with each other, they might do a runner if all hell breaks loose but so far I haven't got plans for a bar fight.. But you never know.

So far I've been trying equipping instruments in different hands and changing the Play Custom Animation commands for the bards but their careers are looking doomed at the moment unless they can play their instruments properly.

kamal.. Funny you should say that as Tsongo actually means monkey in filipino ( but with 2 g's ) a name I got stuck with due to a long time spent banana farming and coconut trees.

#16
Guest_Iveforgotmypassword_*

Guest_Iveforgotmypassword_*
  • Guests
It was the musicians union ! They weren't bards !

They can keep their jobs now, but any more misbehaving and they'll be out on the streets to ply their trade !.

#17
The Fred

The Fred
  • Members
  • 2 516 messages

Arkalezth wrote...

Give them some drinks.

(Sorry, I had to say it :D ).

Shoot at their feet?

#18
PJ156

PJ156
  • Members
  • 2 982 messages
It's easier than that. When you load up npc_control you get a set of bluprint with all the scripts attached and a set of waypoints.

So you grab the blueprint bard001 and place it in you area. Change the name to bardXXX (you make up the XXX) Pull in each of the six waypoints and renumber them to XXX matching your bard (just change the number). You can customise your bard to look as you want to.

Check the bards scripts you will see that the variables are allows a series of options. in simple terms you need to put the right number under wake, Act 1, Act2, dinner, sleep and midnight. Play flute is 14 for instance.

Then you are done. Put the waypoints where you want your man to play.

Only thing with instruments is you cant go from one to another without a break. so act1 your man can drum and act2 but if you want to drum in act1 then switch to flute you need to have him do something else for the next act then switch to flute.

Be careful to give each a discrete number if you start mixing up waypoint and npc numbers things get odd. Happened to me in Caravan Club that a cow kept appearing in the bar in the evening. I have a pick somewhere :)

PJ

#19
Guest_Iveforgotmypassword_*

Guest_Iveforgotmypassword_*
  • Guests
PJ156.. I'm definitely going to look into this even just for having more people about in the day time which has always bothered me, I might even bring in a vampire that appears at night.. Oh dear here we go again !

Thanks for all the help..

#20
PJ156

PJ156
  • Members
  • 2 982 messages
Have a care with using the 0 (script hidden function) it's a bit flaky and the npc does not always show up for work. if it's an ambient then that is no issue but if they are plot then use area transistions to send them to a holding area. That is far more stable.

PJ

#21
Dann-J

Dann-J
  • Members
  • 3 161 messages

PJ156 wrote...

Be careful to give each a discrete number if you start mixing up waypoint and npc numbers things get odd. Happened to me in Caravan Club that a cow kept appearing in the bar in the evening.


It must have belonged to this guy:
http://www.telegraph...d-from-pub.html

Modifié par DannJ, 16 janvier 2012 - 01:56 .


#22
Kaldor Silverwand

Kaldor Silverwand
  • Members
  • 1 585 messages
I use my script in my Harvest of Chaos: King's Festival + Queen's Harvest campaign. I don't have any problem with them holding instruments. They may need a level of bard to do so. I suggest you download my campaign and take a look in the initial area of the first module.

UncleFB's scripts - some of which are based on mine - do more but are a bit more complex. If all you need is someone to stand and perform then my script should be sufficient.

Some advice about animating your city though. Don't go overboard. You can spend an enormous amount of time on it and the reality is that most players are just going to be running through on the way to the next dungeon entrance anyway. Some animation is good but set some reasonable limits on the time you spend on it. Just my 2 cents.

Regards

#23
Guest_Iveforgotmypassword_*

Guest_Iveforgotmypassword_*
  • Guests
Kaldor Silverwand.. You hit the nail on the head they weren't bards at all stubborn little beasts were refusing to play until I trained them. You're right your script is all that I need for a tavern and by taking bits from it I've got it sorted now with a much more basic heartbeat one with just the animations changed for the individual. I think I'm going to get the whole script up and running in a nicer tavern with more civilised entertainment than in my spit and sawdust den of sin but that's later.

Don't worry I wouldn't dream of fully animating a city and would much rather get on with the story but I'm probably going to get a couple of people to roam around at various times just to entertain myself and see how it's done.

PJ156.. Don't worry if they don't show up for work they get sacked no problem and it wont be put on vital people anyway so if something goes wrong nobody notices.

#24
Kaldor Silverwand

Kaldor Silverwand
  • Members
  • 1 585 messages
Happy building. Glad you got it working.