Aller au contenu

Photo

Noob trying to add a companion


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

#1
adoado13

adoado13
  • Members
  • 4 messages
 I've been trying to add a companion for a couple of hours now through conversation scripting. This is my first attempt at NWN2 scripting so bare with me. I am using the "ga_henchman_add" script and it doesnt seem to work, no matter what variable I change. Here is a link to a screenshot of the script attempt 

http://i.imgur.com/8fyB6pX.png?1?9617

Maybe I am just missing something simple and dumb. Any advice would be wonderful


Thanks in advance.

#2
andysks

andysks
  • Members
  • 1 655 messages
You need the following scripts.
ga_roster_add_object
ga_roster_add_selectable
ga_roster_party_add
ga_reset_level
Set the string to the companion tag and int to 1.
Also import the companion script set to the creature you want to make a companion.
The http://vnfiles.ign.c...et_Manual15.pdf
can provide all these instructions ( that's how I learned most of the stuff I do ), and it's the best guide out there.

P.S : I don't know if other people use a different technique that I'm not familiar with to add companions, but this one's working for me :)

Andy.

#3
Darin

Darin
  • Members
  • 282 messages
-> selectable 0 means the player can't drop them from the party in the party menu (1 means that they can)

-> ga_reset_level will reset their skills/feats as well based on their levelup profile (if you want to avoid that, don't include it)...but not including it keeps them at 0 xp.

also, be sure to use the companion scripts, not creature ones (import properties tab and find the companions scripts)

#4
adoado13

adoado13
  • Members
  • 4 messages
Thanks so much guys, I finally got it to work. I never would have figured that out by myself.

#5
Morbane

Morbane
  • Members
  • 1 883 messages
look for the tutorial thread in these forums - there is a virtual library with enough info to raise you beyond novice in a very short time.

p.s. it is a sticky (they appear at the top of each forum)

Modifié par Morbane, 26 juin 2013 - 11:43 .


#6
Morbane

Morbane
  • Members
  • 1 883 messages
these:

http://social.biowar...5/index/3136194

http://social.biowar...5/index/3141389

http://social.biowar...5/index/3138806

:D

Modifié par Morbane, 26 juin 2013 - 11:46 .


#7
Guest_Iveforgotmypassword_*

Guest_Iveforgotmypassword_*
  • Guests
I always use the companion b scripts I don't know if it makes a difference using c but the b ones have never failed for me.

#8
ColorsFade

ColorsFade
  • Members
  • 1 271 messages
If you don't want to use four scripts every time to add a companion, you can wrap it in its own script, like so:

[pre]
/******************************************************************
Adds a Companion NPC and sets their XP equal to the PC's if they
are below. This script merges four scripts together so that you
don't have to setup all four script calls in a conversation.

This script also has a convention: the RosterName is the same as
the creature's TAG, resref, etc. They should all be named
the same.
*******************************************************************/
#include "ginc_param_const"
#include "ginc_debug"
#include "ginc_misc"


void main(string sCompanionTag)
{
//FROM: ga_roster_add_object
//Adds a NPC to the global roster of NPCs available to be added to
//a player's party. Roster Name is a 10-character name used to
//reference that NPC in other Roster related functions.
//The NPC will be left in the game world, but will now exist
//in the roster as well.

object oCompanion = GetObjectByTag(sCompanionTag);
int bResult = AddRosterMemberByCharacter(sCompanionTag, oCompanion);

//FROM: ga_roster_selectable
SetIsRosterMemberSelectable(sCompanionTag, 1);

//FROM: ga_roster_party_add
object oPC = GetFirstPC();
AddRosterMemberToParty(sCompanionTag, oPC);


int nXP = GetPCAverageXP();
SetXP(oCompanion, nXP);
ForceRest(oCompanion);
}
[/pre]

Modifié par ColorsFade, 06 juillet 2013 - 11:54 .


#9
ColorsFade

ColorsFade
  • Members
  • 1 271 messages
How come BB codes don't work on these pages??

#10
Guest_Iveforgotmypassword_*

Guest_Iveforgotmypassword_*
  • Guests
ColorsFade..If only you had done that a few years ago you would have saved me a lot of looking in my notebook to find what scripts I needed for companions..

Consider it copy and pasted !

#11
ColorsFade

ColorsFade
  • Members
  • 1 271 messages

Iveforgotmypassword wrote...

ColorsFade..If only you had done that a few years ago you would have saved me a lot of looking in my notebook to find what scripts I needed for companions..

Consider it copy and pasted !


No sweat. I am late to the modding game :)

Just make sure your companions follow the convention. The Tag, Template Resref and Resource Name should all be the same. 

I would rather follow a simple convention like that as it allows me to pass one less parameter on the function call in the conversation.