Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

Death by scripting?

Page: 1 of 1
 Malxados
02-09-2009, 7:08 PM
#1
I was wondering if/how you can kill someone using script attached to dialog (or any easier way) (example: Bob has been injured in a recent fight. When you talk to him, he will ask you to tell his wife he loved her. As soon as he's finished asking, he dies)

Malxados
 Star Admiral
02-09-2009, 7:46 PM
#2
Yes, you can. Use the DestroyObject() function. It would look something like this.

void main() {
object oKill = GetObjectByTag( "persontokill" );
AssignCommand( oKill, ClearAllActions() );
SetCommandable( FALSE, oKill );
DestroyObject( oKill, 1.00 );
}

"persontokill" should be replaced with the tag of the creature in question. The 1.00 in DestroyObject() is a delay before deletion, so that the creature doesn't immediately disappear. You should use this script only at the very end of the dialog, else bad things might happen.

- Star Admiral
 Malxados
02-09-2009, 8:08 PM
#3
Thanks Star Admiral for the fast reply. Would his body still be in the ground as normal, or would it disappear. (Example: would I have to make a script to have Bob give me a note for his wife, or would I be able to put the note in his inventory and take it from his dead body?)
 Star Admiral
02-09-2009, 8:51 PM
#4
His body would fade away, so if you want to him to give a note, it will have to be by scripting.

- Star Admiral
Page: 1 of 1