Начало и конец боя
StartCombat, "ActorID"
StopCombat
"Actor_ID1"->StartCombat, "ActorID2"
"Actor_ID1"->StopCombat
StartCombat и StopCombat используются для установки актера в режим боя, или для возвращения в нормальное состояние.
StartСombat заставит вызывающего актера атаковать другого актера, установленного в качества аргумента.
В то время, как StopCombat кажется “безопасной” для использования в “каждом кадре”, вы должны устанавливать однократное условие, когда используете команду StartCombat, иначе актер может не делать ничего. Тем не менее, продолжительное использование команды StopCombat очень опасно, так как делает NPC полностью беспомощным: он не будет отвечать на атаки (что, таким образом, дает вам возможность создать настоящего пацифиста…).
После установки в режим боя настройки ИИ актера все равно применяется, например, если у актера высокая установка на бегство, он убежит, не смотря на команду StartCombat.
По этой причине часто можно увидеть, что рейтинг боя (Fight rating) также часто меняется при начале боя во многих скриптах:
If ( GetDeadCount, "My Friend" > 0 )
StartCombat, Player
SetFight, 100
endif
Initiating and ending combat
StartCombat, "ActorID"
StopCombat
"Actor_ID1"->StartCombat, "ActorID2"
"Actor_ID1"->StopCombat
StartCombat and StopCombat are used to set an Actor into combat mode or back into normal mode. Start combat will make the calling Actor attack the Actor supplied as the argument. While StopCombat seems to be "safe" to use "every frame", you should supply a do once condition of some sort when issuing the StartCombat command, otherwise the Actor might not do anything. Nevertheless continuous StopCombat is very dangerous to use, because it makes the NPC completely helpless: it will not retaliate when attacked (which however allows you to create a real pacifist…). Another caution regarding StopCombat is that it stops combat for all actors involved, other than the player.
Once in combat mode the AI settings of the Actor apply normally, e.g. if the Actor has a high flee setting, he will flee despite the StartCombat command. For this reason, you will often see that the Fight rating is also changed when initiating combat in many scripts:
If ( GetDeadCount, "My Friend" > 0 )
StartCombat, Player
SetFight, 100
endif
The same applies to StopCombat: if the actor has a high Fight rating he will go briefly into an idle stance (sheathe weapon or un-ready spell), then quickly enter combat with the player again; to stop combat completely, set the actor's Fight rating to a low value as well.