Prop Gallery

If you liked this item, please rate it up on Steam Workshop page.

Author: Geneosis

Last revision: 8 Oct, 2023 at 13:16 UTC

File size: 939.01 KB

On Steam Workshop

Description:

Found some cool prop? Save them to your gallery and load them back any time, anywhere!

Now in v3.0.0! (see full patch notes)

Thanks to Zooi for the image capture and display code, Λutumn for the code samples and YuLun for the spawn placement tool 😉

TOOLS
– Prop Capture: Save props in your gallery, load them back at will.

KEYBOARD CONTROLS
[LeftClick]: Save prop at cursor.
[MiddleClick]: Select / deselect prop.
[K]: Clear selection.
[Shift]+[LeftClick]: Delete prop.
[O]: Open Gallery (+ options).

CHARACTERISTICS
– Only single shapes can be saved in the Gallery (not complex or articulated objects).
– Props saved in the Gallery can be loaded any number of times, on any map.
– You can rename props in the Gallery after saving them.
– To capture a group of props, your cursor must be on one of them.
– Loaded group props will stick together as a single entity.
– The delete action can delete any object, not only those spawned from the Gallery.
– Using delete when multiple props are selected will delete all of them.
– If you save a static object in the gallery, it will become a dynamic prop when loading it.
– Some of the properties of the prop are retained (like explosive or unbreakable).

KNOWN BUGS
– The preview pictures looks crappy: yes.
– The texture of the props is not saved: This is a limitation of current modding API.
– I increased the preview resolution and now my game lags: reduce it and delete the props taken with that resolution from your gallery.
– When using the delete action on a vehicle part, the whole vehicle will be deleted: This is a limitation of current modding API.

DEV NOTES

Originally posted by About this mod:

This idea came straight from one of my mod comments by a player names Kousoulakis 🙂 After clarifying what he was looking for, it turned out that a prop gallery was not something that can be found on the workshop already, and yet it is made possible by the latest updates of the game, so I felt like I could do it.
When thinking about object library, I had in mind some preview images, and I remembered seeing some other modder playing with that on Discord so I checked if anyone published something similar on the workshop and ended up finding Zooi’s Working Instant Film Camera which was a great help for me to get a picture of the objects to save in the gallery ^^
Other than that most of the rest of the code is from my Omni Gun mod, except that instead of making copies of the object immediately, I save the data of the object in the registry as several json objects, then when the player wants to spawn it I load them back and create the new object with that data.
Then my last struggle with this mod came from being able to spawn the prop copy at the same location away from player than where the picture was taken… I was trying some complicated stuff with quaternion here that I had trouble to get to work >_< Fortunately Λutumn accepted to share some code sample with me that had a much simple solution using the TransformToLocalTransform() and TransformToParentTransform() functions 😉