LoadScenarioSection

Category: Global
Since engine version: 4.9.6.0 CR

Description

Loads a section from the scenario. For further information, take a look at Sven2's (german) explanation, a german tutorial in the CNDG-Forumor another german tutorial in the CNDG-Forum.

Syntax

bool LoadScenarioSection (string szSection, int dwFlags);

Parameters

szSection:
Name of the section without Sect. Example: The name for the section SectTunnel.c4g is "Tunnel". The name of the main section is "main".
dwFlags:
Flags telling which parts of the section should be saved to later be restored when returning to the current section. The following flags are defined:
Name Value Description
C4SECT_SaveLandscape 1 Changes in the landscape should be saved.
C4SECT_SaveObjects 2 Objects should be saved.
C4SECT_KeepEffects 4 Global Effects are being saved.

Remark

Objects should be deactivated before changing the section via SetObjectStatus and reactivated afterwards.
It's important to keep in mind that the object position will stay the same after changing the section. Thus, it is possible that objects are being removed after changing the section because they are then positioned outside of the landscape borders. To mitigate this, it may be required to change the object positions before changing the section.
See also: SetObjectStatus
Fulgen / Clonk Wiki, Juli 2016