Developer ImDaMisterL Posted February 23, 2015 Developer Share Posted February 23, 2015 (edited) I already know how to use Tiled and how to create set pieces but I have 2 questions questions: How do you make character specific set pieces? How do you make a set piece always, no matter what, spawn, but only for said specific character? If anyone knows the answer for these and decides to share their wisdom and knowledge with me then I'd be really grateful ^^ Edited February 23, 2015 by ImDaMisterL Link to comment https://forums.kleientertainment.com/forums/topic/51359-help-help-needed-for-some-special-set-pieces/ Share on other sites More sharing options...
Kzisor Posted February 23, 2015 Share Posted February 23, 2015 @ImDaMisterL, character specific set pieces spawning is only possible in Don't Starve; making this clear up front. In order to make it character specific you have to determine what character they are playing by using the GetPlayer function. Determine if the prefab is the character you're wanting to spawn it with. Once you've done that you can call this function:AddLevelPreInitAny(function(level) if not level.set_pieces then level.set_pieces = {} end level.set_pieces[name] = { count = count, tasks = tasks } end) In order to add your layout to the game you must used the following code:local Layouts = require("map/layouts").Layoutslocal StaticLayout = require("map/static_layout")Layouts[name] = StaticLayout.Get("map/static_layout/[FILE NAME HERE]") Remember to replace name with the name that you want to set the set piece and [FILE NAME HERE] with the name of the file exported as .lua. If you need more assistance please get in touch with me on Steam I'm Ysovuka. Link to comment https://forums.kleientertainment.com/forums/topic/51359-help-help-needed-for-some-special-set-pieces/#findComment-615872 Share on other sites More sharing options...
Developer ImDaMisterL Posted February 23, 2015 Author Developer Share Posted February 23, 2015 @ImDaMisterL, character specific set pieces spawning is only possible in Don't Starve; making this clear up front. In order to make it character specific you have to determine what character they are playing by using the GetPlayer function. Determine if the prefab is the character you're wanting to spawn it with. Once you've done that you can call this function:AddLevelPreInitAny(function(level) if not level.set_pieces then level.set_pieces = {} end level.set_pieces[name] = { count = count, tasks = tasks } end) In order to add your layout to the game you must used the following code:local Layouts = require("map/layouts").Layoutslocal StaticLayout = require("map/static_layout")Layouts[name] = StaticLayout.Get("map/static_layout/[FILE NAME HERE]") Remember to replace name with the name that you want to set the set piece and [FILE NAME HERE] with the name of the file exported as .lua. If you need more assistance please get in touch with me on Steam I'm Ysovuka. I don't think I need anything else, if I do I'll contect you then, thank you so much dude, You're an amazing human being and everyone should be aware of your Additional Set Pieces mod, btw, an amazing mod that is! Link to comment https://forums.kleientertainment.com/forums/topic/51359-help-help-needed-for-some-special-set-pieces/#findComment-615902 Share on other sites More sharing options...
Developer ImDaMisterL Posted February 23, 2015 Author Developer Share Posted February 23, 2015 (edited) @Kzisor Just another question, how do I make the Set Piece always spawn no matter what, do you know how to? Edited February 23, 2015 by ImDaMisterL Link to comment https://forums.kleientertainment.com/forums/topic/51359-help-help-needed-for-some-special-set-pieces/#findComment-615907 Share on other sites More sharing options...
Kzisor Posted February 23, 2015 Share Posted February 23, 2015 @ImDaMisterL, you only need to use the code provided. The difference is don't use the check for character prefab. The set pieces must be added to modworldgenmain.lua file not modmain.lua file. Link to comment https://forums.kleientertainment.com/forums/topic/51359-help-help-needed-for-some-special-set-pieces/#findComment-615916 Share on other sites More sharing options...
Developer ImDaMisterL Posted February 23, 2015 Author Developer Share Posted February 23, 2015 @ImDaMisterL, you only need to use the code provided. The difference is don't use the check for character prefab. The set pieces must be added to modworldgenmain.lua file not modmain.lua file. Thank you again, good sir ^^ Link to comment https://forums.kleientertainment.com/forums/topic/51359-help-help-needed-for-some-special-set-pieces/#findComment-615918 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