Skip to content

ChangeGoodDistribution

nyfrk edited this page Aug 29, 2020 · 2 revisions

ISettlers4Api::ChangeGoodDistribution method

Change the good distribution percentages of the products of a building type in a specific eco sector. This is usually the event that is issued by the player when changing the distribution percentages in the goods side menu panel.

Syntax

BOOL ISettlers4Api::ChangeGoodDistribution(
	S4_OBJECT_TYPE good,
	S4_OBJECT_TYPE building, 
	INT percent, 
	DWORD ecosector
	DWORD player
);

Parameters

good

The good type you want to change the distribution percentage. See ISettlers4Api::IsObjectOfType for a list of possible good types.

building

The building type you want to receive the goods. See ISettlers4Api::IsObjectOfType for a list of possible building types. The building should be able to consume the good specified in the good parameter.

percent

The percent of the goods that shall be delivered to the specified building type.

ecosector

The eco sector identifier to change the distribution for.

player

The player who issues the command. Use 0 (zero) to issue this event as the local player.

Return value

If this method could append the event successfully it will return TRUE. If an error occurred it will return FALSE.

Remarks

The corresponding network event id of the command is ID 5028.

The game usually outputs multiple events at the same tick to make sure that the percentages for a good sums up to 100.

Requirements

Minimum API Level 1
Target Edition Any
Header S4ModApi.h
Library S4ModApi.lib
DLL S4ModApi.dll

See also

ISettlers4Api

ISettlers4Api::ChangeGoodPriority

Clone this wiki locally