Skip to content
nyfrk edited this page Aug 29, 2020 · 1 revision

ISettlers4Api::GarrisonWarriors method

Garrison a building. This makes a military building to search nearby units and when found command them to enter the specified building to completely occupy all spots in the building.

Syntax

BOOL ISettlers4Api::GarrisonWarriors(
	DWORD building, 
	DWORD player
);

Parameters

building

The index of the building to garrison. The player should own this building. Usually this is a military building like a guard tower.

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

To garrison a specific unit to a specific building use ISettlers4Api::SendWarriors and specify the coordinates of the target building.

Requirements

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

See also

ISettlers4Api

ISettlers4Api::UnGarrisonWarriors

ISettlers4Api::SendWarriors

Clone this wiki locally