Hi all. I have quite some alignment shifts in my campaign, but I also have it so that the NPCs can talk to non-player creatures, so that the warping effect is eliminated. This causes though the alignment shift to happen on the companion. It makes sense, yes. And I will leave it like that for some. But I wanted to ask if there is a way to apply the shift on the main hero, even if the companion speaks. Kinda like, you order the companion to perform the action, therefore you become more evil. Maybe it's not the most realistic thing, but it makes sense plot-wise. Thanks in advance.
Alignment shifts with companion talking
#1
Posté 15 juillet 2014 - 06:33
#2
Posté 15 juillet 2014 - 07:06
The simplest way is to assign the align-shift to
object oTruePC = GetFirstPC();
but i use this :
// returns the truePC object of faction oCreature
// - oCreature must be PC-faction.
// else, returns OBJECT_INVALID
object kL_GetPC(object oCreature)
{
object oMaster = GetMaster(oCreature);
while (GetIsObjectValid(oMaster))
{
oCreature = oMaster;
oMaster = GetMaster(oMaster);
}
if (GetIsOwnedByPlayer(oCreature))
{
return oCreature;
}
if (GetIsRosterMember(oCreature))
{
oCreature = GetFactionLeader(oCreature);
oCreature = GetOwnedCharacter(oCreature);
return oCreature;
}
return OBJECT_INVALID;
}
#3
Posté 15 juillet 2014 - 08:38
Hi KevL. Why would the GetFirstPC assign it to our hero and not the companion?
A copy of the ga_allign scripts replacing the GetPCSpeaker with GetFirstPC worked fine. The question is just to clarify why
. Thanks by the way, yet again for scripting assistance.
#4
Posté 15 juillet 2014 - 09:19
... take a look at the description of GetFirstPC()
// Get the first PC in the player list. // This resets the position in the player list for GetNextPC(). //RWT-OEI 01/16/06 //bOwnedCharacter, if true, returns the first player's owned PC //object. If false, returns the first player's currently controlled //object. object GetFirstPC(int bOwnedCharacter=TRUE);
so, first off, it's supposed to be used in a loop w/ GetNextPC(). ( Pain got kinda feverish about this & i agree )
second, if there is more than one *Player* the return is anyone's guess. (so does my function as it is -- rather i just don't know what's going on with MP player-objects; specifically GetFactionLeader() )
thirdly, note the argument bOwnedCharacter TRUE/FALSE. True means only main-characters are evaluated; false means a player's controlled character is returned instead.
So if a script uses GetFirstPC(FALSE) it returns the controlled companion. GetFirstPC(default TRUE) returns the first truePC that's joined a server. So if you hope that a couple of buddies team up to multi-play your mod, best try to respect things i figure.
- in a single player environment, GetFirstPC() will return the same creature as kL_GetPC(oPCFactionCreature)
- in MP, as i said I'm not sure what mine returns; but it should at least return OBJECT_INVALID on an error ( ie, not PC-faction input )
/shrug_~
#5
Posté 15 juillet 2014 - 10:14
It's all clear. I just thought that PC is a companion as well, so to say. But the function calls the server joined character. If left default that is.
As for multiplayer, I have so many of these around that it's just impossible to think of it at the moment. Just single player it will be
. Plus, it will make no sense story wise if it becomes MP.
#6
Posté 15 juillet 2014 - 11:15
just an add: not sure if you're aware but GetIsPC() -- boolean -- checks if a creature is PlayerControlled. The name of the function is a holdover from NwN; it should have been changed to GetIsPCC(), player controlled character. The *PC* is not companion, not associate, not "Player Created" either: PC is PC, player character.
PC is, technically, "Owned Character". best of luck,
#7
Posté 15 juillet 2014 - 02:02
kevL: Could you give a summary of why Pain got feverish about how GetFirstPC was meant to be used? I've seen some hints and references about it here and there, but I've never seen the full argument. I'm mostly interested in how it affects a single-player-only campaign.
Andy: I have a somewhat different view on the actions of the companions. First, as I think you already know from seeing my work, I consider alignments to be chosen at the beginning as a representation of what a character truly is, and so they dictate a character's actions, rather than a character's actions dictating their alignment, and so there are no alignment shifts in my work.
However, working within a framework where alignment shifts do occur, I would certainly apply the shift to the person taking the action, not the party leader, because in my module I've developed personalities and backgrounds for the companions you can take with you, and they can say things in conversations that no one else would think to say, and one companion may know a shopkeeper or have friends in town that no one else in the party knows. So my philosophy is that if you choose to allow that companion to speak for the group, they will never say or do anything against their nature. You would have to say/do it with a different character, even to the point where a companion may in fact leave the party in protest of your words or actions. So in my framework, if there were alignment shifts, the companions' actions should reflect on their own selves, and not on the main PC.
#8
Posté 15 juillet 2014 - 02:18
Tchos, I know what you mean and they will also shift for their own actions. But without giving many spoilers, alignment shifts need to change, well at least sometimes, for the main hero. At least until a certain point through the campaign. For the story. And it occurred to me, if someone play a spellcaster, and always goes forth with the fighter companion, then all these shifts will never take place on the main hero. So I will keep it halved. Sometimes, the companion will shift and sometimes the main character. The best solution I can bring to this, is that the conversation checks who is talking, and if it's a companion then another nod comes up where the companion asks the main PC how he wants to proceed.
It's not too many occasions that alignments shifts take place, and not through the whole campaign. And I enjoyed your system as well.
What I think the final decision will be, is this: Conversation that lead to battle, regardless of any alignment changes, will be CanTalkToNonPlayer flagged. Conversations which make sense to the plot, and only to the main character (normally don't lead to battle, except bosses), will warp the PC in the front. There is some testing to be done on this, and find the spot there in the middle where it will make sense without annoying or confusing people.
#9
Posté 15 juillet 2014 - 04:02
There's another way to handle conversations that must be spoken by the main PC without force-warping them to the front, assuming you're using SoZ conversations. Just have the condition on the node check that the PC Speaker is the First PC. That way, the dialogue line will not appear for anyone except the main PC. If you're controlling a different character at that time, they won't have any dialogue options, unless you put one without conditions, or with a condition "NOT First PC" like "I'll wait for the party leader to decide that," and loop back to the question node.
#10
Posté 15 juillet 2014 - 05:49
For SoZ that is the solution, yes. But I encountered this in a cutscene. And I really didn't want my druid companion to be making all these desicions on that particular cutscene. It is because my campaign follows the style of BG, or for the fact... NWN2. Imagine, you controlling Neeshka and when you go back to CK, your father is there and says to you, Neeshka: I missed you, or whatever he says I don't remember
. It would make no sense... would it?
#11
Posté 15 juillet 2014 - 06:21
I didn't know you were using a cutscene. Yes, I know that in a cutscene the player can't switch to a different character during the conversation. I'm not saying you should change anything, but just want to throw out other possibilities of what might be done.
I think it would be possible to create the illusion that the main PC is the one speaking, even if the player is controlling a different companion at the time, and without switching control of the main character, by using a static camera focused on the main PC for the node in which the player should choose a speaking line.
#12
Posté 15 juillet 2014 - 08:38
kevL: Could you give a summary of why Pain got feverish about how GetFirstPC was meant to be used? I've seen some hints and references about it here and there, but I've never seen the full argument. I'm mostly interested in how it affects a single-player-only campaign.
it doesn't. That is, GetFirstPC() will work fine forever in SP.
let me ask you this, is there a flag that can be set that disallows a second player from logging into a module? (i haven't seen it ...)
I think Pain's argument is essentially that: It's a multi-player game, learn to script for multiple players.
2nd, no one's gonna win a scripting award for counter-intuitively using GetFirstPC() w/out looping it w/ GetNextPC(). i mean, it's not even 'clever' .. heck, i feel guilty when checking for inventory by using GetFirstItemInInventory()
that said, I still don't know what GetFactionLeader() *really* does
Ps. the way i do align-shifts is only to grant them when they are 'out of character' -- don't want paladins to get away with murdering babies (unless they're the spawn of Satan ofc). Otoh, giving alms to a needy family is simply matter-of-course that grants no align-shift, etc.
#13
Posté 15 juillet 2014 - 09:13
I thought it might be something like that. I'm afraid I disagree with the opinion that I should be obliged to write any of my work as multiplayer modules, and I disagree with the premise that the game itself is (or should necessarily be seen as) fundamentally a multiplayer game. It supports it, certainly, and certainly a portion of the game's audience plays it that way largely or exclusively, but to me it has always been a single-player game. I am only interested in playing single-player modules, and am only interested in making single-player modules, and my intended audience is those who enjoy single-player modules (with a player-controlled party of 5, of course).
The fact that I wouldn't set a flag to forbid a second player from joining it, if such a flag were to exist, is more due to my position of allowing the players to play my work however they most enjoy doing so, even if the module is not built to support it, and even if it breaks things.
This is similar to my position that I would rather modders simply tell potential players that their module was designed for a fighter character of level 5, and that it doesn't support playing as a level 1 wizard, but do not force-end the module if a player logs in with a wizard, nor de-level a level 10 character if the player wants to play that way.
#14
Posté 15 juillet 2014 - 09:20
i don't see how doing something wrong should be twisted into making it sound for the better
#15
Posté 15 juillet 2014 - 09:37
If it will work fine forever in the space I intend it to work in, I don't see how it's wrong, regardless of the thing it was designed to be used for. Still, I would be open to alternatives if they work just as well for the purpose.
#16
Posté 15 juillet 2014 - 11:06
i used 'wrong' to emphasize my point. ( that players having the freedom to break a module is not really a freedom -- or it's no more a freedom than the freedom to play a module MP, which neither of us can do anything about, without it perhaps breaking )
so I keep my eyes open for a simple and robust solution ... /shrug.





Retour en haut






