#RequireContext CSmMapType #Include "TextLib" as TextLib #Include "Libs/Nadeo/Anchor.Script.txt" as Anchor #Include "MathLib" as MathLib declare Text Rules; Void UpdateValidability () { declare Integer[Integer] NumberOfSpawns = [1 => 0, 2 => 0]; declare Integer NumberOfPoles = 0; foreach (Data in AnchorData) { switch (Data.Tag) { case "Spawn": { if (Data.Order == 1) NumberOfSpawns[1] += 1; if (Data.Order == 2) NumberOfSpawns[2] += 1; } case "Goal": { NumberOfPoles += 1; } } } if (NumberOfPoles != 1) { ValidationStatus = CSmMapType::ValidationStatus::NotValidable; ValidabilityRequirementsMessage = _("SpawnAttack / SpawnDefense , Gate 1 to 9 [ don't forget to apply 'Gate' name to Checkpoints ! ] and one Goal [ I didn't try to do multiple Goals ]"); return; } ValidationStatus = CSmMapType::ValidationStatus::Validated; } main () { UpdateValidability(); Rules = "SpawnAtk / SpawnDef , Gate 1 to 9 [ don't forget to apply 'Gate' name to Checkpoints ! ] and one Goal [ I didn't try to do multiple Goals ]"; while (True) { yield; foreach(Event in PendingEvents) { if(Event.Type == CPluginEvent::Type::MapModified) { UpdateValidability(); } } } }