Aller au contenu

Photo

Faction


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

#1
Taino

Taino
  • Members
  • 139 messages
Wondering if I can have certain subrace[s] belong to a specific faction, perferably by script if possible. I have looked in the functions but didnt come across any. Or I may have over looked. Anyone can too lend a hand?

Thank in advance.

#2
WhiZard

WhiZard
  • Members
  • 1 204 messages

Taino wrote...

Wondering if I can have certain subrace[s] belong to a specific faction, perferably by script if possible. I have looked in the functions but didnt come across any. Or I may have over looked. Anyone can too lend a hand?

Thank in advance.


ChangeFaction()
ChangeToStandardFaction()

Both can be used on spawn, though the former requires a creature already of that faction in the game/module, and the latter is limited to standard factions.

#3
Taino

Taino
  • Members
  • 139 messages
So I can set SUBRC_DROW to their own faction by using ChangeFaction()?

#4
Axe_Murderer

Axe_Murderer
  • Members
  • 279 messages
NPCs only...PCs have no factions

#5
Taino

Taino
  • Members
  • 139 messages
Hmm, I wanting to make the faction[s] towards the subrace[s].

#6
Taino

Taino
  • Members
  • 139 messages
Thanks Axe

#7
Taino

Taino
  • Members
  • 139 messages
I found this faction player reputation but kinda vague on the information on how to expand it.. Or I just might not understand how to continue the script and where it would go. Also not sure if this would even work.

#8
Birdman076

Birdman076
  • Members
  • 186 messages

Taino wrote...

Wondering if I can have certain subrace[s] belong to a specific faction, perferably by script if possible. I have looked in the functions but didnt come across any. Or I may have over looked. Anyone can too lend a hand?

Thank in advance.


Is this for Shayan's SSE?

#9
Failed.Bard

Failed.Bard
  • Members
  • 774 messages
  This is how I handle setting PC "factions" in my mod.  While NPCs are added directly to factions, based on scriptless NPC "faction" boss creatures kept in the DM area.  Those same creatures are also used to determine the alteration in reputation for a PC based on the reputation of the faction they'll be joining compared to all the other factions.
  It's not perfect by any means (and requires the toolset extender to compile), but I haven't had any aberant behaviour from it yet.  It might be enough to give you a bit of a template to work from for setting up your own scripts though.


// Returns the tag of the "boss" creature for that faction.
string GetFactionBoss (int nFaction)
{
 switch (nFaction)
   {
    case 0:  return "F_PC";
    case 1:  return "F_COMMONER";
    case 2:  return "F_DEFENDER";
    case 3:  return "F_MERCHANT";
    case 4:  return "F_HOSTILE";
    case 5:  return "F_ZOMBIE";
    case 6:  return "F_ZOMBIE_HERBIVORE";
    case 7:  return "F_ZOMBIE_PET";
    case 8:  return "F_ZOMBIE_PREDATOR";
    case 9:  return "F_UNDEAD_OTHER";
    case 10: return "F_MUMMY";
    case 11: return "F_VAMPIRE";
    case 12: return "F_Maria";
    case 13: return "F_OUTCAST";
    case 14: return "F_HOSTILE_TO_ALL";
    case 15: return "F_SWARMS";
    case 16: return "F_NEUTRAL_TO_ALL";
   }
 return "";
}


void SetPCReputation (object oPC, int nPCFaction)
{
 int nReaction, nReaction2, nAdjust;
 object oBoss;
 object oPCBoss = GetObjectByTag (GetFactionBoss (nPCFaction));
 int nFaction = 1;
 string sBoss;
 for (sBoss = GetFactionBoss (nFaction); sBoss != ""; sBoss = GetFactionBoss (nFaction))
    {
     oBoss = GetObjectByTag (sBoss);
     nReaction  = GetReputation (oBoss, oPC);
     nReaction2 = GetReputation (oBoss, oPCBoss);
     nAdjust    = nReaction2 - nReaction;
     AdjustReputation (oPC, oBoss, nAdjust);
     nFaction ++;
    }
}

