Jump to content

Portable Furniture


dlobo1999

Recommended Posts

Hi Guys...



I just wanted to know how to create portable furniture in skyrim.


what i mean to say, is i want a furniture that when you sneak and activate it, it disappears, and a MISC item of the same name gets added to your inventory, and if you drop the misc item,sneak and activate it, it disappears, and in its place the furniture item that you can use.



eg; i have a rolled-up bedroll mesh, and i want to be able to carry that bedroll around.


Also portable crafting tools that can be used for smithing.



Link to comment
Share on other sites

  • 3 years later...

You need to create custom misc objects matching each furniture object you want to be able to move if you want them to appear at distinct objects in inventory. You then need to decide if you want to be able to move arbitrary furniture or specifically crafted furniture (but either is possible). If you're working with specific furniture items provided by your mod you just need scripts on both the furniture items and the misc items to handle the swapping. If you want it to work on original game furniture you can use a Perk to detect and override the normal activate when you're sneaking. The perk's script can then identify the specific furniture object and place the matching misc object in the player's inventory. A script on the misc object can then deal with placing the appropriate furniture object back into the world at some other location.

 

Here are simple scripts I use on a personal mod for a craftable, portable bedroll.

 

 

ScriptName CDC_BedrollFurnitureScript extends ObjectReference

Event OnGrab()
	Disable()
	PlayerRef.AddItem(CDC_BedrollToken, 1)
	Delete()
EndEvent

MiscObject Property CDC_BedrollToken Auto
Actor Property PlayerRef Auto
ScriptName CDC_BedrollTokenScript extends ObjectReference

Actor Property PlayerRef Auto
Furniture Property CDC_Bedroll Auto

Event OnContainerChanged(ObjectReference dest, ObjectReference src)
	if !dest && src == PlayerRef
		Disable()
		ObjectReference newRef = PlayerRef.PlaceAtMe(CDC_Bedroll, 1, false, true)
		float angle = PlayerRef.GetAngleZ()
		newRef.SetAngle(0, 0, angle);
		newRef.MoveTo(PlayerRef, Math.Sin(angle) * 100, Math.Cos(angle) * 100, 0, false)
		newRef.SetActorOwner(PlayerRef.GetBaseObject() as ActorBase) ; player should own it
		newRef.Enable()
		Delete()
	endif
EndEvent

 

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...