Dancing mini game - thoughts - possible?

I had a wild idea of a dance based minigame. I looked at Dark Waters in the Toolset, one of my favourite NWN2 modules, I looked at the conversation and scripts for Lute Hero, but it felt too advanced for me to take on. What I want to do somehow is if it could be somewhat time-based. So here’s a thought: You do it as a conversation, and then you have perhaps 4 alternatives, like step right, step left and so on, or maybe just one alternative, but you need to press the node in time somehow. Is there any way to have a time frame of maybe a second or something to press a node before it continues on? To my knowledge there is no way to continue a blue node if it’s not clicked on by the player…Anyway, I’m just brain storming here. Maybe someone clever has any ideas how one could do this?

1 Like

Absolutely no idea but if you’re going to do that then have a whole load of lights set up around the place that are off and when the dancing starts turn them on, you can make them all different colours and flash at different rates with the light settings.

You can set a 1 second time of a node on a random npc using a 1 second lipflapper or sound but that’s not the node the pc presses. I think you’re right that if you want things to be selectable ( blue node ) you’re in trouble because the player has as much time as they want to decide.

You could possibly have someone tell the pc how to do a dance then get them to try and remember it a bit later with a list of options ( left, right, turn, right, left, bow etc ) and play the result.

1 Like

Yeah, maybe that’s the way to go but…It would have been really cool if one could do some sort of Quicktime events that have been used in many games.

The only way to do it is probably get an npc to dance instead, have a companion that comments on how they can dance just as well as the people in the tavern and say “go on then,” skip the player nodes and make them copy a dancer. Only thing is you’ll have to get the timing of the animations right within the time limit.

I thought before about making a ridiculous disco tavern with all sorts of lighting effects just to shock the players but never got around to it or worked out how to fit it in somewhere.

But then you won’t be able to choose what the companion does…or? I mean then it would be automatic in some sense, and that is no fun, I think.

I guess some semi-transparent UI with four clickable buttons called right after the conversation could work. I am not sure you can make the buttons active for a specific duration, but maybe a recursive script displaying the step to perform (forward, right, etc…) could at least count how many of each moves were expected, and the UI would count how many times each button (and probably in which order, through a string for instance) was pressed.

Then compare the string from the UI (xml file) to the one from the recursive script. Clicking at the same moment as the instruction appears on the screen would not be different from a delayed click, but the order would still tell how many steps were performed correctly.

You could even make the duration between instructions smaller and smaller, with a float var decreasing in the recursive script (this var being the delay before calling it again). Don’t forget to end the loop when the dance is over.

1 Like

Unfortunately there are only a limited number of dance animations available. Possibly more can be added through Maximo ports.

@4760 Well, this involves creating an xml file (which is to be expected, I guess) and to make such a script…well, it seems a bit beyond me. I was thiniking of using your new dance animation for this.

I think I’ll use another solution for this. It’s not as neat as doing a Quicktime event but I think it will be ok, and much simpler.

Actually that reminds me I did something like that a long while ago in my very first module of my very first campaign :wink:

A female player can take part in a dance competion(a male player would do some boxing). Depending on her dexterity she can pass the first trial (a quite conventional dance with another female) and get to a more sexy solo dance. During the first trial she may collapse if not dexterous enough.

// dance player + linda // player collapses if dex low and bad luck

#include "ginc_param_const"

void main()
{
	object oPC = GetFirstPC();
	object oLinda = GetObjectByTag("c_Linda");
	int nDex = GetAbilityScore(oPC, ABILITY_DEXTERITY);
	
	SetLocalInt(oLinda, "Dance", 2);
	AssignCommand(oPC, ActionPauseConversation());
	AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_DANCE01, 1.0f, 5.0f));
	AssignCommand(oLinda, ActionPlayAnimation(ANIMATION_LOOPING_DANCE01, 1.0f, 10.0f));
	
	if ((nDex<14) && (Random((nDex-4)/2)==0))
	   {SetLocalInt(oLinda, "Dance", 1);
	    AssignCommand(oPC, ActionPlayAnimation(ANIMATION_FIREFORGET_COLLAPSE,1.0f, 2.0f));
		AssignCommand(oPC, ActionPlayAnimation(ANIMATION_FIREFORGET_STANDUP, 1.0f, 2.0f));
		SoundObjectPlay(GetSoundObjectByTag("TauntsCommonerGroup"));}
	else
	   {AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_DANCE01, 1.0f, 5.0f));
	    SoundObjectPlay(GetSoundObjectByTag("TavernClaps"));}
			 
	
	AssignCommand(oPC, ActionPlayAnimation(ANIMATION_FIREFORGET_SALUTE, 1.0f, 2.0f));
	AssignCommand(oLinda, ActionPlayAnimation(ANIMATION_FIREFORGET_SALUTE, 1.0f, 2.0f));
	
	AssignCommand(oPC, ActionResumeConversation());
}