#10
Taino

Taino
  • Members
  • 139 messages
Nah, I'm using another subrace system.

#11
Axe_Murderer

Axe_Murderer
  • Members
  • 279 messages
What that script does is adjust your repuataion with an NPC faction based on the faction of the NPC you kill. Basically it does the exact same thing the default faction system does. If you kill something of faction X and there is a faction Y who are set friendly to X, then your reputation with Y gets worse because you killed an X-man. The only difference is that instead of creating actual factions for groups of NPCs and assigning your NPCs to those factions, that script relys on the builder to tag all NPCs in a group the same to mark them as belonging to the same group. Frankly, it seems easier and more efficient to me to use the built-in faction editor to achieve that. . . far less scripting involved since the default scripts already handle it for you for one thing. Lots of different types of interaction besides just killing can affect things for another.

Sounds like what you want is to group PCs into factions which there is no support for. All the monster factions react to PCs identically regardless of what PC kills them or thier friends. So you have to mark them in some way to indicate what group they belong to and then if you want monsters to react differently to PCs of differing groups, you must provide a custom AI for your creatures so they will be capable of recognizing your custom grouping mark and responding accordingly. You could use a variable to mark them or maybe give them a nodrop item such as a badge or something or use their subrace if you implement that, but whatever method you use, you'll have to additionally modify your creature scripts to be able differentiate if you want varying behavior from them. That's where all the work is at.

Personal Reputation is what the system uses to differentiate somewhat between individual PCs (so if one PC in an MP game attacks a commoner, all other commoners will only be angry with that one PC, not every PC in the game). But be forewarned that personal rep is often overriden by actions that affect faction rep. Like if you're in a party and your party member attacks a commoner then the whole party is affected reputation-wise.

Modifié par Axe_Murderer, 17 septembre 2011 - 03:15 .


#12
_Guile

_Guile
  • Members
  • 685 messages
It's hard to help someone when they aren't very detailed in the request.

Why do you want to change their faction?  You can never really change a PC's faction, however, you can change every other creature in the module's faction, and determine what to do to the PC when the PC encounters said creature.  (e.g. attack, drink ale together, make small talk, etc)

You can assign a variable to anything and check that variable, not tough to do, to make a determination on how to "react" or "perform" in any given situation.

Based upon the variable set on the PC, determined by race, you can make a switch statement that determine what to do based against the faction that the PC is (read from variable), and what they have done. E.g. if a PC Attacks say, a commoner, then your script would want to modify that variable (for future reference).  You could also use this variable in a very wide array of ways to determine what action to assign the NPC when they encounter the PC.

The Easiest way to handle Custom Factions, is to give all creatures a custom faction (especially monsters), and when they "Perceive" the PC, here you will want to do a check on the PC to determine what to do, e.g. if it's a drow, who sees a drow, they may not attack the PC/Drow if they was a member of their drow house, or if a giant percieved a giant PC, they may be friendly towards them, maybe.

You can more or less do anything with a variable on a PC, the variable (x) could mean anything, you determine what defines (x), and in turn when you read the variable from the PC with any script you could make determinations on what to do.

You can use a 100,000 point system for the player's race 1000 # (e.g. 2,000 / 3,000), and then assign a smaller number 100/200/300 to tell you more information about the PC.

Example Usage (we read variable x = 20,350 from the PC) which, interpreted, means..

Race Drow / has a neutral reputation towards Commoners...
You can use a-z variables in an array to store information about the player's reputation towards every possible faction (@ 27 start using (aa) / (bb) / (cc) / etc. variables)

Variables are more or less how you would use a custom faction setup, to give you a short answer, I'm hoping you are talented enough to figure the rest out on your own.\\

I hope this helps you in some way, sorry that you cannot actually modify the PC 's Faction.

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

