SCRMaps
/
Sign in

Giving a boss behaviour

Re-issue orders to keep it in line, and change phase by health.

3 min read

StarCraft's built-in AI is not what you want for a boss - it idles or wanders off. You keep it in line by re-issuing an order on a timer.

Trigger {
	players = {P8},
	conditions = {
		Command(P8, AtLeast, 1, "Boss Unit");
		Deaths(P8, AtLeast, 120, "BossTimer");
	},
	actions = {
		SetDeaths(P8, SetTo, 0, "BossTimer");
		Order("Boss Unit", P8, "Anywhere", Patrol, "Boss Path");
		PreserveTrigger();
	},
}
Patrol usually beats Move: Move stops on arrival, while Patrol keeps engaging whatever it meets on the way.

Phases by health make a fight feel designed. You cannot read hit points directly, but you can act on units below a threshold.

Trigger { -- 보스가 약해지면 지원군을 부른다
	players = {P8},
	conditions = {
		Command(P8, AtLeast, 1, "Boss Unit");
		Switch("Boss Phase 2", NotSet);
		Deaths(P8, AtLeast, 1, "BossHurt");
	},
	actions = {
		SetSwitch("Boss Phase 2", Set);
		CreateUnit(6, "Zerg Zergling", "Boss Room", P8);
		DisplayText("\x13\x06보스가 지원군을 불렀습니다");
	},
}

There is no PreserveTrigger here on purpose - phase two should happen once. The switch makes that certain.

Sign in to track your progress