Jump to content

[Help] Turfed mod (need coding help/tips)


Recommended Posts

So I have been working on this mod called Turfed! It's a custom turfs mod that adds new turfs to the game. I don't know exactly what I am doing (mostly copy/paste, trial and error) and I could use some help with it if anyone would be so kind. I have it working pretty well but I have a few issues:

 

1. I don't know how to keep the new carpets on top of other flooring. They go underneath the other flooring types. So I am having an issue understanding turf layering and could use advice on how to fix that.

 

2. I don't know how to change the sound when walking on my custom turf types. (Wood sound for wood etc)

 

3. I know the game has the turfs all in one file, would I be able to do that too, or do I have to stick to the multiple prefabs?

 

If anyone would take a look and see if they can help me with the coding/how to understand it better I would really appreciate it. =)

 

Thank you!!

 

The mod:

http://steamcommunity.com/sharedfiles/filedetails/?id=514078314

Link to comment
Share on other sites

1- You can use 

stuff.AnimState:SetLayer(LAYER_YOU_WANT)

you will find the list of layers in constants.lua. I think you should use LAYER_WORLD_BACKGROUND?

Then you can adjust the ordering with 

stuff.AnimState:SetOrder(number)

If you want it to be on top of anything, I think that 5 should be enough (i never saw something which use a SetOrder above 3 but I may be wrong.

 

2- Well, there is a tutorial how to use FMOD on the DS forum, made by Cheerio.

 

3- You can put all your turfs in the same lua file. Let's say you have in your lua file two turfs with their constructor functions

local function turf1fn()do your stuffsendlocal function turf2fn()do your other stuffsend

then just put more than one stuff in the return

return Prefab("whatever/turf1", turf1fn, assets, prefabs),          Prefab("whatever/turf2", turf2fn, assets, prefabs)
Edited by ZupaleX
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...