Knight_Shield wrote...
Here is the ABort conversation script so far .
void main()
{
object oPC = GetPCSpeaker();
object oTarget = GetLocalObject(oPC,"INVISIBLE_SPEAKER");
SetIsDestroyable(TRUE);
DestroyObject(oTarget);
}
I set it to usable to see but not plot .
Just was looking at lexicon ..it says something abut it works better with the Delay function. Does this make sense?
Yes, it does. DestroyObject is often better done with a short delay, like this, on a terminal node of the conversation:
- DelayCommand(2.0,DestroyObject(oTarget));
(EDIT: As lighftoot8 reminded me there's a delay parameter built into the DestroyObject command itself, so you don't need to use DelayCommand. I just checked the Lexicon and discovered that object destruction via DestroyObject automatically waits until the script completes anyway. So the delay precautions I've been taking weren't needed after all. Learn something new every day.
'>
When you start a conversation between the PC and a character or object, the conversation's scripts run on that character or object (as OBJECT_SELF). You don't want to run a script that immediately destroys the object that's running the script and the conversation until you give both a chance to end gracefully first.
Modifié par AndarianTD, 28 juillet 2010 - 12:39 .