Developer ImDaMisterL Posted February 23, 2015 Developer Share Posted February 23, 2015 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 ^^ Link to comment 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 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 Share on other sites More sharing options...
Developer ImDaMisterL Posted February 23, 2015 Author Developer Share Posted February 23, 2015 @Kzisor Just another question, how do I make the Set Piece always spawn no matter what, do you know how to? Link to comment 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 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 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.