JediArchivist 70 Posted April 16, 2020 I am making a mod where I need the Ancient Droid from the Dantooine Ruins (the one you talk to before facing the trials) to despawn. I am using this script: Quote void main() { ActionPauseConversation(); object oGoodbye; oGoodbye = GetObjectByTag("dan15_ancientdrd"); SetGlobalFadeOut(1.0, 0.5); DelayCommand(1.0, DestroyObject(oGoodbye)); DelayCommand(1.0,SetGlobalFadeIn(0.7,0.0)); ActionResumeConversation(); } I worked with this script before and had no problems with it, it always despawned the required character properly! I triple-checked and the proper character tag is dan15_ancientdrd. Maybe it isn't woring because the Ancient Droid is actually needed in order to open the doors in the Dantooine Ruins, so that is why it won't despawn? Attaching the script files below: bye_ancientdrd.ncs bye_ancientdrd.nss Quote Share this post Link to post Share on other sites
DarthParametric 3,777 Posted April 16, 2020 You can try running SetIsDestroyable on it first. You also don't need to use DelayCommand with fade ins/outs, as the first term already specifies the delay. Try this: void main() { object oDroid = GetObjectByTag("dan15_ancientdrd", 0); ActionPauseConversation(); SetGlobalFadeOut(0.0, 0.5); AssignCommand(oDroid, SetIsDestroyable(TRUE, FALSE, FALSE)); DelayCommand(1.0, DestroyObject(oDroid, 0.0, TRUE)); SetGlobalFadeIn(2.0, 0.5); ActionWait(2.5); ActionResumeConversation(); } When using DestroyObject, you'll typically want to enable the No Fade option (second term) when doing a quick off-screen destroy. Any terms left out will inherit the default values on compile. Check out nwscript.nss for more info. 1 Quote Share this post Link to post Share on other sites
JediArchivist 70 Posted April 16, 2020 On 16 aprilie 2020 at 6:29 PM, DarthParametric said: You can try running SetIsDestroyable on it first. You also don't need to use DelayCommand with fade ins/outs, as the first term already specifies the delay. Try this: void main() { object oDroid = GetObjectByTag("dan15_ancientdrd", 1); ActionPauseConversation(); SetGlobalFadeOut(0.0, 0.5); AssignCommand(oDroid, SetIsDestroyable(TRUE, FALSE, FALSE)); DelayCommand(1.0, DestroyObject(oDroid, 0.0, TRUE)); SetGlobalFadeIn(2.0, 0.5); ActionWait(2.5); ActionResumeConversation(); } When using DestroyObject, you'll typically want to enable the No Fade option (second term) when doing a quick off-screen destroy. Any terms left out will inherit the default values on compile. Check out nwscript.nss for more info. Thanks for the script. I tried it out but unfortunately it still does not despawn the Ancient Droid. I believe the Droid is somehow hard-coded into the game since it is as essential plot character, and there is no way to despawn him, all the other characters that I despawned with my script were non plot-essential... Quote Share this post Link to post Share on other sites
DarthParametric 3,777 Posted April 17, 2020 10 hours ago, JediArchivist said: I believe the Droid is somehow hard-coded into the game No, that's not how it works at all. The problem you had is that the droid is indeed set to non-destroyable by its OnSpawn script. I then made a mistake in the script I posted above, using the wrong nth creature - 1 instead of 0. So it should be: object oDroid = GetObjectByTag("dan15_ancientdrd", 0); Your original bit for that would have worked, since you omitted it and it would default to 0. You just lacked the required setting it to destroyable first. Here's a test with fade enabled so you can see it working. 1 Quote Share this post Link to post Share on other sites
JediArchivist 70 Posted April 17, 2020 On 17 aprilie 2020 at 7:13 AM, DarthParametric said: No, that's not how it works at all. The problem you had is that the droid is indeed set to non-destroyable by its OnSpawn script. I then made a mistake in the script I posted above, using the wrong nth creature - 1 instead of 0. So it should be: object oDroid = GetObjectByTag("dan15_ancientdrd", 0); Your original bit for that would have worked, since you omitted it and it would default to 0. You just lacked the required setting it to destroyable first. Thank you, that actually worked! you have my gratitude! Have a great weeend! Quote Share this post Link to post Share on other sites