Aller au contenu

Photo

A check Party Size script


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

#1
kamal_

kamal_
  • Members
  • 5 238 messages

A modification of the kc_room_in_party script from SoZ, it allows you to check for specific party sizes. Most useful I guess for detecting if someone is trying to solo or not so you can have them say I/we appropriately. Replace the == with >= and you can detect if the party is above a given size.

//check if party is a given size. Useful for conversations so the player can say I/we appropriately.

int StartingConditional(int nSize)
{
	int nPartySize = 0;

	object oPC = GetFirstPC();
	object oFactionMember = GetFirstFactionMember( oPC, FALSE );
	
	while ( GetIsObjectValid(oFactionMember) )
	{
		if( GetIsRosterMember(oFactionMember) || GetIsOwnedByPlayer(oFactionMember) )
		{
			if (GetIsDead(oFactionMember)!=TRUE)
			{
			nPartySize++;
			}
		}
		oFactionMember = GetNextFactionMember( oPC, FALSE );
	}

		if (nPartySize == nSize)
		{
		return TRUE;
		}
		else
		{
		return FALSE;
		}

}

  • GCoyote aime ceci

#2
Dann-J

Dann-J
  • Members
  • 3 161 messages

For the singular/plural distinction I'd probably turn it into a GA_ script that sets a custom token. That way you only need the one conversation node. In fact you could define several custom tokens to cover a range of eventualities:

  • I'm / We're not intimidated that easily.
  • Have you been looking for me / us?
  • Who do you think I am / we are ?

Etc.



#3
Dann-J

Dann-J
  • Members
  • 3 161 messages

Here's the custom token script I came up with, inspired by this thread. I'm using it in my current module:

 

Spoiler

 

Here are some example conversation nodes using the system:

  • <CUSTOM101> your worst nightmare.
  • It seems that <CUSTOM102> late.
  • <CUSTOM103> not amused.
  • Do you know who <CUSTOM104>?
  • <CUSTOM105> in the right place?
  • Where <CUSTOM106>?
  • <CUSTOM107>'ll be going now.
  • Where can <CUSTOM108> find a merchant?
  • <CUSTOM109>? What have <CUSTOM108> done?
  • Are you looking for <CUSTOM110>?
  • <CUSTOM111> patience is wearing thin.
  • Get yours hands off <CUSTOM112> treasure.
  • <CUSTOM113> is a vengeance best avoided.
  • What's <CUSTOM114> is yours.
  • <CUSTOM107>'ll do it <CUSTOM116>.


#4
kamal_

kamal_
  • Members
  • 5 238 messages

 

Here's the custom token script I came up with, inspired by this thread. I'm using it in my current module:

 

Spoiler

 

It seems the tokens are global, so one would only need to include that stuff in the module load. Is that correct? If so that's far superior to my system.



#5
Tchos

Tchos
  • Members
  • 5 030 messages

I might have used a system like this in mine.  I instead settled for the less than optimal approach of always referring to the PC as plural, with the justification that I designed the thing with a party in mind.



#6
Dann-J

Dann-J
  • Members
  • 3 161 messages

I might have used a system like this in mine.  I instead settled for the less than optimal approach of always referring to the PC as plural, with the justification that I designed the thing with a party in mind.

 

I had also made the assumption that the player would always have companions with them, and so used plurals in most cases. However it looked strange when I tested the module with a lone character, and there's always the possibility of people wanting to solo it. Now I've got the best of both worlds; correct singular/plural distinctions without the need to duplicate lots of conversation nodes.

 

 

It seems the tokens are global, so one would only need to include that stuff in the module load. Is that correct? If so that's far superior to my system.

 

The script would need to be included in the first node of any conversation that uses it, to update the singular/plural distinctions to reflect the current party size. It would also need to be called again in any conversation where companions can be added or removed at anything other than an end node.