Jump to content

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
https://forums.kleientertainment.com/forums/topic/54762-need-help-with-ocarina/
Share on other sites

@HoodedFirefly,

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/

Edited by Seiai

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!

@HoodedFirefly,

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.

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. 

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: 

http://forums.kleientertainment.com/topic/25850-wots-the-diff-prefabs-components-stategraphs-and-brains/

http://forums.kleientertainment.com/topic/50811-guide-modding-practices-series-index/

Edited by Seiai

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
×
  • Create New...