Skip to content

SetBuildingProductionPercentMode

nyfrk edited this page Aug 29, 2020 · 1 revision

ISettlers4Api::SetBuildingProductionPercentMode method

Change the production mode of a building. There exists two production modes: automatic infinite production with percent or only by players exact orders. Usually weapon smiths allow for this mode so that you can change the percentage of bows or swords to produce.

Use ISettlers4Api::SetBuildingProductionPercentage to change the percentages for each good the building can produce.

Syntax

BOOL ISettlers4Api::SetBuildingProductionPercentMode(
	DWORD building, 
	BOOL enable,
	DWORD player
);

Parameters

building

The index of the building to change the production mode. The player should own this building.

enable

if TRUE the production mode will be changed to infinite with percent mode. If FALSE this feature will be disabled and the player has to specify the amount themselves or using the ISettlers4Api::SetBuildingProduction method.

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 5035.

Usually the production for a building is distributed over all buildings of the same type in the eco sector of the specified building. So this command actually changes the eco sectors production goals.

Requirements

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

See also

ISettlers4Api

ISettlers4Api::SetBuildingProduction

ISettlers4Api::SetBuildingProductionPercentage

Clone this wiki locally