-
Notifications
You must be signed in to change notification settings - Fork 5
ISettlers4Api
nyfrk edited this page Feb 2, 2022
·
4 revisions
Applications use the methods of the ISettlers4Api interface to configure hooks to the Settlers 4 game to draw overlays, intercept user input or extend the game.
The ISettlers4Api interface inherits from the IUnknown interface. ISettlers4Api also has these types of members:
The ISettlers4Api interface has these methods.
Method | Description |
---|---|
Misc | |
ISettlers4Api::GetDebugData | Get data for debugging purposes. |
ISettlers4Api::GetLastError | Get the last error of a API method for the calling thread. |
ISettlers4Api::GetMD5OfModule | Compute the MD5 of a specified module. |
ISettlers4Api::IsEdition | Get the edition of the game. |
Hooks | |
ISettlers4Api::RemoveListener | Unregister a Listener. Call this method to remove a previously registered listener. |
ISettlers4Api::AddUIFrameListener | Register a frame listener whose callback will be called whenever a frame gets rendered while a certain UI element is visible to the user. Use this to extend existing in game menus. |
ISettlers4Api::AddFrameListener | Register a frame listener whose callback will be called whenever a frame get rendered. |
ISettlers4Api::AddMapInitListener | Register a map initialization listener whose callback will be called whenever a map is loaded. |
ISettlers4Api::AddMouseListener | Register a mouse button listener whose callback will be called whenever mouse buttons or the mouse wheel is triggered. |
ISettlers4Api::AddSettlerSendListener | Register a settler send listener whose callback will be called whenever the player commands units. |
ISettlers4Api::AddTickListener | Register a tick listener whose callback will be called whenever a tick is being processed. The game runs at 14 ticks per second (gamespeed 1x). |
ISettlers4Api::AddLuaOpenListener | Register a listener whose callback will be called whenever the game calls its lua_open function. |
ISettlers4Api::AddBltListener | |
ISettlers4Api::AddEntityListener | |
ISettlers4Api::AddGuiBltListener | |
UI | |
ISettlers4Api::GetHwnd | Get the HWND of the game window. |
ISettlers4Api::GetHoveringUiElement | Get the UI element that the cursor is currently hovering over. |
ISettlers4Api::IsCurrentlyOnScreen | Check whether a specified element is currently on screen. |
ISettlers4Api::ShowMessageBox | Show a in-game rendered message box. |
ISettlers4Api::CreateCustomUiElement | Add a in-game custom ui element to a specified menu or panel. |
ISettlers4Api::DestroyCustomUiElement | Destroy a custom ui element or in-game rendered message box. |
ISettlers4Api::HideCustomUiElement | Hide a custom ui element or in-game rendered message box. |
ISettlers4Api::ShowCustomUiElement | Show a custom ui element or in-game rendered message box. |
Remote player Actions | |
ISettlers4Api::SendWarriors | Create a movement command and append it to the event queue. |
ISettlers4Api::BuildBuilding | Start a new construction site for a building. |
ISettlers4Api::CrushBuilding | Destroy a building, regaining some of its resources. |
ISettlers4Api::ToggleBuildingPriority | Toggle the priority of a building being constructed. |
ISettlers4Api::ToggleBuildingHalt | Pause or unpause the work of/on a building. |
ISettlers4Api::SetBuildingWorkarea | Change the work area of a building. |
ISettlers4Api::SetBuildingProduction | Configure what goods a smith should produce. |
ISettlers4Api::SetBuildingProductionPercentMode | Change the production mode of a weapon smith. |
ISettlers4Api::SetBuildingProductionPercentage | Change the production percentage of a weapon smith. |
ISettlers4Api::CastSpell | Let a priest cast a spell. |
ISettlers4Api::GarrisonWarriors | Move nearby units into a guard tower. |
ISettlers4Api::UnGarrisonWarriors | Eject units from guard towers. |
ISettlers4Api::ChangeGoodDistribution | Change the distribution percentage of goods. |
ISettlers4Api::ChangeGoodPriority | Change the transportation priority of goods. |
ISettlers4Api::RecruitWarriors | Recruit warriors or specialists. |
ISettlers4Api::SetTradingRoute | Set the destination market or harbor for a market or harbor. |
ISettlers4Api::TradeGood | Configure what goods are traded by a harbor or market. |
ISettlers4Api::StoreGood | Configure what goods a storage shall store. |
Local Player | |
ISettlers4Api::IsObjectOfType | Check whether a object in the world is of a certain type. |
ISettlers4Api::ClearSelection | Clear the current selection. |
ISettlers4Api::GetSelection | Get the current selection. |
ISettlers4Api::RemoveSelection | Remove units from the current selection. |
ISettlers4Api::SetMaxSelection | Set the maximum amount of settlers the player can select. |
ISettlers4Api::GetMaxSelection | Get the maximum amount of settlers the player can select. |
ISettlers4Api::StartBuildingPlacement | Start the placement of a new building. |
ISettlers4Api::RevealWorldMap | Remove the fog of war. |
ISettlers4Api::SetZoom | Change the zoom level. |
ISettlers4Api::ShowTextMessage | Show a message in the bottom left notification box. |
ISettlers4Api::GetPlayerTribe | Get the tribe of a player. |
ISettlers4Api::GetLocalPlayer | Get the identifier of the local player. |
Scripting | Functions derived from lua scripting engine |
ISettlers4Api::SettlersAdd | Spawn settlers. |
ISettlers4Api::SetWorldCursor | Set the world cursor to a specific location. |
ISettlers4Api::DeleteWorldCursor | Remove the world cursor. |
ISettlers4Api::BuildingsAdd | |
ISettlers4Api::BuildingsAmount | |
ISettlers4Api::BuildingsCrush | |
ISettlers4Api::BuildingsDelete | |
ISettlers4Api::BuildingsExistsBuildingInArea | |
ISettlers4Api::BuildingsGetFirstBuilding | |
ISettlers4Api::BuildingsGetInhabitantAmount | |
ISettlers4Api::BuildingsGetTarget | |
ISettlers4Api::BuildingsIsSelected | |
ISettlers4Api::DarkTribeAddManakopter | |
ISettlers4Api::DarkTribeFlyTo | |
ISettlers4Api::AIActivate | |
ISettlers4Api::MakeDark | |
ISettlers4Api::MakeGreen | |
ISettlers4Api::EffectsAdd | |
ISettlers4Api::ArePlayerAreasConnected | |
ISettlers4Api::GameDefaultGameEndCheck | |
ISettlers4Api::DisableLastNPlayersInStatistic | |
ISettlers4Api::EnableLandExploredCheck | |
ISettlers4Api::FindAnyUnit | |
ISettlers4Api::GetAmountOfTreesInArea | |
ISettlers4Api::GetDifficulty | |
ISettlers4Api::GetNumberOfSquaresWithDarkLand | |
ISettlers4Api::GetOffenceFightingStrength | |
ISettlers4Api::HasPlayerLost | |
ISettlers4Api::IsAlmostAllLandExplored | |
ISettlers4Api::IsAreaDarkLand | |
ISettlers4Api::IsAreaGreen | |
ISettlers4Api::IsAreaOwned | |
ISettlers4Api::GetNumberOfPlayers | |
ISettlers4Api::GetPlayerTribe | |
ISettlers4Api::ResetFogging | |
ISettlers4Api::SetAlliesDontRevealFog | |
ISettlers4Api::SetFightingStrength | |
ISettlers4Api::ShowClock | |
ISettlers4Api::Time | |
ISettlers4Api::GoodsAddPileEx | |
ISettlers4Api::GoodsAmount | |
ISettlers4Api::GoodsDelete | |
ISettlers4Api::GoodsGetAmountInArea | |
ISettlers4Api::MagicCastSpell | |
ISettlers4Api::MagicIncreaseMana | |
ISettlers4Api::MapAddDecoObject | |
ISettlers4Api::MapDeleteDecoObject | |
ISettlers4Api::MapSize | |
ISettlers4Api::MapPointIsOnScreen | |
ISettlers4Api::MapSetScreenPos | |
ISettlers4Api::SettlersAddToFerry | |
ISettlers4Api::SettlersAmount | |
ISettlers4Api::SettlersAmountInArea | |
ISettlers4Api::SettlersIsSelected | |
ISettlers4Api::SettlersKillSelectableSettlers | |
ISettlers4Api::SettlersProductionAmount | |
ISettlers4Api::SettlersSetHealthInArea | |
ISettlers4Api::StatisticBuildingsCaptured | |
ISettlers4Api::StatisticGoodsProduced | |
ISettlers4Api::StatisticLandOwnedByPlayer | |
ISettlers4Api::StatisticManaCollected | |
ISettlers4Api::StatisticMushroomFarmsDestroyed | |
ISettlers4Api::StatisticServantsFreed | |
ISettlers4Api::StatisticSpellsCast | |
ISettlers4Api::StatisticUnitsDestroyed | |
ISettlers4Api::ClearMarker | |
ISettlers4Api::PressButton | |
ISettlers4Api::SelectNextBuilding | |
ISettlers4Api::SetMarker | |
ISettlers4Api::VehiclesAdd | |
ISettlers4Api::VehiclesAddWheelerToFerry | |
ISettlers4Api::VehiclesAmount | |
ISettlers4Api::VehiclesAmountInArea | |
ISettlers4Api::VehiclesGetFerryCargoInArea | |
ISettlers4Api::VehiclesGetHealth | |
ISettlers4Api::VehiclesIsSelected | |
ISettlers4Api::VehiclesKill | |
ISettlers4Api::SetGround | |
Entity | |
ISettlers4Api::EntityGetClass | |
ISettlers4Api::EntityGetPosition | |
ISettlers4Api::EntitygGetDirection | |
ISettlers4Api::EntityGetHealth | |
ISettlers4Api::EntityGetMaxHealth | |
ISettlers4Api::EntityGetTribe | |
ISettlers4Api::EntityTreeGetType | |
ISettlers4Api::EntityPileGetType | |
ISettlers4Api::EntityDecoGetType | |
ISettlers4Api::EntityPileGetAmount | |
ISettlers4Api::EntitySettlerGetType | |
ISettlers4Api::EntityVehicleGetType | |
ISettlers4Api::EntityAnimalGetType | |
ISettlers4Api::EntityBuildingGetType | |
ISettlers4Api::EntityStoneGetLevel | |
ISettlers4Api::EntityGetRole | |
ISettlers4Api::EntitygGetRoleClass | |
ISettlers4Api::EntitygGetOwner | |
Landscape | |
ISettlers4Api::LandscapeGetHeight | |
ISettlers4Api::LandscapeGetType | |
ISettlers4Api::LandscapeIsPond | |
ISettlers4Api::LandscapeIsDarkLand | |
ISettlers4Api::LandscapeIsDarkLandBorder | |
ISettlers4Api::LandscapeGetFogOfWar | |
ISettlers4Api::LandscapeIsFoundingStone | |
ISettlers4Api::LandscapeGetResource | |
ISettlers4Api::LandscapeSetResource | |
ISettlers4Api::LandscapeGetObject | |
ISettlers4Api::LandscapeGetOwner |
The ISettlers4Api interface is obtained by calling S4ApiCreate the function.
This interface, like all COM interfaces, inherits the IUnknown interface methods.
The LPSETTLERS4API type is defined as pointer to the ISettlers4Api interface.
typedef interface ISettlers4Api *LPSETTLERS4API;
Minimum API Level | 1 |
Target Edition | Any |
Header | S4ModApi.h |
Library | S4ModApi.lib |
DLL | S4ModApi.dll |