Jump to content

Need help with werewolf ability


Recommended Posts

Hello! I recently released a mod that added a character called Bigby wolf into the game. I want to make him be able to turn into a werewolf when his health drops below thirty. To become human again, he'd have to raise his health back to thirty while in werewolf form.  He would essentially be a werebeaver with a different skin and no log meter. I'm only an amateur coder so I have no idea how to go about doing this. I also used Ipsquiggle's sample character. Thanks!

Link to comment
Share on other sites

@Seiai, So I went into woodie's prefab and copied all of his code that involved the word "werebeaver", and I pasted it into my character's prefab. I also changed anything that said "woodie" into bigby (my character's name.) Now I just get a crash each time I load up the mod. What pieces of woodie's code can I paste into my own to make him a werebeaver?

Link to comment
Share on other sites

@Seiai, So I went into woodie's prefab and copied all of his code that involved the word "werebeaver", and I pasted it into my character's prefab. I also changed anything that said "woodie" into bigby (my character's name.) Now I just get a crash each time I load up the mod. What pieces of woodie's code can I paste into my own to make him a werebeaver?

 

make sure you look up the stategraph as well. BUT also look at your crash log, it should be in something like " Documents/Klei/DoNotStarve" there will be a notepad file in there that just says "log" and it will have the info on your crash. 

 

Somewhere in there it will tell you whats going on. you'll have to find the line of code in your script that coincides with the crash. From there, you can troubleshoot it. If you are a new modder, use the search function in the right hand corner of this forum. I like to run a google search as well, just in case that search function doesnt produce the results I am looking for. 9 times out of 10, someone (probably me) has had the exact same crash, for the exact same reason.

But. crash resolution comes with experience. and if you have none, feel free to post the crash log here, someone will see it, and possibly aid you in the fix. 

Link to comment
Share on other sites

Here's the piece of my crash log that tells about the error, thanks for the help! Also, at the end it says how my texture sizes are wrong, but I can confirm that that's not the problem because my mod was working before I copied and pasted the beaverness script :

LUA ERROR stack traceback:
        =[C] in function 'assert'
        H:/Steam/steamapps/common/dont_starve/data/scripts/mainfunctions.lua(71,1)
        =(tail call) ?
        =[C] in function 'xpcall'
        H:/Steam/steamapps/common/dont_starve/data/scripts/mods.lua(33,1)
        H:/Steam/steamapps/common/dont_starve/data/scripts/mods.lua(294,1) in function 'RegisterPrefabs'
        H:/Steam/steamapps/common/dont_starve/data/scripts/gamelogic.lua(115,1) in function 'LoadAssets'
        H:/Steam/steamapps/common/dont_starve/data/scripts/gamelogic.lua(1153,1) in function 'DoResetAction'
        H:/Steam/steamapps/common/dont_starve/data/scripts/gamelogic.lua(1168,1) in function 'complete_callback'
        H:/Steam/steamapps/common/dont_starve/data/scripts/upsell.lua(27,1) in function 'UpdateGamePurchasedState'
        H:/Steam/steamapps/common/dont_starve/data/scripts/gamelogic.lua(1173,1)
...
        =[C] in function 'GetPersistentString'
        H:/Steam/steamapps/common/dont_starve/data/scripts/saveindex.lua(91,1) in function 'Load'
        H:/Steam/steamapps/common/dont_starve/data/scripts/gamelogic.lua(1189,1) in function 'callback'
        H:/Steam/steamapps/common/dont_starve/data/scripts/playerprofile.lua(574,1) in function 'Set'
        H:/Steam/steamapps/common/dont_starve/data/scripts/playerprofile.lua(458,1)
        =[C] in function 'GetPersistentString'
        H:/Steam/steamapps/common/dont_starve/data/scripts/playerprofile.lua(456,1) in function 'Load'
        H:/Steam/steamapps/common/dont_starve/data/scripts/gamelogic.lua(1188,1) in main chunk
        =[C] in function 'require'
        H:/Steam/steamapps/common/dont_starve/data/scripts/mainfunctions.lua(652,1)
scripts/mods.lua(244,1) Disabling bigby1.1 (Bigby) because it had an error.
scripts/frontend.lua(723,1) SCRIPT ERROR! Showing error screen
scripts/mods.lua(310,1) Mod: bigby1.1 (Bigby)  Registering default mod prefab
scripts/screens/mainscreen.lua(576,1) platform_motd table: 11565F70
SimLuaProxy::QueryServer()
scripts/modindex.lua(85,1) ModIndex: Load sequence finished successfully.
 
Reset() returning
../mods/bigby1.1/images/saveslot_portraits/bigby.tex is 120x104 but compressed textures must have power of 2 dimensions.
../mods/bigby1.1/images/selectscreen_portraits/bigby.tex is 188x284 but compressed textures must have power of 2 dimensions.
../mods/bigby1.1/images/selectscreen_portraits/bigby_silho.tex is 188x284 but compressed textures must have power of 2 dimensions.
HttpClientWriteCallback (0x00451D5C, 1, 1350, 0x06C9F728)
HttpClientWriteCallback READ 1350 (1350 total)
scripts/screens/mainscreen.lua(576,1) platform_motd table: 11565480

scripts/mods.lua(322,1) unloading prefabs for mod MOD_bigby1.1  

Link to comment
Share on other sites

@Seiai, Oops! Here's the stuff before the trace back:

ReleaseAll
ReleaseAll Finished
cGame::StartPlaying
LOADING LUA
DoLuaFile scripts/main.lua
DoLuaFile loading buffer scripts/main.lua
scripts/main.lua(161,1) running main.lua
 
scripts/modindex.lua(320,1) loaded modindex
scripts/modindex.lua(75,1) ModIndex: Beginning normal load sequence.
 
scripts/modindex.lua(248,1) WARNING loading modinfo.lua: gus does not specify if it is compatible with the base game. It may not work properly.
scripts/modindex.lua(251,1) WARNING loading modinfo.lua: gus does not specify if it is compatible with Reign of Giants. It may not work properly.
scripts/modindex.lua(395,1) Could not load mod_config_data/modconfiguration_bigby1.1
scripts/mods.lua(170,1) Loading mod: bigby1.1 (Bigby) (Old API! (mod: 5 game: 6) )
scripts/mods.lua(197,1) Mod: bigby1.1 (Bigby) Loading modworldgenmain.lua
scripts/mods.lua(205,1) Mod: bigby1.1 (Bigby)  Mod had no modworldgenmain.lua. Skipping.
scripts/mods.lua(197,1) Mod: bigby1.1 (Bigby) Loading modmain.lua
LOADING LUA SUCCESS
scripts/playerdeaths.lua(79,1) PlayerDeaths loaded morgue 2354
scripts/playerprofile.lua(480,1) loaded profile
scripts/playerprofile.lua(544,1) bloom_enabled false
scripts/saveindex.lua(99,1) loaded saveindex
scripts/gamelogic.lua(1172,1) OnFilesLoaded()
scripts/gamelogic.lua(1161,1) OnUpdatePurchaseStateComplete
scripts/gamelogic.lua(111,1) FE assets already loaded
scripts/mods.lua(287,1) Mod: bigby1.1 (Bigby) Registering prefabs
scripts/mods.lua(293,1) Mod: bigby1.1 (Bigby)  Registering prefab file: prefabs/bigby
scripts/mods.lua(35,1) error calling LoadPrefabFile in mod bigby1.1 (Bigby): 
...ps/common/dont_starve/data/scripts/mainfunctions.lua:71: Error loading file prefabs/bigby

...mapps/common/dont_starve/data/../mods/bigby1.1/scripts/prefabs/bigby.lua:154: '<eof>' expected near 'return'

 

As for the textures, I exported Ipsquiggle's templates from tex files to jpegs, edited them, and then turned them back into tex files with tex-tools. I think I did it correctly, because I did exactly what that tutorial said to do.

Link to comment
Share on other sites

I did exactly what that tutorial said to do.

nope, u had one of the settings in the tool wrong, when converting them back to tex.

 

@ThaumicParrot

eof means "end of file", so u probably messed something up(bracket- or "end"-problems most likely) that made him think, that the file has to end before the "return" in line 154.

if u cant figure it out, attach bigby.lua.

Link to comment
Share on other sites

...mapps/common/dont_starve/data/../mods/bigby1.1/scripts/prefabs/bigby.lua:154: '' expected near 'return'
 

the file that caused the error is 154 lines long, the file u uploaded is just 54 lines long.

also, u can attach it directly to the post, if u dont use the quickreply(use "More reply options" or modify a post)

Link to comment
Share on other sites

Link to comment
Share on other sites

So I looked at some of those tutorials and happened upon someone who was also trying to get their character to turn a werebeaver. He put this into his character's prefab:

263
264
265
266
267
268
269
inst:ListenForEvent("nighttime", function(global, data)
        if GetClock():GetMoonPhase() == "full" and not inst.components.beaverness:IsBeaver() and not inst.components.beaverness.ignoremoon then
            if not inst.components.beaverness.doing_transform then
                inst.components.beaverness:SetPercent(1)
            end
        end
    end, GetWorld())

So I tried pasting this into my bigby.lua and it didn't work. Here's the log error: 

scripts/playerdeaths.lua(79,1) PlayerDeaths loaded morgue 2354
scripts/playerprofile.lua(480,1) loaded profile
scripts/playerprofile.lua(544,1) bloom_enabled false
scripts/saveindex.lua(99,1) loaded saveindex
scripts/gamelogic.lua(1172,1) OnFilesLoaded()
scripts/gamelogic.lua(1161,1) OnUpdatePurchaseStateComplete
scripts/gamelogic.lua(111,1) FE assets already loaded
scripts/mods.lua(287,1) Mod: bigby1.1 (Bigby) Registering prefabs
scripts/mods.lua(293,1) Mod: bigby1.1 (Bigby)  Registering prefab file: prefabs/bigby
scripts/mods.lua(35,1) error calling LoadPrefabFile in mod bigby1.1 (Bigby): 

...arve/data/../mods/bigby1.1/scripts/prefabs/bigby.lua:52: variable 'inst' is not declared

Link to comment
Share on other sites

...arve/data/../mods/bigby1.1/scripts/prefabs/bigby.lua:52: variable 'inst' is not declared

as it says, inst is not available, u probably put it in the wrong place.

why do u just look in woodies characterfile?

Link to comment
Share on other sites

@Seiai, So I copied all of woodie's code except for his assets and playerreturn stuff and the mod loaded. However, my character was invisible and had no sound, and when I tried to became a werebeaver through commands it zoomed in and did nothing.

There was also no error in the log. Here's the current bigby.lua: 

bigby.lua

Link to comment
Share on other sites

@Seiai, Wow, I should've seen that one coming. So in the woodie's code that I copied, I replaced all the "woodies" with "bigbys". So now Bigby's skin appears, but he still has no sound. I also copied the SGwerebeaver into my mod's stategraphs folder, and I copied the werebeaverbuild and werebeaver_basic into my mod's anim folder. However, When I try to turn into the werebeaver, the same thing happens. This line was in the log many times, does it have anything to do with the problem?: "Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. "

Link to comment
Share on other sites

@ThaumicParrot,

no, it has nothing to do with it.

and u dont have to copy the SG yet, since for the start u just want to make it work with the game's resources. only once u want to make changes to it, u have to copy and rename it.

attach your current characterprefab.

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