MatthiosArcanus Posted February 12, 2016 Share Posted February 12, 2016 Hey, good morning everyone!This is more of a curiosity than a question, I suppose. I noticed that when the pause menu is up and I'm placing objects via script, they place much faster (I can tell because of PapyrusUtil's PrintConsole function.) I would assume this is because the game is, well, paused. I was wondering if there are ways to replicate that functionality.Thanks, and take care! Link to comment Share on other sites More sharing options...
sLoPpYdOtBiGhOlE Posted February 12, 2016 Share Posted February 12, 2016 I'm not sure if I'm understanding your question. But for spawning multiple items in game via script then maybe take a look at SKSE functions for SpawnerTask.They alllow you to que up multiple items to be spawned all in one go. For example I use it to spawn a Shack made up of around 30 pieces in one frame.All the pieces of the shack spawn at the same time in the game. Link to comment Share on other sites More sharing options...
Staff BigBizkit Posted February 12, 2016 Staff Share Posted February 12, 2016 Does this apply or is there a similar function to facilitate batch enabling? I noticed the game has problems enabling numerous objects (one enable parent, loads of enable children) at once, rarely resulting in some enable children not being enabled. Link to comment Share on other sites More sharing options...
sLoPpYdOtBiGhOlE Posted February 12, 2016 Share Posted February 12, 2016 (edited) If SKSE had batch enable and disable and moveto and translateto it would be awesome, but alas it doesn't. The SpawnTask functions are their own entity, not related to parent/child relationship. They can cause a very slight frame freeze since it spawns all the items you have queued in 1 frame.But what ever you tell it to spawn in the queue it spawns reqardless in one go. I actually also us it in my own version of bookshelf script.Instead of books lining up one at a time, all the books plop on the shelf in one go together. Edited February 12, 2016 by sLoPpYdOtBiGhOlE Link to comment Share on other sites More sharing options...
Staff BigBizkit Posted February 12, 2016 Staff Share Posted February 12, 2016 I actually also us it in my own version of bookshelf script.Instead of books lining up one at a time, all the books plop on the shelf in one go together.That gets rid of some annoyance when the books line up one after another. Would you mind sharing the code? Link to comment Share on other sites More sharing options...
sLoPpYdOtBiGhOlE Posted February 13, 2016 Share Posted February 13, 2016 (edited) I can share the code, but I doubt it'll do you any good unless you write it to suite your own needs. The bookshelf scripts I mentioned are for a custom in game spawnable and movable invisible bookshelf that is made from 3 pieces per shelf.i have my own managemnet to spawn, select, move or delete my invisible bookshelves in game on the fly as wanted or needed. eg: you spawn my shelf and it displays a translucent bookshelf custom marker just for visual indentifcation of where the shelf is.You move it to where you want (eg; on a table or an actual shelf etc) and deselct it.From there the shelf works pretty much the same as a normal bookshelf in appearance at least.There is no limit to how many sheves can be spawned and they com in 2 sizes, 11 books or 17 books.Also supports ingots and scrolls. i created the 3 nif models that make an invisible bookshelf in blender and then added custom collision in NifSkope. 1st nif is an invisible inside out box that houses the books and also allows the player to pick books up from the shelf without enter the bookshelf container.This would be the equivilent of the multiple Undefined layer collision cubes that you suuround the vanilla bookshelf when making it in CK.This custom nif makes it so you have a 1 piece collision surround to keep books on the shelf and can be spawned dynamically at runtime in the game.The bookshelf script is attached to this model.When the model initiates it creates the other components of the shelf.The script also contains functions that can be called to move the other components of the shelf while moving the main model. 2nd nif is a custom invisible, non colidable container which serves as the activator and storage for the shelf.This is created when the 1st nif spawned. 3rd nif is a invisible trigger box that sitts inside the 1st nif model and it is created when the 1st model is spawned.This is so when a user removes a book from the shelf without entering the container, so the items in the container get updated to reflect the book has been removed. So basically the code is tied in with what I'm doing and could not just be straight out used on a standard shelf without rewriting it to suite. Initially I made it as a part of another mod I had intended to release, but decided against releasing it.But that's another story...lol Edited February 13, 2016 by sLoPpYdOtBiGhOlE Link to comment Share on other sites More sharing options...
MatthiosArcanus Posted February 15, 2016 Author Share Posted February 15, 2016 Oh my, apologies I only just now got around to checking this! Regardless, thanks for the responses. =-)I really should elaborate more when I first pose a question... Anyways, SloppyDotBigHole (hopefully I got that right,) I think you blew my mind, lol.I never knew such a batch function existed, but wow, that's most likely exactly what I'm looking for. Does the Creation Kit Wiki house that information? I've never seen that mentioned on there. Link to comment Share on other sites More sharing options...
sLoPpYdOtBiGhOlE Posted February 16, 2016 Share Posted February 16, 2016 For a brief examples of SKSE SpawnTask functions... Open in in your text editor: \Skyrim\Data\Scripts\Source\SpawnerTask.pscYou can find a commented out example of it's use in the header. SpawnerTask.psc is part of SKSE 1.7.3 Link to comment Share on other sites More sharing options...
MatthiosArcanus Posted February 16, 2016 Author Share Posted February 16, 2016 Ah, so it's all just documented in the source files itself, got it. =-)I tested that function, and while it showed potential, it's still a little slow for my liking. After a fair amount of searching, though, I think a finally found the answer: multithreading.I'll be finding out if I possess the knowledge to implement such a thing, and will report back with my findings. Link to comment Share on other sites More sharing options...
Recommended Posts