Jump to content

[HELP] Help needed for some special set pieces!


Recommended Posts

  • Developer

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

@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

  • Developer

@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

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.

×
  • Create New...