Axe made a very important point about Reputations, which I tend not to use at all, because often bad Players will do stupid things that cause issues with everyone in the party, so when  a PC attacks a commoner, they should have their reputations adjusted instantly, but that doesn't mean you cannot set a variable on the PC that would tell the commoners that this PC is a um bad guy..

Which in turn would tell the commoner in the inn to raise the price of his goods. :D

Modifié par _Guile, 17 septembre 2011 - 04:30 .


#13
Taino

Taino
  • Members
  • 139 messages
Thanks Guile and too everyone. Sorry I didn't leave more information on what I was looking for or wanting to try and attempted.

What I was trying to figure out is I have several surface race and underdark race; which I wanted to have their factions adjusted towards each other and towards other creature [forest creatures, commoners, merchants, etc].

@ Failed_Beard:
This is similar too what I am looking for now I just need to see how to script/impliment it into the module.

@Axe:
I have looked through the reputation systems on the vault and understand how adjusting the PC actions can effect their entire faction.

@ Guile:
Even though I wasn't very detailed on my question. You got what I am trying to aim at. Which I'm not the best scripter and I might be working towards something which is a bit over my novice scripting talent.

Thanks to everyone!! I will trying to figure this out.

#14
DM_Vecna

DM_Vecna
  • Members
  • 280 messages
Just know the adjust reputation function is does not work if you are going to cycle through NPCs. I have a thread on here somewhere about it. Maybe Axe can find a work around such as destroying then re-creating the NPC. But in short whenever you adjust reputation on a creature if you run that function on them again you get boosted result. I can go into details if this is not clear and anyone wants more information. I will be looking at this more probably next month.

#15
Taino

Taino
  • Members
  • 139 messages
I did found this: Race Relations which has a single script like this:
/*
THE NOTORIOUS GENIUS'S RACE RELATIONS
A MODULE ONENTER SCRIPT
FEBRUARY 2003

Simulates racial relations
Sets an entering PC's personal reputation with every other
player in the module based on player race

*/

