Skip to content

SetBuildingProductionPercentage

nyfrk edited this page Aug 29, 2020 · 1 revision

ISettlers4Api::SetBuildingProductionPercentage method

Change the production percentages of a building. Usually this is used for weapon smiths to change the percentage of swords, bows, armors and other weapons.

Use ISettlers4Api::SetBuildingProductionPercentMode to enable the percentage mode for a building.

Syntax

BOOL ISettlers4Api::SetBuildingProductionPercentage(
	DWORD building, 
	BYTE swords, 
	BYTE bows, 
	BYTE armors, 
	BYTE racespecialweapons,
	DWORD player
);

Parameters

building

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

swords

The percentage for the sword production. Must be a value in the range 0..100.

bows

The percentage for the bows production. Must be a value in the range 0..100.

armors

The percentage for the armor production. Must be a value in the range 0..100.

racespecialweapons

The percentage for the racespecialweapons production. Must be a value in the range 0..100. If not applicable (e.g. player is playing the Roman tribe) this should be 0 (zero).

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

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.

The percentages of swords, bows, armors and racespecialweapons (if applicable) should add up to be exactly 100.

Requirements

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

See also

ISettlers4Api

ISettlers4Api::SetBuildingProduction

ISettlers4Api::SetBuildingProductionPercentMode

Clone this wiki locally