Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

Delete objects in quest script


inomoz
 Share

Recommended Posts

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...

Link to comment
Share on other sites

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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...