Difference between revisions of "Kill"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>Bnesmith
imported>QQuix
(Added a note about enabling and killing in the same frame)
 
(9 intermediate revisions by 6 users not shown)
Line 1: Line 1:
'''Syntax:'''
'''Syntax:'''
  Kill ''actorID (optional)''
  [ActorID.]Kill ''actorID (optional)''


Kills the actor. Note that the actor's health may still be above zero, because  
Kills the actor. Note that the actor's health may still be above zero, because  
this function doesn't kill by modifying the health.  
this function doesn't kill by modifying the health.  


Essential actors will be made "unconscious" (in their normal temporary "dead" state).


Essential actors will be made "unconscious" (in their normal temporary "dead" state).
The optional actorID parameter tells the system which actor is reponsible for the death. This is of primary importance in crimes and in triggering the [[OnDeath]] block when it uses its optional actorID parameter.
 
== Notes ==
 
* If you have a script that does a "kill" on an actor who is already dead, extra Death Items may get added to the corpse.
* Enabling and killing an actor in the same frame may cause problems (e.g. floating corpse).
 
== Use in Crime Detection ==
 
The Kill command is unique because it allows you to assign someone as "guilty". This is invaluable as it allows scripters to trigger the game's crime detection code, which cannot be accessed by script any other way.
 
The most common way to do this is to have a dummy disabled NPC tucked away somewhere, and at the appropriate moment, the script can use [[MoveTo]] on him, and then use [[Kill]] with the optional parameter to make nearby NPCs react naturally to the attack. He can then be [[Resurrect|resurrected]] and moved away again for repeated use.
 
In order to get the victim himself to respond correctly, it may be necessary to use [[SetActorValue]] [[Responsibility]].
 
The crime need not be murder, though initially a murder will be triggered. Use [[ModCrimeGold]] and [[ModPCMiscStat]] to change the murder into another crime with a different bounty.


Note, however, that if the player has never murdered someone before, the Dark Brotherhood quest may be triggered by this trick. There is currently no work-around for this unfortunate side-effect. The use of this trick should be mentioned in the readme, and it may be appropriate to link to the [http://tesnexus.com/downloads/file.php?id=14127 Stop Dark Brotherhood] mod to allow players to ignore this side-effect.


The optional actorID parameter tells the system which actor is reponsible for the death. This is of primary importance in crimes and in triggering the [[OnDeath]] block when it uses it's optional actorID parameter.
== See Also ==
* [[Resurrect]]


[[Category: Functions]]
[[Category: Functions]]
[[Category: Statistics Functions]]
[[Category: Functions (CS)]]
[[Category: Functions (CS 1.0)]]
[[Category: Actor Functions]]
[[Category: Actor Functions (CS 1.0)]]
[[Category: Crime Functions]]
[[Category: Crime Functions (CS 1.0)]]

Latest revision as of 04:01, 12 November 2017

Syntax:

[ActorID.]Kill actorID (optional)

Kills the actor. Note that the actor's health may still be above zero, because this function doesn't kill by modifying the health.

Essential actors will be made "unconscious" (in their normal temporary "dead" state).

The optional actorID parameter tells the system which actor is reponsible for the death. This is of primary importance in crimes and in triggering the OnDeath block when it uses its optional actorID parameter.

Notes[edit | edit source]

  • If you have a script that does a "kill" on an actor who is already dead, extra Death Items may get added to the corpse.
  • Enabling and killing an actor in the same frame may cause problems (e.g. floating corpse).

Use in Crime Detection[edit | edit source]

The Kill command is unique because it allows you to assign someone as "guilty". This is invaluable as it allows scripters to trigger the game's crime detection code, which cannot be accessed by script any other way.

The most common way to do this is to have a dummy disabled NPC tucked away somewhere, and at the appropriate moment, the script can use MoveTo on him, and then use Kill with the optional parameter to make nearby NPCs react naturally to the attack. He can then be resurrected and moved away again for repeated use.

In order to get the victim himself to respond correctly, it may be necessary to use SetActorValue Responsibility.

The crime need not be murder, though initially a murder will be triggered. Use ModCrimeGold and ModPCMiscStat to change the murder into another crime with a different bounty.

Note, however, that if the player has never murdered someone before, the Dark Brotherhood quest may be triggered by this trick. There is currently no work-around for this unfortunate side-effect. The use of this trick should be mentioned in the readme, and it may be appropriate to link to the Stop Dark Brotherhood mod to allow players to ignore this side-effect.

See Also[edit | edit source]