inomoz

Delete objects in quest script

Skyrim SE, Newbie in mod making, quest script:

Hi, I'm trying find way to temprorary place objects (alchemy items, like cheese), then wait some time, then delete them.

This code works:

    ObjectReference cheese1 = Game.GetPlayer().PlaceAtMe(Game.GetForm(0x00064b33))
    ....
    ObjectReference cheese3 = Game.GetPlayer().PlaceAtMe(Game.GetForm(0x00064b33))

    utility.wait(5)

    cheese1.Delete()
    ...
    cheese3.Delete()

It's laggy and not optimal..

 

I tryed use some like this

ObjectReference cheeses = Game.GetPlayer().PlaceAtMe(Game.GetForm(0x00064b33), 50)
utility.wait(5)
;cheeses.Disable()
cheeses.Delete()

Not working, object not deleting, as I undesrtand this objects become not unic and I can't delete them?

 

I tried use arrays - no success...

0

Share this post


Link to post
Share on other sites

It doesn't look like you told it WHICH cheese to delete. 

0

Share this post


Link to post
Share on other sites

Posted (edited)

I do something similar, take a look.

 

I have a log fire the player can spawn at their location, after some time the log fire disappears (deletes).

;Called from an activation, can use in a script I guess...
Actor PlayerRef = Game.GetPlayer(); Make an actor variable for the player so we don't have to keep calling it
ObjectReference MyLitLogs = PlayerRef.PlaceAtMe(LitLogs, 1, false, true); places the lit logs, disabled
MyLitLogs.MoveTo(PlayerRef, 0.0, 0.0, PlayerRef.GetHeight() - 137.5, True); translates the lit logs to my prefered location in relation to the player
MyLitLogs.SetAngle(0.0, 0.0, 0.0);Set the angle of the rotation as well...
MyLitLogs.Enable();Enable the logs

;Attached to the LitLogs Reference
Event OnLoad()
	Int BurnTime = Utility.RandomInt(10,180);Set a random extinguish time
	Utility.Wait(BurnTime);wait...
	Self.PlaceAtMe(RS_Item_Ashes, 1);place down ashes
	Self.Delete();remove log fire
EndEvent

Should be able to use something similar to this to get it working.

 

Edited by TripleSixes
0

Share this post


Link to post
Share on other sites

I can't seem to find anyone that can help you. 

Are you doing these tasks for your own fun?  I am asking because I was thinking you could experiment with AREA triggers.

If you are doing it for a task for a story line you could also use dialogue.

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now