PDA

View Full Version : Quick Scripting Question


goldberry
09-07-2006, 12:56 PM
Does anyone have a "Die" Script I can use to make an NPC just fall over and die when a conversation ends?

I thought it was Destroy_Self or something, but that might have been another game I was modding XD.

stoffe
09-07-2006, 01:02 PM
Does anyone have a "Die" Script I can use to make an NPC just fall over and die when a conversation ends?

I thought it was Destroy_Self or something, but that might have been another game I was modding XD.

Assuming that the NPC to die is the one you are conversing with, something like this should work if you place it on the last dialog node:


void main() {
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDeath(), OBJECT_SELF);
}

goldberry
09-07-2006, 01:35 PM
Thank you stoffe. That's perfect.

goldberry
09-07-2006, 03:25 PM
I have another question.

I want a dialog option to only appear if i have an item (to prevent spoilers for my mod, i will say "item_x"). How would I go about this? None of the decompiled scripts mention this, and I'm having difficulty working it out myself.

ChAiNz.2da
09-07-2006, 03:34 PM
I believe there is a generic "c_hasitem" conditional script you can use in the scripts.bif directory (using KotOR Tool).

(though you may want to wait and hear from a real scripter.. hehehe).. ;)

stoffe
09-07-2006, 03:49 PM
(though you may want to wait and hear from a real scripter.. hehehe).. ;)

The self-professed unreal scripter (:p) is correct, the above mentioned standard script will return true (i.e. allow the node to show) if an item with the tag you specify as string parameter for the dialog node's conditional script you're running it from. It will check both equipped items on the main character and items in the party inventory, but not items equipped on party members other than the main character.

goldberry
09-07-2006, 04:26 PM
okay, thanks alot.

...Self-Professed unreal scripter XD