void main()
{
// Get the entering object
object oEntering = GetEnteringObject();
// Is it a PC?
if (GetIsPC(oEntering) == TRUE)
{
// get the race of the PC
int iRace = GetRacialType(oEntering);

// if oEntering is a human, adjust relations accordingly
if (iRace == RACIAL_TYPE_HUMAN)
{

// Get the first PC on the list
object oPC = GetFirstPC();
// big race relations while loop
while (GetIsObjectValid(oPC) == TRUE)
{

// get oPC's race
int iClan = GetRacialType(oPC);

// ELVES
// d2 switch. 1= set them friendly, 2 = set them neutral
if (iClan == RACIAL_TYPE_ELF)
{
switch (d2())
{
case 1:
{
SetIsTemporaryFriend(oPC,oEntering,FALSE);
}
case 2:
{
SetIsTemporaryNeutral(oPC,oEntering,FALSE);
}
}
}

// DWARVES
// set oEntering friendly to dwarves
if (iClan == RACIAL_TYPE_DWARF)
{
SetIsTemporaryFriend(oPC,oEntering,FALSE);
}

// HALFELVES
// d2 switch. 1 = set them friendly, 2 = set them neutral
if (iClan == RACIAL_TYPE_HALFELF)
{
switch (d2())
{
case 1:
{
SetIsTemporaryFriend(oPC,oEntering,FALSE);
}
case 2:
{
SetIsTemporaryNeutral(oPC,oEntering,FALSE);
}
}
}

// HALFLINGS
// d2 switch. 1 = set them friendly, 2 = set them neutral
if (iClan == RACIAL_TYPE_HALFLING)
{
switch (d2())
{
case 1:
{
SetIsTemporaryFriend(oPC,oEntering,FALSE);
}
case 2:
{
SetIsTemporaryNeutral(oPC,oEntering,FALSE);
}
}
}

// HUMANS
// of course, humans are friendly to other humans
if (iClan == RACIAL_TYPE_HUMAN)
{
SetIsTemporaryFriend(oPC,oEntering,FALSE);
}

// d2 switch. 1 = set them friendly, 2 = set them neutral
if (iClan == RACIAL_TYPE_GNOME)
{
switch (d2())
{
case 1:
{
SetIsTemporaryFriend(oPC,oEntering,FALSE);
}
case 2:
{
SetIsTemporaryNeutral(oPC,oEntering,FALSE);
}
}
}

// HALFORCS
// d2 switch. 1 = set them neutral, 2 = set them hostile
if (iClan == RACIAL_TYPE_HALFORC)
{
switch (d2())
{
case 1:
{
SetIsTemporaryNeutral(oPC,oEntering,FALSE);
}
case 2:
{
SetIsTemporaryEnemy(oPC,oEntering,FALSE);
}
}
}
}
oPC = GetNextPC();
}

// if oEntering is an elf, adjust relations accordingly
if (iRace == RACIAL_TYPE_ELF)
{
// Get the first PC on the list
object oPC = GetFirstPC();
// big race relations while loop
while (GetIsObjectValid(oPC) == TRUE)
{

// get oPC's race
int iClan = GetRacialType(oPC);

// ELVES
// Elves are friendly with other elves
if (iClan == RACIAL_TYPE_ELF)
{
SetIsTemporaryFriend(oPC,oEntering,FALSE);
}

// set oEntering neutral to dwarves
if (iClan == RACIAL_TYPE_DWARF)
{
SetIsTemporaryFriend(oPC,oEntering,FALSE);
}

// HALFELVES
// d2 switch. 1 = set them friendly, 2 = set them neutral
if (iClan == RACIAL_TYPE_HALFELF)
{
switch (d2())
{
case 1:
{
SetIsTemporaryFriend(oPC,oEntering,FALSE);
}
case 2:
{
SetIsTemporaryNeutral(oPC,oEntering,FALSE);
}
}
}

// HALFLINGS
// d2 switch. 1 = set them friendly, 2 = set them neutral
if (iClan == RACIAL_TYPE_HALFLING)
{
switch (d2())
{
case 1:
{
SetIsTemporaryFriend(oPC,oEntering,FALSE);
}
case 2:
{
SetIsTemporaryNeutral(oPC,oEntering,FALSE);
}
}
}

// HUMANS
// d2 switch. 1 = set them friendly, 2 = set them neutral
if (iClan == RACIAL_TYPE_HUMAN)
{
switch (d2())
{
case 1:
{
SetIsTemporaryFriend(oPC,oEntering,FALSE);
}
case 2:
{
SetIsTemporaryNeutral(oPC,oEntering,FALSE);
}
}
}

// GNOMES
// d2 switch. 1 = set them friendly, 2 = set them neutral
if (iClan == RACIAL_TYPE_GNOME)
{
switch (d2())
{
case 1:
{
SetIsTemporaryFriend(oPC,oEntering,FALSE);
}
case 2:
{
SetIsTemporaryNeutral(oPC,oEntering,FALSE);
}
}
}

// HALFORCS
// d2 switch. 1 = set them friendly, 2 = set them hostile
if (iClan == RACIAL_TYPE_HALFORC)
{
switch (d2())
{
case 1:
{
SetIsTemporaryEnemy(oPC,oEntering,FALSE);
}
case 2:
{
SetIsTemporaryNeutral(oPC,oEntering,FALSE);
}
}
}
}
// Reset the Loop
oPC = GetNextPC();
}

// if oEntering is a dwarf, adjust relations accordingly
if (iRace == RACIAL_TYPE_DWARF)
{

// Get the first PC on the list
object oPC = GetFirstPC();
// big race relations while loop
while (GetIsObjectValid(oPC) == TRUE)
{

// get oPC's race
int iClan = GetRacialType(oPC);

// ELVES
// d2 switch. 1= set them friendly, 2 = set them neutral
if (iClan == RACIAL_TYPE_ELF)
{
switch (d2())
{
case 1:
{
SetIsTemporaryFriend(oPC,oEntering,FALSE);
}
case 2:
{
SetIsTemporaryNeutral(oPC,oEntering,FALSE);
}
}
}

// DWARVES
// Dwarves are friendly to other dwarve
if (iClan == RACIAL_TYPE_DWARF)
{
SetIsTemporaryFriend(oPC,oEntering,FALSE);
}

// HALFELVES
// d2 switch. 1 = set them friendly, 2 = set them neutral
if (iClan == RACIAL_TYPE_HALFELF)
{
switch (d2())
{
case 1:
{
SetIsTemporaryFriend(oPC,oEntering,FALSE);
}
case 2:
{
SetIsTemporaryNeutral(oPC,oEntering,FALSE);
}
}
}

// HALFLINGS
// d2 switch. 1 = set them friendly, 2 = set them neutral
if (iClan == RACIAL_TYPE_HALFLING)
{
switch (d2())
{
case 1:
{
SetIsTemporaryFriend(oPC,oEntering,FALSE);
}
case 2:
{
SetIsTemporaryNeutral(oPC,oEntering,FALSE);
}
}
}

// HUMANS
// d2 switch. 1 = set them friendly, 2 = set them neutral
if (iClan == RACIAL_TYPE_HUMAN)
{
switch (d2())
{
case 1:
{
SetIsTemporaryFriend(oPC,oEntering,FALSE);
}
case 2:
{
SetIsTemporaryNeutral(oPC,oEntering,FALSE);
}
}
}

// GNOMES
// d2 switch. 1 = set them friendly, 2 = set them neutral
if (iClan == RACIAL_TYPE_GNOME)
{
switch (d2())
{
case 1:
{
SetIsTemporaryFriend(oPC,oEntering,FALSE);
}
case 2:
{
SetIsTemporaryNeutral(oPC,oEntering,FALSE);
}
}
}

// HALFORCS
// d2 switch. 1 = set them friendly, 2 = set them hostile
if (iClan == RACIAL_TYPE_HALFORC)
{
switch (d2())
{
case 1:
{
SetIsTemporaryEnemy(oPC,oEntering,FALSE);
}
case 2:
{
SetIsTemporaryNeutral(oPC,oEntering,FALSE);
}
}
}
}
// Reset the Loop
oPC = GetNextPC();
}

// If oEntering is a half-elf, adjust relations accordingly
if (iRace == RACIAL_TYPE_HALFELF)
{

// Get the first PC on the list
object oPC = GetFirstPC();
// big race relations while loop
while (GetIsObjectValid(oPC) == TRUE)
{

// get oPC's race
int iClan = GetRacialType(oPC);

// ELVES
// d2 switch. 1= set them friendly, 2 = set them neutral
if (iClan == RACIAL_TYPE_ELF)
{
switch (d2())
{
case 1:
{
SetIsTemporaryFriend(oPC,oEntering,FALSE);
}
case 2:
{
SetIsTemporaryNeutral(oPC,oEntering,FALSE);
}
}
}

// DWARVES
// d2 switch. 1 = set them friendly, 2 = set them neutral
if (iClan == RACIAL_TYPE_DWARF)
{
switch (d2())
{
case 1:
{
SetIsTemporaryFriend(oPC,oEntering,FALSE);
}
case 2:
{
SetIsTemporaryNeutral(oPC,oEntering,FALSE);
}
}
}

// HALFELVES
// Halfelves are friendly to other halfelves
if (iClan = RACIAL_TYPE_HALFELF)
{
SetIsTemporaryFriend(oPC,oEntering,FALSE);
}

// HALFLINGS
// d2 switch. 1 = set them friendly, 2 = set them neutral
if (iClan == RACIAL_TYPE_HALFLING)
{
switch (d2())
{
case 1:
{
SetIsTemporaryFriend(oPC,oEntering,FALSE);
}
case 2:
{
SetIsTemporaryNeutral(oPC,oEntering,FALSE);
}
}
}

// HUMANS
// d2 switch. 1 = set them friendly, 2 = set them neutral
if (iClan == RACIAL_TYPE_HUMAN)
{
switch (d2())
{
case 1:
{
SetIsTemporaryFriend(oPC,oEntering,FALSE);
}
case 2:
{
SetIsTemporaryNeutral(oPC,oEntering,FALSE);
}
}
}

// GNOMES
// d2 switch. 1 = set them friendly, 2 = set them neutral
if (iClan == RACIAL_TYPE_GNOME)
{
switch (d2())
{
case 1:
{
SetIsTemporaryFriend(oPC,oEntering,FALSE);
}
case 2:
{
SetIsTemporaryNeutral(oPC,oEntering,FALSE);
}
}
}

// HALFORCS
// d2 switch. 1 = set them friendly, 2 = set them hostile
if (iClan == RACIAL_TYPE_HALFORC)
{
switch (d2())
{
case 1:
{
SetIsTemporaryEnemy(oPC,oEntering,FALSE);
}
case 2:
{
SetIsTemporaryNeutral(oPC,oEntering,FALSE);
}
}
}
}
// Reset the Loop
oPC = GetNextPC();
}

// If oEntering is a Gnome, adjust relations accordingly
if (iRace == RACIAL_TYPE_GNOME)
{

// Get the first PC on the list
object oPC = GetFirstPC();
// big race relations while loop
while (GetIsObjectValid(oPC) == TRUE)
{

// get oPC's race
int iClan = GetRacialType(oPC);

// ELVES
// d2 switch. 1= set them friendly, 2 = set them neutral
if (iClan == RACIAL_TYPE_ELF)
{
switch (d2())
{
case 1:
{
SetIsTemporaryFriend(oPC,oEntering,FALSE);
}
case 2:
{
SetIsTemporaryNeutral(oPC,oEntering,FALSE);
}
}
}

// DWARVES
// d2 switch. 1 = set them friendly, 2 = set them neutral
if (iClan == RACIAL_TYPE_DWARF)
{
switch (d2())
{
case 1:
{
SetIsTemporaryFriend(oPC,oEntering,FALSE);
}
case 2:
{
SetIsTemporaryNeutral(oPC,oEntering,FALSE);
}
}
}

// HALFELVES
// Sets them neutral
if (iClan = RACIAL_TYPE_HALFELF)
{
SetIsTemporaryNeutral(oPC,oEntering,FALSE);
}

// HALFLINGS
// d2 switch. 1 = set them friendly, 2 = set them neutral
if (iClan == RACIAL_TYPE_HALFLING)
{
SetIsTemporaryNeutral(oPC,oEntering,FALSE);
}

// HUMANS
// d2 switch. 1 = set them friendly, 2 = set them neutral
if (iClan == RACIAL_TYPE_HUMAN)
{
switch (d2())
{
case 1:
{
SetIsTemporaryFriend(oPC,oEntering,FALSE);
}
case 2:
{
SetIsTemporaryNeutral(oPC,oEntering,FALSE);
}
}
}

// GNOMES
// Gnomes are friendly to other gnomes
if (iClan == RACIAL_TYPE_GNOME)
{
SetIsTemporaryFriend(oPC,oEntering,FALSE);
}

// HALFORCS
// Sets them neutral
if (iClan == RACIAL_TYPE_HALFORC)
{
SetIsTemporaryNeutral(oPC,oEntering,FALSE);
}
}
// Reset the Loop
oPC = GetNextPC();
}

// If oEntering is a Halfling, adjust relations accordingly
if (iRace == RACIAL_TYPE_HALFLING)
{

// Get the first PC on the list
object oPC = GetFirstPC();
// big race relations while loop
while (GetIsObjectValid(oPC) == TRUE)
{

// get oPC's race
int iClan = GetRacialType(oPC);

// ELVES
// d2 switch. 1= set them friendly, 2 = set them neutral
if (iClan == RACIAL_TYPE_ELF)
{
switch (d2())
{
case 1:
{
SetIsTemporaryFriend(oPC,oEntering,FALSE);
}
case 2:
{
SetIsTemporaryNeutral(oPC,oEntering,FALSE);
}
}
}

// DWARVES
// d2 switch. 1 = set them friendly, 2 = set them neutral
if (iClan == RACIAL_TYPE_DWARF)
{
switch (d2())
{
case 1:
{
SetIsTemporaryFriend(oPC,oEntering,FALSE);
}
case 2:
{
SetIsTemporaryNeutral(oPC,oEntering,FALSE);
}
}
}

// HALFELVES
// Sets them neutral
if (iClan = RACIAL_TYPE_HALFELF)
{
SetIsTemporaryNeutral(oPC,oEntering,FALSE);
}

// HALFLINGS
// Halflings are friendly to other halflings
if (iClan == RACIAL_TYPE_HALFLING)
{
SetIsTemporaryFriend(oPC,oEntering,FALSE);
}

// HUMANS
// d2 switch. 1 = set them friendly, 2 = set them neutral
if (iClan == RACIAL_TYPE_HUMAN)
{
switch (d2())
{
case 1:
{
SetIsTemporaryFriend(oPC,oEntering,FALSE);
}
case 2:
{
SetIsTemporaryNeutral(oPC,oEntering,FALSE);
}
}
}

// GNOMES
// Gnomes are friendly to other gnomes
if (iClan == RACIAL_TYPE_GNOME)
{
switch (d2())
{
case 1:
{
SetIsTemporaryFriend(oPC,oEntering,FALSE);
}
case 2:
{
SetIsTemporaryNeutral(oPC,oEntering,FALSE);
}
}
}

// HALFORCS
// Sets them neutral
if (iClan == RACIAL_TYPE_HALFORC)
{
SetIsTemporaryNeutral(oPC,oEntering,FALSE);
}
}
// Reset the Loop
oPC = GetNextPC();
}

// If oEntering is a Halforc, adjust relations accordingly
if (iRace == RACIAL_TYPE_HALFORC)
{

// Get the first PC on the list
object oPC = GetFirstPC();
// big race relations while loop
while (GetIsObjectValid(oPC) == TRUE)
{

// get oPC's race
int iClan = GetRacialType(oPC);

// ELVES
// d2 switch. 1= set them neutral, 2 = set them hostile
if (iClan == RACIAL_TYPE_ELF)
{
switch (d2())
{
case 1:
{
SetIsTemporaryNeutral(oPC,oEntering,FALSE);
}
case 2:
{
SetIsTemporaryEnemy(oPC,oEntering,FALSE);
}
}
}

// DWARVES
// sets them neutral
if (iClan == RACIAL_TYPE_DWARF)
{
SetIsTemporaryFriend(oPC,oEntering,FALSE);
}

// HALFELVES
// d2 switch. 1 = set them neutral, 2 = set them hostile
if (iClan = RACIAL_TYPE_HALFELF)
{
switch (d2())
{
case 1:
{
SetIsTemporaryNeutral(oPC,oEntering,FALSE);
}
case 2:
{
SetIsTemporaryEnemy(oPC,oEntering,FALSE);
}
}
}

// HALFLINGS
// sets them neutral
if (iClan == RACIAL_TYPE_HALFLING)
{
SetIsTemporaryNeutral(oPC,oEntering,FALSE);
}

// HUMANS
// d2 switch. 1 = set them friendly, 2 = set them neutral
if (iClan == RACIAL_TYPE_HUMAN)
{
SetIsTemporaryNeutral(oPC,oEntering,FALSE);
}

// GNOMES
// sets them neutral
if (iClan == RACIAL_TYPE_GNOME)
{
SetIsTemporaryNeutral(oPC,oEntering,FALSE);
}

// HALFORCS
// Halforcs are friendly to other halforcs
if (iClan == RACIAL_TYPE_HALFORC)
{
SetIsTemporaryNeutral(oPC,oEntering,FALSE);
}
}
// Reset the Loop
oPC = GetNextPC();
}
}
}
// THE END

