Skip to content

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()

ts
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

ParameterTypeDescription
thisvoid-
from_communitystringSource community id.
to_object_idnumberTarget object id.
delta_goodwillnumberGoodwill delta to apply.

Returns

void

Remarks

Applies the delta to the current goodwill, then clamps the result to community_goodwill_limits.


community_goodwill()

ts
community_goodwill(
   this: void, 
   from_community: string, 
   to_object_id: number): number;

Get goodwill from a community to an object.

Parameters

ParameterTypeDescription
thisvoid-
from_communitystringSource community id.
to_object_idnumberTarget object id.

Returns

number

Stored community goodwill.

Remarks

Returns neutral goodwill when no explicit community-to-object value is stored.


community_relation()

ts
community_relation(
   this: void, 
   from_community: string, 
   to_community: string): number;

Get relation between two communities.

Parameters

ParameterTypeDescription
thisvoid-
from_communitystringSource community id.
to_communitystringTarget 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()

ts
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

ParameterTypeDescription
thisvoid-
from_object_idnumberObject from.
to_object_idnumberObject 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()

ts
set_community_goodwill(
   this: void, 
   from_community: string, 
   to_object_id: number, 
   goodwill: number): void;

Set goodwill from a community to an object.

Parameters

ParameterTypeDescription
thisvoid-
from_communitystringSource community id.
to_object_idnumberTarget object id.
goodwillnumberNew goodwill value.

Returns

void

Remarks

The engine clamps the stored value to community_goodwill_limits.


set_community_relation()

ts
set_community_relation(
   this: void, 
   from_community: string, 
   to_community: string, 
   goodwill: number): void;

Set relation between two communities.

Parameters

ParameterTypeDescription
thisvoid-
from_communitystringSource community id.
to_communitystringTarget community id.
goodwillnumberNew community relation value.

Returns

void

Remarks

Updates the global community relation matrix.