Skip to content
nyfrk edited this page Feb 3, 2022 · 2 revisions

ISettlers4Api::ChangeGoodPriority method

Change the transportation priority of a good type in a specific eco sector. This is usually the event that is issued by the player when changing the order in the goods side menu panel.

Syntax

BOOL ISettlers4Api::ChangeGoodPriority(
	S4_GOOD_ENUM good,
	INT offset, 
	DWORD ecosector
	DWORD player
);

Parameters

good

The good type you want to change the priority. See S4_GOOD_ENUM for a list of possible good types.

offset

This parameter specifies how many positions the priority is increased or decreased. Use negative values to increase the priority and use positive values to decrease the priority. Usually you would specify -1 or 1 to change the priority one step higher or lower.

ecosector

The eco sector identifier to change the priority 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 5029.

When changing the priority of a good the game usually outputs multiple events at the same tick to make sure that a swap occurs with the priority of another good.

Requirements

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

See also

ISettlers4Api

ISettlers4Api::ChangeGoodDistribution

Clone this wiki locally