Jump to content

Need help with ocarina!

Recommended Posts

So I'm trying to make a character who spawns with an ocarina that kinda works like a pan flute. I'm trying to use the code from TheDanaAddams' 'Link the Hero' mod, but I'm having trouble. I tried to transfer the item to my character but now it just crashes the game! Does anyone know how to pick items from other mods? I could use all the help I can get!

Link to comment
Share on other sites


did u text-search through the mod and transfer everything ocarinarelated to your mod?

and it would probably be easier to just make it yourself off of the panflute. (u should at least make the artwork yourself anyway, just taking that too from another mod is kinda meh)

how do u want it to work?

post your logfile if u want help with crashes.

also: http://forums.kleientertainment.com/topic/50773-guide-modding-practices-introduction-to-modding/

Link to comment
Share on other sites

Well, I'd like an ocarina that puts mobs to sleep for half the time that a pan flute does, at the cost of 15 sanity points to the player per use. I did text search everything but I'm having trouble knowing exactly where all that code goes. 

And thank you for the tutorial, I'll have to take a look at it. It wasn't my first plan to just take someone elses code and use it as my own, but alas I am desperate to finish this character and I needed some help. Hopefully this will do, thank you so much!

Link to comment
Share on other sites


just take the panflutecode from the game itself, rename it to your own prefab(still just using the panflute animfile), and change the OnHeardFn(in the panflute they assigned a function HearPanFlute to it) to your needs.

then also add a onplayed(instrument, musician) function to the instrument-component to create the sanityloss.

and once that works, create your own animfile.

also, pple wont mind if u take code from other mods, as long as u at least make the artwork yourself and dont completely copy other mods.

and feel free to ask if u need further help.

Link to comment
Share on other sites

I'm sorry, but would you mind breaking that down just a little bit more? I'm having trouble finding which code to use from what file where it goes exactly and what part of it to add the functions to. Right now I'm in panflute.lua, do I rename all the 'panflute' to 'ocarina'? And where exactly is the instrument component that I need to put in the function to create sanity loss? Is it in the panflute.lua? (Also how do I input sanity loss?) I'm also having trouble trying to make it indestructible and spawn in my inventory. Forgive me, I'm terrible at coding and I'm doing the best I can. 

Link to comment
Share on other sites

I rename all the 'panflute' to 'ocarina'

except for the 2 lines for the animation(until u make your own ofc).



where exactly is the instrument component


use filesearch in the datafolder of the game.



I'm also having trouble trying to make it indestructible

well, look through panflute.lua and have guess, what exactly in there makes it destructible. its not hard to guess :razz:



spawn in my inventory

look in the code of other characters that start with inventory, like willow. 


and i suggest give that a really thorough read, u should know all the above things if u had closely read any basic tutorial for programming lua and DS: 



Link to comment
Share on other sites


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