SetIsTemporaryNeutral(object, int, float)

From NWN Lexicon
Jump to navigationJump to search
Red bug icon.png Warning: This function has a known bug and may not work as expected in some situations. See Known Bugs for details.

Causes an creature to consider another creature neutral indefinitely or for a fixed time.

void SetIsTemporaryNeutral(
    object oTarget,
    object oSource = OBJECT_SELF,
    int bDecays = FALSE,
    float fDurationInSeconds = 180.0f
);

Parameters

oTarget
The object whose reputation will be altered.
oSource
The creature whose opinion will change. (Default: OBJECT_SELF)
bDecays
If this is TRUE, the neutrality decays over fDurationInSeconds; otherwise it is indefinite. (Default: FALSE)
fDurationInSeconds
This is only used if bDecays is TRUE, it is how long the neutrality lasts. (Default: 180.0f)


Description

Note: This function is currently very bugged (in NWN:EE and NWN) see Known Bugs. For a potential solution use SurrenderToEnemies or SetIsTemporaryFriend.

Make oSource temporarily neutral to oTarget using personal reputation. This will fail if oTarget and oSource are in the same faction or party (Check with GetFactionEqual) as they can never be considered temporarily anything but what the faction in general tells them to think.

Note: If bDecays is TRUE, the personal reputation amount decreases in size over fDurationInSeconds. Neutrality will only be in effect as long as (faction reputation + total personal reputation) > REPUTATION_TYPE_ENEMY and (faction reputation + total personal reputation) < REPUTATION_TYPE_FRIEND.


Remarks

This function does not perform as stated. Instead of move reputation towards the middle, it reduces personal reputation of oTarget in the eyes of oSource by 50.

For a PC and NPC input into the function like so SetIsTemporaryNeutral( PC, NPC ) , a hostile NPC is still hostile to the PC, a friendly NPC is made neutral, and a neutral NPC is rendered hostile.


Known Bugs

As remarked above this function is essentially altering the personal reputation by -50. This is hopeless since:

  • This means it makes currently neutral creatures hostile
  • Hostile creatures can never become neutral
  • Friendly creatures correctly become neutral

It's bizarre - and has been bugged since game release. Bioware tended to use SurrenderToEnemies to make hostile NPCs neutral after a fight.

This has been reported here.

Version

1.62


See Also

functions: 

AdjustReputation | SetIsTemporaryEnemy | SetIsTemporaryFriend

constants: 

REPUTATION_TYPE_* Constants



 author: Tom Cassiotis, editor: Jasperre, additional contributor(s): Jasperre, chrono