Remove an object with a script?

Post » Wed Dec 30, 2009 7:12 pm

I have a book that once clicked on it needs to dissapear.

Is there a way to remove the book completely from the game world?

I know how to use disable and MoveTo to move an object to an empty cell, but is that the only way?
User avatar
Tammie Flint
 
Posts: 3336
Joined: Mon Aug 14, 2006 12:12 am

Post » Wed Dec 30, 2009 9:40 pm

You could move the item to a container then do RemoveAllItems on the container.
User avatar
Matt Fletcher
 
Posts: 3355
Joined: Mon Sep 24, 2007 3:48 am

Post » Wed Dec 30, 2009 2:13 pm

You could move the item to a container then do RemoveAllItems on the container.

Would the item need to be a ref to do that?

Is there a way to use a script On Activate that adds the item I clicked on to into my inventory? Then I can move it to a chest.

I'm just trying to get around the issue of having Ref's for my book, as I may need many many refs where as having the item added to the world then removed would be much easier to do.
User avatar
Eibe Novy
 
Posts: 3510
Joined: Fri Apr 27, 2007 1:32 am

Post » Wed Dec 30, 2009 12:58 pm

Add this script to the book:

ScriptName blablalBegin OnAdd player  set wait to 1EndBegin GameMode  if wait < 10    set wait to wait + 1  else    RemoveMe  endifEnd


You can't remove the book immediately, because that could cause a CTD.
User avatar
Marquis T
 
Posts: 3425
Joined: Fri Aug 31, 2007 4:39 pm


Return to IV - Oblivion