Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

[KotOR] Determining Hostility

Page: 1 of 1
 JoFlashStudios
06-09-2011, 3:49 PM
#1
For a mod I'm working on, I need to determine in a script if the PC is hostile, friendly, or neutral toward a creature. Unfortunately, I can't find a GetFaction() function or the equivalent. I've tried GetReputation(), but a check with my character as oSource and a hostile character as oTarget is returning values over 10, which doesn't match the documentation. (below) Am I just using GetReputation() incorrectly, or is there some other way to determine this?


// 208: Get an integer between 0 and 100 (inclusive) that represents how oSource
// feels about oTarget.
// -> 0-10 means oSource is hostile to oTarget
// -> 11-89 means oSource is neutral to oTarget
// -> 90-100 means oSource is friendly to oTarget
// * Returns -1 if oSource or oTarget does not identify a valid object

int GetReputation(object oSource, object oTarget);
 JoFlashStudios
06-23-2011, 12:49 PM
#2
*Update*

I've figured out that GetReputation() works fine everywhere but the place I'm using it - k_def_death01. I'm trying to detect all deaths and act based on faction. Does anyone have a way around GetReputation()? Apparently it wasn't made to work with death scripts.
 Dark_Ansem
06-23-2011, 3:14 PM
#3
you managed also to add new factions?
 JoFlashStudios
06-24-2011, 12:51 AM
#4
No, not new factions - I'm just trying to work with the existing ones.
Page: 1 of 1