Pretty much is kinda close to what I would like to work with. So I just might see if I can work on this and see if I can use it towards a Subrace instead of RACIAL_TYPE_

#16
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages

THE NOTORIOUS GENIUS'S RACE RELATIONS
 

That is one of _Guile's names.  He has a lot of them.  I have only read down through the first part of the script,  It has bugs.  If you decide to use it make sure you give it some good testing.  

The thread DM_Venca refferanced and started a long time ago is  Script issue with adjust reputation
I may self have meant to look into it deeper but have not found the time. Messing with the repute 2da has gotten me no where with solving the problem. that is as far sa I got at the time.

#17
Failed.Bard

Failed.Bard
  • Members
  • 774 messages

DM_Vecna wrote...

Just know the adjust reputation function is does not work if you are going to cycle through NPCs. I have a thread on here somewhere about it. Maybe Axe can find a work around such as destroying then re-creating the NPC. But in short whenever you adjust reputation on a creature if you run that function on them again you get boosted result. I can go into details if this is not clear and anyone wants more information. I will be looking at this more probably next month.


  I got around this in my script by only adding the adjustment based on the PCs current reputation to that faction compared to the final reputation they're supposed to have.

#18
Axe_Murderer

Axe_Murderer
  • Members
  • 279 messages
Scripts like that one work fine up to a point. But as soon as two PCs party up together or play around with the like/dislike MP window, all those software generated reputations go out the wiindow. The game treats your party like a faction. When you join a party you inherit the party leader's reputations...all of your own reps get wiped. From that point on, your party is like a faction to the game --- the PC faction, to be specific in regards to the faction editor.

