Jump to content

Need help with alot of different things


Recommended Posts

Okay, so i need help (again) with a couple of things. If you know how to do any one these things, please tell me c:

Thank you.

 

I need help with:

 

How to make a character not visible

How to make a character not visible to mobs

How to freeze a character how a couple of seconds

How to place a way point and then teleport back to it (with a button or something, doesn't really matter how)

How to play the insanity sounds without the character being insane

How to spawn a "statue" of the player in the sleeping animation

How to make a character temporally not being able to interact with tings (not being able to pick things up or cut down trees)

 

 

 

Link to comment
Share on other sites

How to make a character not visible How to make a character not visible to mobs

See the files for shadow creatures. "..\scripts\prefabs\shadowcreature.lua"

 

 

How to freeze a character how a couple of seconds

I'm assuming you mean frozen in ice or something, not the winter-caused freezing. See the freezable component. "..\scripts\components\freezable.lua"

 

 

How to place a way point and then teleport back to it (with a button or something, doesn't really matter how)

See the purple staff's code. "..\scripts\prefabs\staff.lua" (look for "PURPLE STAFF")

 

 

How to play the insanity sounds without the character being insane

"..\scripts\prefabs\player_common.lua"

inst.SoundEmitter:PlaySound("dontstarve/sanity/gonecrazy_stinger")
How to spawn a "statue" of the player in the sleeping animation

 

Hmm. This one might be a little more complicated. You could possibly make a prefab with the same animation files as the original prefab, but without the player controls and such.

 

 

How to make a character temporally not being able to interact with tings (not being able to pick things up or cut down trees)

Modify the player controller's functions. "..\scripts\components\playercontroller.lua"

(Replacing the OnControl function should work)

Use this to modify a component.

local function component_modify_fn(inst)    -- ...endAddComponentPostInit("component_name", component_modify_fn)

Edit: Also have a look at this tutorial. Might be helpful for a lot of the things you need.

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...