PDA

View Full Version : Script to make Party NPC's same alignment


bneezy
08-06-2004, 07:01 AM
Is there a way to write a script that would change the entire party's alignment to yours as you play? If you go light, they do as well. I hear that is a new feature in KotOR II.

jrc24
08-06-2004, 12:36 PM
yes it is possible and it is easy

there is some command to do that :

--------------------------------

GetAlignmentGoodEvil(object oCreature);

Return ALIGNMENT_LIGHT_SIDE, ALIGNMENT_DARK_SIDE or ALIGNMENT_NEUTRAL, it is a constant to represent oCreature's good/evil alignment

--------------------------------

GetGoodEvilValue(object oCreature);

Get an integer between 0 and 100 (inclusive) to represent oCreature's Good/Evil alignment (100=good, 0=evil)

--------------------------------

AdjustAlignment(object oCreature, int nAlignment, int nShift);

Adjust the alignment of oCreature

nShift: this is the desired shift in alignment

-> ALIGNMENT_LIGHT_SIDE/ALIGNMENT_DARK_SIDE: oCreature's alignment will be shifted in the direction specified

-> ALIGNMENT_NEUTRAL: nShift is applied to oCreature's dark side/light side alignment value in the direction which is towards neutrality.

If oSubject has an alignment value of 80 (i.e. light side) then if nShift is 15, the alignment value will become (80-15)=65 Furthermore, the shift will at most take the alignment value to 50 and not beyond.

If oSubject has an alignment value of 40 then if nShift is 15, the aligment value will become 50.

--------------------------------

SetGoodEvilValue( object oCreature, int nAlignment );

Set oCreature's alignment value

--------------------------------

with this command you can do a script wich check alignment and alignment value of FirstPC and change alignment and alignment value of party's members.

just put your script in a strategic position

if you want a real exemple of script, tell me

bye

bneezy
08-06-2004, 11:54 PM
Yes, some useable code would be great. Thanks for the response as well.

nacho35
08-07-2004, 10:32 AM
Or ypu can just change it by using the console commands. That is the easiest way.

numark79
08-07-2004, 06:02 PM
Or, I think it's also possible to do it by editing your party npc's UTC files. It's pretty simple, and you can change their alignment to anything you want this way with out cheating =)

peace

Mav
08-07-2004, 06:09 PM
^^^^
LOL if you edit the .utc files you are going to need to put thme in your override and it will affect ALL of your gamesaves, nobody likes typing in the same cheat code over and over.... so what is the solution....KSE....period..KotOR Savegame Editor

Achilles
08-07-2004, 07:21 PM
Originally posted by maverick187
^^^^
LOL if you edit the .utc files you are going to need to put thme in your override and it will affect ALL of your gamesaves, nobody likes typing in the same cheat code over and over.... so what is the solution....KSE....period..KotOR Savegame Editor

What if he wants to make it permanent fixture in the games that he plays? Should he use KSE evertime that his pc gains alignment points?

KSE is not "the answer...period". It an awesome tool, but it is not a save-all. Based on what it sounds like, a script is what's going to give him the results that he wants. Let help him do that.

jrc24
08-07-2004, 07:23 PM
this is an exemple

this script give to all party's members the same good or evil value as the first pc

if your first pc is 25 light side, all party's members will get 25 light side

if your first pc is 35 dark side, all party's members will get 35 dark side

if your first pc is neutral, all party's members will become neutral


void main() {
object oPC=GetFirstPC();
object oBastila=GetObjectByTag("Bastila");
object oCarth=GetObjectByTag("Carth");
object oCand=GetObjectByTag("Cand");
object oJolee=GetObjectByTag("Jolee");
object oJuhani=GetObjectByTag("Juhani");
object oMission=GetObjectByTag("Mission");
object oZaalbar=GetObjectByTag("Zaalbar");
object oT3m4=GetObjectByTag("T3M4");
object oHk47=GetObjectByTag("HK47");
int nValuepc=GetGoodEvilValue(oPC);
SetGoodEvilValue(oBastila, nValuepc);
SetGoodEvilValue(oCarth, nValuepc);
SetGoodEvilValue(oCand, nValuepc);
SetGoodEvilValue(oJolee, nValuepc);
SetGoodEvilValue(oJuhani, nValuepc);
SetGoodEvilValue(oMission, nValuepc);
SetGoodEvilValue(oZaalbar, nValuepc);
SetGoodEvilValue(oT3m4, nValuepc);
SetGoodEvilValue(oHk47, nValuepc);
}


that is a quick exemple but you can make a script more Sophisticated, you can make a script wich give to all party's members a percentage of good or evil value of first pc

if you want an exemple of more sophisticated script or if you don t understand something, tell me

warning : put your script in a strategic position

bye