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.

Aphid98

Need help making special powers

Recommended Posts

Aphid98    1

So I have been trying to make a character mod, and I wanted to give him special powers. His name is Cole and he is a dragonborn, I want to make him be able to breath fire. I was thinking that i could use the red gem staff fireball ability somehow but I don't know how... If anyone can help it would be much appreciated. :wickerbottomthanks:

Share this post


Link to post
Share on other sites
Aphid98    1

Sorry for being so infrequent with my questions... But I have found the fire staff bin files and i don't have a bin code editor so i cant see the code. I'm looking for a way to make my character shoot a fireball as if he was holding  the fire staff but when he isn't... Please tell me if that doesn't make sense :friendly_wink:  

Share this post


Link to post
Share on other sites
Coski    67

Wow... did you make that picture on your profile? Because it is amazing...

 

you can ask this in my profile feed.

and no , I didn't make that picture.

Share this post


Link to post
Share on other sites
Aphid98    1

Now i have the problem where whenever i enable the mod it says that the mod "failed to run last time and has been disabled" and then i can't click any of the buttons and have to close the game... If you need further information quote me and ask

Share this post


Link to post
Share on other sites
Aphid98    1

@Aphid98

In you log:

firebreath.lua:141: unexpected symbol near '<eof>'

Check line 141. If you don't find the problem, post the file.

OK found that error, now a new one has occurred. I have the new log here as welllog.txt

Share this post


Link to post
Share on other sites
Blueberrys    172

@Aphid98

In your log:

...ommon/dont_starve/data/scripts/widgets/crafttabs.lua:249: table index is nilLUA ERROR stack traceback:        .../scripts/widgets/crafttabs.lua(249,1) in function 'DoUpdateRecipes'        .../scripts/widgets/crafttabs.lua(189,1) in function 'OnUpdate'        .../scripts/frontend.lua(538,1) in function 'Update'        .../scripts/update.lua(46,1)

See if you can figure this one out too. Check what's going on in crafttabs.lua at line 249.

 

It's quite easy finding these errors in your log yourself, just press ctrl+f and type "error".

 

Edit: Remember, crafttabs isn't causing the error, your mod is. You need to figure out what your mod does with crafttabs that causes this.

Share this post


Link to post
Share on other sites
Aphid98    1

@Aphid98

In your log:

...ommon/dont_starve/data/scripts/widgets/crafttabs.lua:249: table index is nilLUA ERROR stack traceback:        .../scripts/widgets/crafttabs.lua(249,1) in function 'DoUpdateRecipes'        .../scripts/widgets/crafttabs.lua(189,1) in function 'OnUpdate'        .../scripts/frontend.lua(538,1) in function 'Update'        .../scripts/update.lua(46,1)

See if you can figure this one out too. Check what's going on in crafttabs.lua at line 249.

 

It's quite easy finding these errors in your log yourself, just press ctrl+f and type "error".

 

Edit: Remember, crafttabs isn't causing the error, your mod is. You need to figure out what your mod does with crafttabs that causes this.

I cant find it... Can you? here is the file:

P.S: Thank you for your help! :joyous:

firebreath.lua

Share this post


Link to post
Share on other sites
Blueberrys    172

@Aphid98 Er wait, your file has:

return Prefab("common/inventory/firestaff", red, assets, prefabs)

I don't think you're trying to re-make the firestaff. Change the prefab name.

return Prefab("firebreath", red, assets, prefabs)

-

And uh.. what are you trying to make exactly, a fire staff that shoots fire breath? Why is it craftable at all? Don't you want the character to be able to breathe fire, not craft and shoot it? I think you would only need the fire_projectile parts, not the rest of the firestaff code.

Share this post


Link to post
Share on other sites
Blueberrys    172

@Aphid98 You might need to make a component that handles it which you can attach to the player. See how the projectile is being used in the red staff, and check the weapon component's relevant code. Then you can bind the functionality to a key, or however you want to activate it.

Share this post


Link to post
Share on other sites
Blueberrys    172

@Aphid98 Binding the key is probably the easiest part. See if you can make the component first.

Ideally, you would also have a modified or custom stategraph that can play a firebreathing animation when the fireball is launched, or it would just come out of nowhere.

 

To bind a key, use one of the AddKey_Handler's in TheInput. (See input.lua)

Example:

TheInput = GLOBAL.TheInputlocal key = GLOBAL.KEY_G -- See constants.lua for all keys/codeslocal function PrintHi()    print("hi")endTheInput:AddKeyDownHandler(key, PrintHi)

This prints "hi" to the console when you press "g".

Share this post


Link to post
Share on other sites