# GetMaterialCount

Landscape
Material
4.6.5.0 CP
int
int material_index Material index
Returns the amount of the specified material found in the landscape.
A returns value of -1 indicates that no valid result could yet be determined. Valid results are not available during the first 500 frames of the round or if NoScan is enabled in the scenario core. Results are updated only roughly every 500 frames - inbetween updates values will remain unchanged.
/* Spielziel erfüllt? */ public func IsFulfilled() { // Gold noch nicht gezählt? if ((var gold_count=GetMaterialCount(Material("Gold")))==-1) return(); // noch zu viel? if (gold_count >= 150) return(); // noch Goldstücke abzubauen? return(!ObjectCount(Gold)); }
Script taken from goldmine game goal (GLDM).
Material
wipfmetz
2002-08