Aller au contenu

Photo

Trying to Set my Party to Limit 4


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

#1
Alupinu

Alupinu
  • Members
  • 528 messages
I’m trying to set my party size to 4. I found a script that is ‘ga_party_size’. How does this script work? Does this need to be in a conv before the player starts building his party? And is there a conditional_script that goes along with it? Also are there any other alternatives? Thank you.

#2
_Knightmare_

_Knightmare_
  • Members
  • 643 messages
ga_* (and also gc_*) scripts are fired from conversations since for the most part they use the PC speaker.

#3
kamalpoe

kamalpoe
  • Members
  • 711 messages
I've been wondering this as well, since the only gc script for party is gc_is_in_party. I believe ga_party_limit is part of it.

#4
Shallina

Shallina
  • Members
  • 1 011 messages
There is no engine limitation on the number of henchmen, nevers.

You have to script the control by yourself. It's not beceause you set the party limit at 4 that you won't be able to put 5 henchmen in party.

You need to ccheck when a henchmen join if you aren't al ready at your limit.

Modifié par Shallina, 20 juillet 2010 - 11:47 .


#5
kamalpoe

kamalpoe
  • Members
  • 711 messages

Shallina wrote...

There is no engine limitation on the number of henchmen, nevers.

You have to script the control by yourself. It's not beceause you set the party limit at 4 that you won't be able to put 5 henchmen in party.

You need to ccheck when a henchmen join if you aren't al ready at your limit.

not henchies, party members is my interest.

#6
Kaldor Silverwand

Kaldor Silverwand
  • Members
  • 1 585 messages
If you mean player created party members then that restriction is set in the campaign settings.



Regards


#7
Morbane

Morbane
  • Members
  • 1 883 messages
The game defaults to 3 plus the main PC - if you want more you can change it otherwise that is the limit - (In SP)

#8
Alupinu

Alupinu
  • Members
  • 528 messages
I don’t know guy’s I seem to be able to add up to 5 playable NPC’s. (That’s all I have created so far.)

@Silverwand, I tried the settings in the campaign editor and they don’t seem to have any affect. I can still let up to 5 people into my party.


#9
kamalpoe

kamalpoe
  • Members
  • 711 messages
In my campaign, I can get all eight of the companions at once. Never changed anything. No player generated companions in mine.

#10
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages
The setting in the Campaign Editor is only for initial use of the party creation GUI. If you have code that allows more companions to be added, then you must manually check how many are in the party already and either allow or disallow the companion to join. This simple function will return the number of PCs in a faction and can be used to help determine if a companion can join or not:

int PartyNumber(object oPlayer);
int PartyNumber(object oPlayer)
{
int iNumber = 0;
object oFM = GetFirstFactionMember(oPlayer, FALSE);

while(oFM != OBJECT_INVALID)
{
if(GetIsPartyMember(oFM)){iNumber = iNumber + 1;}
oFM = GetNextFactionMember(oPlayer, FALSE);
}

return iNumber;

}


Lance

Modifié par Lance Botelle, 21 juillet 2010 - 02:14 .


#11
Alupinu

Alupinu
  • Members
  • 528 messages
Hey Lance, thanks for the script but unfortunately I was not able to get it to compile. (No Left Bracket on line 9.) Not much of a scripter so I was unable to figure it out. If you could get it to compile(nwn2), we would greatly appreciate it. Thank you.

#12
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

Alupinu wrote...

Hey Lance, thanks for the script but unfortunately I was not able to get it to compile. (No Left Bracket on line 9.) Not much of a scripter so I was unable to figure it out. If you could get it to compile(nwn2), we would greatly appreciate it. Thank you.


Hi Alupinu,

That script was a complete function that I have in an "include" file. If you are not familiar with scripting, then it may not have made sense. Here is how to use it then. Copy and paste all script into a fresh script and save. You will need to fill in the code where required. NB: Includes the ginc_death include as well.:-

#include "ginc_death"

// FUNCTION ABOVE THE MAIN SCRIPT
int PartyNumber(object oPlayer)
{
int iNumber = 0;
object oFM = GetFirstFactionMember(oPlayer, FALSE);
while(oFM != OBJECT_INVALID)
{
if(GetIsPartyMember(oFM)){iNumber = iNumber + 1;}
oFM = GetNextFactionMember(oPlayer, FALSE);
}
return iNumber;
}

