andhegames Posted April 9, 2015 Share Posted April 9, 2015 Hey, I've been learning a lot about modding, but there's something that I want to do, that I'm not sure is possible. I've looked around, and I haven't been able to find someone who has asked about this. Is it possible to spawn a setpiece next to the character, when the character uses a certain item? For example, the character uses a "Insta-forest" item, and a 6x6 setpiece full of trees appears. Any smart folks who might have an idea how to do this? Thanks! Link to comment https://forums.kleientertainment.com/forums/topic/52741-use-an-item-to-toggle-a-setpeice/ Share on other sites More sharing options...
Mobbstar Posted April 9, 2015 Share Posted April 9, 2015 (edited) You can spawn trees that way, but not a setpiece. EDIT: More precisely, you can repeatedly use the method SpawnPrefab("evergreen") and set every trees position slightly elsewhere. Edited April 9, 2015 by Mobbstar Link to comment https://forums.kleientertainment.com/forums/topic/52741-use-an-item-to-toggle-a-setpeice/#findComment-628409 Share on other sites More sharing options...
andhegames Posted April 9, 2015 Author Share Posted April 9, 2015 Is there a way to remove a certain nearby prefab, so I can toggle the spawn on and off, to make portible items, like a science machine that you can spawn and despawn at the use of a item?Thanks for the help! Link to comment https://forums.kleientertainment.com/forums/topic/52741-use-an-item-to-toggle-a-setpeice/#findComment-628414 Share on other sites More sharing options...
Mobbstar Posted April 9, 2015 Share Posted April 9, 2015 Is there a way to remove a certain nearby prefab, so I can toggle the spawn on and off, to make portible items, like a science machine that you can spawn and despawn at the use of a item?Thanks for the help! Yes, you can assign a variable to a prefab when you're spawning it, and it's simple to remove a prefab. inst.mything = SpawnPrefab("researchlab")inst.mything:Remove() The only difficulty I can think of is the player quitting when the prefab is still existing. It'd probably suffice to force-undo it when quitting. (I had in mind setting "persists" to false, so it doesn't get saved, and the item would simply set itself to full when loading) Link to comment https://forums.kleientertainment.com/forums/topic/52741-use-an-item-to-toggle-a-setpeice/#findComment-628422 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now