Fractal Softworks Forum

Starsector => Mods => Modding => Topic started by: JDCollie on April 26, 2014, 11:40:32 AM

Title: How does .isNeutralFaction() work?
Post by: JDCollie on April 26, 2014, 11:40:32 AM
I am curious if anyone knows what values the method .isNeutralFaction() evaluates in determining if a faction is indeed neutral? The API didn't help me any, and I seriously know almost nothing about Java, so anything anyone could tell me would help a lot :D
Title: Re: How does .isNeutralFaction() work?
Post by: LazyWizard on April 26, 2014, 11:47:15 AM
I believe it just checks if it's the 'neutral' faction. This faction doesn't actually exist, it's just used for things like the abandoned station that no faction owns.

If you want to check if something's actually neutral towards you, you'd use
Code: java
if (fleet.getFaction().getRelationship("player") == 0f)
Title: Re: How does .isNeutralFaction() work?
Post by: JDCollie on April 26, 2014, 01:58:27 PM
I believe it just checks if it's the 'neutral' faction. This faction doesn't actually exist, it's just used for things like the abandoned station that no faction owns.

If you want to check if something's actually neutral towards you, you'd use
Code: java
if (fleet.getFaction().getRelationship("player") == 0f)
Do you happen to know if it evaluates membership based upon the faction id? I have unplesant suspicion that it does, but I don't know how to make a program to test it myself.