IMHO there is no acceptable way to ensure that PC reputations with other PCs will stick. The only way to be completely sure is to rely on your players to not party up with supposed enemies or change their like/dislike settings or attack the wrong PC. Maybe there is an nwnx function for the party join/request interface these days and that would change everything significantly. If you can prevent the party request from going out to an enemy they won't be able to join and wipe their reps. I'm not aware of anything that lets you control who parties with who, before they join. That's really what you need. So if it doesn't exist then you're stuck relying on players to respect the factions. My experience is that you cannot rely on players to behave the way you want them to. And you probably shouldn't anyway. I think the best you'll be able to reliably get is to have your NPCs react to the races differently. Any PCs that role play the factions correctly is just a bonus.

I wrote a script once (its out in the vault) that attempted to keep players from partying based on what guild they belonged to (virtually identical idea). Its a script that you can place all over your module on doors or triggers or placeables or area events etc (so it will get triggered fairly often) and when it runs it verifies the party is made up of only PCs from the same guild as the party leader. If you aren't in his guild it boots you from the party. Of course by that time the reps are all messed up, and if you don't put it on a heartbeat (something I was trying to avoid) then players can simply rejoin the party immediately until the next time they encounter the script.Still it does enforce party purity to some extent by providing a recurring nucience. I liken it to those annoying popup windows you often see in trial software versions. Honestly I was never real happy with it.

#19
Taino

Taino
  • Members
  • 139 messages

Lightfoot8 wrote...

THE NOTORIOUS GENIUS'S RACE RELATIONS
 

That is one of _Guile's names.  He has a lot of them.  I have only read down through the first part of the script,  It has bugs.  If you decide to use it make sure you give it some good testing.  

The thread DM_Venca refferanced and started a long time ago is  Script issue with adjust reputation
I may self have meant to look into it deeper but have not found the time. Messing with the repute 2da has gotten me no where with solving the problem. that is as far sa I got at the time.

Ah I see.. He truely has moved his name around in so many different ways.

I do know that SSE has a faction system in the engine; which uses nwnx. Not sure if I can attach the way it is done in SSE to the Subrace[s] I have in the module.

My whole point towards this is too keep characters aligned through out the module, not forcing them to play their characters in a certain way...

Modifié par Taino, 17 septembre 2011 - 11:02 .