// MAIN SCRIPT THAT USES FUNCTION
void main()
{
   object oPlayer = GetFirstPC(FALSE);  // OR HOWEVER ELSE YOU WOULD GET THE PLAYER
   int NumInParty = PartyNumber(oPlayer);
   if(NumInParty > 4)
  {
   // YOUR SCRIPT HERE
  }
  else
  {
   // AND YOUR SCRIPT HERE
   }
}


Lance

Modifié par Lance Botelle, 21 juillet 2010 - 07:43 .


#13
kamalpoe

kamalpoe
  • Members
  • 711 messages
This would be more useful for people as a conditional I think. Trying to work it into one.

#14
Alupinu

Alupinu
  • Members
  • 528 messages
@Lance thanks for posting the script, looks interesting. Unfortunately I won’t need it. I have managed to come up with a work around using the ‘hang_out’ system seems to work pretty well. But thanks again for taking the time to post you help is much appreciated. :)



@Kamapoe, let me know if you’re interested in the way I figure it out. Seems to work.


#15
kamalpoe

kamalpoe
  • Members
  • 711 messages
definitely!

#16
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages
Glad you have it sorted.



What is a "hang out " system?



Lance.

#17
Alupinu

Alupinu
  • Members
  • 528 messages
@Lance, this is a system that I set up that makes it possible to implement npc’s in and out of the party.
 
@Kamalpoe, wasn’t sure how to go about explaining it so I’m just going to give you a list of the scripts I used and what I did with them and we will work from there.

Definition:
Hangout: This is the place where the npc may be found for the pc to add to his party. This spot is marked with a waypoint . You may have as many waypoints as you want for an individual npc as long as there is only one waypoint per module and that all the wp_tags are the same for that one npc hangout.

@Conditional scripts:


*gc_is_in_party* obviously to separate ‘in party’ nodes from ‘out of party’ nods.

*gc_num_comps* this sets the number (size) you want the party to be. Example, I wanted my party to have 3 npc’s so I set the variable to ‘<3’ or up to three. If there are less than 3 party members (npc’s) the conditional is true and the npc will join the party. If party is 3 then the conditional is false and the conv will skip down to the refuse to join the party nod. The variable for this script should be consistent for all your playable npc’s.

*gc_module* this script determines what module the party is in and compares is to set variable (module_tag). I could not figure out how to get the npc to travel between modules on its own so I used this script instead. True and the npc will leave the party. False and the npc will tell the pc to take them back to the mod of their hangout.

@Action:


*ga_rm_set_hangout* this finds the tag of a waypoint that you want the npc to return to when not in the party. This script should be installed just before or just after the ‘npc join party scripts’.

*ga_rm_go_to_hangout* this script kicks the npc out of the party and returns them to their hangout. WARNING: if the pc kicks the npc out of the party in a module that does not have a set hangout, the npc will vanish and no longer be accessible to the player in game. (Use ‘gc_module’)
 
@Now all these script I do believe should be in your toolset if not let me know and I will post them. Any other questions let me know and I will try and answer them as well. Good Luck.Posted Image

Modifié par Alupinu, 23 juillet 2010 - 09:47 .


#18
kamalpoe

kamalpoe
  • Members
  • 711 messages
Holy cow. It's been in there all along then.  gc_num_comps. Getting the companion to travel between modules will be pretty neccessary for me as well.

/Smacks self in head! :o

Modifié par kamalpoe, 23 juillet 2010 - 10:50 .


#19
LeeMer47

LeeMer47
  • Members
  • 111 messages
One of the last things I have to do in HMC2, get the NPC to go back to the hangout. I set the hangout, but forgot to tell him to go there.



There are times in NWN2 OC that you can change NPCs between modules, like the gnome encounter. I added NPCs from a different module as well as dropping some. Maybe the script you are looking for to move an NPC between modules is there.



If not, they are probably using a blueprint of the NPC and changing it to match.

#20
Alupinu

Alupinu
  • Members
  • 528 messages
 I tryed that but with no luck. Whayt I have learned so far is 'SpawnNonPartyRosterMemberAtHangout()' in the module load script needs to be implemented but how to do this I’m still not sure.

Modifié par Alupinu, 25 juillet 2010 - 08:37 .