Interface: IXR_relation_registry
Source
namespace relation_registry
Remarks
Community ids are resolved through the engine community registry. Invalid names follow the native registry rules.
Methods
change_community_goodwill()
change_community_goodwill(
this: void,
from_community: string,
to_object_id: number,
delta_goodwill: number): void;Change relation from community to object by delta_goodwill.
Parameters
| Parameter | Type | Description |
|---|---|---|
this | void | - |
from_community | string | Source community id. |
to_object_id | number | Target object id. |
delta_goodwill | number | Goodwill delta to apply. |
Returns
void
Remarks
Applies the delta to the current goodwill, then clamps the result to community_goodwill_limits.
community_goodwill()
community_goodwill(
this: void,
from_community: string,
to_object_id: number): number;Get goodwill from a community to an object.
Parameters
| Parameter | Type | Description |
|---|---|---|
this | void | - |
from_community | string | Source community id. |
to_object_id | number | Target object id. |
Returns
number
Stored community goodwill.
Remarks
Returns neutral goodwill when no explicit community-to-object value is stored.
community_relation()
community_relation(
this: void,
from_community: string,
to_community: string): number;Get relation between two communities.
Parameters
| Parameter | Type | Description |
|---|---|---|
this | void | - |
from_community | string | Source community id. |
to_community | string | Target community id. |
Returns
number
Relation points between communities, usually between -5000 and 5000.
Remarks
Reads the global community relation matrix, not per-object goodwill.
get_general_goodwill_between()
get_general_goodwill_between(
this: void,
from_object_id: number,
to_object_id: number): number;Get relation from object to actor. Return formula looks like personal_goodwill + community_to_obj_goodwill + community_to_community_goodwill.
Parameters
| Parameter | Type | Description |
|---|---|---|
this | void | - |
from_object_id | number | Object from. |
to_object_id | number | Object to. |
Returns
number
General goodwill from object to another object based on personal and community goodwill.
Remarks
Both object ids must resolve to ALife trader objects. Non-trader objects log a script error and return 0.
set_community_goodwill()
set_community_goodwill(
this: void,
from_community: string,
to_object_id: number,
goodwill: number): void;Set goodwill from a community to an object.
Parameters
| Parameter | Type | Description |
|---|---|---|
this | void | - |
from_community | string | Source community id. |
to_object_id | number | Target object id. |
goodwill | number | New goodwill value. |
Returns
void
Remarks
The engine clamps the stored value to community_goodwill_limits.
set_community_relation()
set_community_relation(
this: void,
from_community: string,
to_community: string,
goodwill: number): void;Set relation between two communities.
Parameters
| Parameter | Type | Description |
|---|---|---|
this | void | - |
from_community | string | Source community id. |
to_community | string | Target community id. |
goodwill | number | New community relation value. |
Returns
void
Remarks
Updates the global community relation matrix.