Note the very important ActionPauseConversation and ActionResumeConservation that pauses and resumes the embedding conversation.

If she has performed well, she tries the solo dance. With a very high dex, she performs more difficult figures.

// dance player solo

void main()
{
	object oPC = GetFirstPC();

	int nDex = GetAbilityScore(oPC, ABILITY_DEXTERITY);
	
	AssignCommand(oPC, ActionPauseConversation());
	AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_DANCE02, 1.2f, 5.0f));
    AssignCommand(oPC, ActionPlayAnimation(ANIMATION_FIREFORGET_HEAD_TURN_LEFT, 1.0f, 0.2f));
    AssignCommand(oPC, ActionPlayAnimation(ANIMATION_FIREFORGET_HEAD_TURN_RIGHT, 1.0f, 0.2f));
	
	if (nDex>15)
	   {AssignCommand(oPC, ActionPlayAnimation(ANIMATION_FIREFORGET_LAYDOWN, 1.4f, 0.6f));	 
		AssignCommand(oPC, ActionPlayAnimation(ANIMATION_FIREFORGET_STANDUP, 1.4f, 0.6f));
		AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_DANCE02, 1.4f, 5.0f));}
	else AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_DANCE02, 1.2f, 5.0f));
	
	AssignCommand(oPC, ActionPlayAnimation(ANIMATION_FIREFORGET_SALUTE, 1.0f, 2.0f));
	
	AssignCommand(oPC, ActionResumeConversation());
}

There are 3 standard dancing animations if I remember correcly, you may play with the 3 and add other animations (as shown above) to make a composition …

Hope it helps.

2 Likes

Thanks for your input, @Claudius33! I will be using a new dance animation by 4760 for this. I think I actually understand your script, but still, I think I’ll do it my way. The way I thought to do it is: the NPC gives the PC instructions of how to move. However, I won’t display that in the conversation. Then the dance starts and you as a player will have to guess which step to take. Each time you get a step correctly the NPC will point that out. So you’ll go through the whole thing a few times and try to remember the sequence. It’s kind of like what they do in adventure games when you are to step on certain plates (or what’s the word) to get through a hallway full of traps. You learn the correct sequence by trial and error.

1 Like

:grin:
Two more in progress…

Yep, I just need to fix the scaling issue while importing the fbx and the belly dance will be available!

2 Likes

@4760 You made a new dance animation? I also heard somewhere on here about a kissing animation. Would you be willing to share them? Would love some more stuff to work with? Maybe I will make a post on the topic…

The kissing animation is somewhat already available if you download and play my module A Strange World III. I think though that 4760 will release all these as a pack later on, but you’ll have to ask him (which you already have, of course).

1 Like

Sure.

As andgalf said…
I don’t know when though, I’m still working on the belly dance animation.

1 Like

And now, when I finally have something I’m happy with, it seems like the conversation (at least that’s my theisis) is messing with the animation and corrupting it at times. I believe @Lance_Botelle had a thread about this kind of behaviour.

In my own module everything looks fine at first, but then when I break the animation and teleport back the characters to two waypoints facing each other, and then the characters begin dancing again, the animation gets wonky. When I tested it in another module the dancing animation got wonky right away. I have a hunch that this may have to do with the dialogue trying to fix how the characters face each other, or something like that.

I found a solution for this (as it involves slight modifications on the scripts and conversations, and I don’t want to spoil everyone else about your next module :wink:, I sent you the results by PM).

1 Like

Thanks, 4760! I’m eagerly awaiting what you’re gonna send me. It will be interesting to see how you solved it.

EDIT: After a few hiccups, 4760 managed to solve it! Now everything works as it should!