• Content Count

  • Joined

  • Last visited

 Content Type 




Klei Bug Tracker

Game Updates

Hot Lava Bug Reporter

Posts posted by Foxrai

  1. You should learn at least basics of lua, to understand what are you doing in general.


    I must say I read tutorials, lua-wikis, guides etc. Still it's NOT my world. maybe you guys won't understand but I'm not the type of person who loves sitting by informatic-rubbish. That's why I'm asking..


    And - back to the beginning -

    element is an artefact introduced by the forums' search feature. You'll need to remove all of that. It should just be SetCarnivore (true).


    I STARTED from carnivore. But carnivore doesn't work anymore.

  2. local eater = inst.components.eater   if TUNING.LIGHTNING_GOAT_DAMAGE then     --RoG code     eater:SetDiet({ FOODGROUP.OMNI }, { FOODTYPE.MEAT }) else     --non-RoG code     eater:SetCarnivore(true) end   eater.ignoresspoilage = true


    Now error is related to this:


    74: function arguments expected near '<'

    LUA ERROR stack traceback:
            =[C] in function 'assert'
            =(tail call) ?
    where line 74 is:
    eater:Set<span class="searchlite">Carnivore</span>(true)

  3. Hello,

    I'll try to be short here. There is part of the code:



    local eater = inst.components.eater
    eater.ignoresspoilage = true
    changed into:
    local eater = inst.components.eater
    eater:SetDiet({ FOODGROUP.OMNI }, { FOODTYPE.MEAT })
    eater.ignoresspoilage = true
    and the error it gave me is:
    71: attempt to call method 'SetDiet' (a nil value)
    Additional questions: 

    1. Do I need ROG-enabled checking code or not at all? 

    2. Are those parts of code in correct lua now? Or that should be changed as well?

    sorry if that's stupid... And yea, I've read forums about food types, but guess I'm just blind if there was an answer 

  4. So I've pretty much completed my mod, it runs single player fine, I've given a friend the mod file and they've put it in their mod folder and the game runs fine for them when I host a server and us two play together.


    Then when I put my custom weapon 'chainsword' in the player inventory, the game crashes, there's apparently an error in line 265 of the modmain.lua, regarding my custom weapon. Everything else works fine but there's a problem with loading the weapon. The weapon loads when I play alone. Please help!



    So as I assume your mod works fine on Don't Starve (or ROG) but not on DS Together. That's normal. DS and DST aren't literraly the same. Suggesting searching forums for differences between DS and DST codes. Or - also handy way - download a mod of someone else which has version for DS and DST. And compare differences in the code. 


    For example: in DS you put recipe in character.lua. In DST you put recipes in modmain.lua. See? 


    @Foxrai, Just delete all the lines that deal with IsRecipeValid. They're not needed anymore.

    You don't even need to add require("widgets/widgetutil").


    Then, assuming you're using the same code as rezecib, replace v.tagneeded = true with v.builder_tag ="_builder":

    local sortkey = -9000for k,v in pairs(recipes) do    sortkey = sortkey - 1    v.sortkey = sortkey    v.builder_tag ="_builder"end

    Alternatively, you could directly specify the tag in the Recipe definition:

    Recipe(<name>, {<ingredients>}, <tab>, <level>, nil, nil, nil, nil, "<name>_builder")


    I went the shorter way  ;) Worked fine! Thank you guys! All FIXED with:


    Recipe(<name>, {<ingredients>}, <tab>, <level>, nil, nil, nil, nil, "<name>_builder")

  6. It seems the original IsRecipeValid got moved in the last update. It's now in widgets/widgetutil.lua. Try adding GLOBAL.require("widgets/widgetutil") in your modmain.


    Um... So I add it for example after this? 

    local require = GLOBAL.requirelocal STRINGS = GLOBAL.STRINGSlocal Recipe = GLOBAL.Recipelocal RECIPETABS = GLOBAL.RECIPETABSlocal TECH = GLOBAL.TECHlocal resolvefilepath = GLOBAL.resolvefilepath

    and on the end adding line: (?)



    and deleting at all this:

    if not GLOBAL.TheNet:IsDedicated() then    local OldIsRecipeValid = GLOBAL.IsRecipeValid    local function IsRecipeValid(recipe)        return OldIsRecipeValid(recipe) and            ((GLOBAL.ThePlayer and GLOBAL.ThePlayer:HasTag("_builder")) or not recipe.tagneeded)    end    GLOBAL.IsRecipeValid = IsRecipeValidend 

    Or what else? 

    Sorry guys I'm kinda clueless if it comes to coding :/

  7. Here is the error I encountered today. Note that YESTERDAY (!?) everything was working just fine. None of the files or codes have been changed. Just... suddenly an error came.


    Seems to be about these in the modmain:

    if not GLOBAL.TheNet:IsDedicated() then    local OldIsRecipeValid = GLOBAL.IsRecipeValid    local function IsRecipeValid(recipe)        return OldIsRecipeValid(recipe) and            ((GLOBAL.ThePlayer and GLOBAL.ThePlayer:HasTag("_builder")) or not recipe.tagneeded)    end    GLOBAL.IsRecipeValid = IsRecipeValidend 

    Error from the log:


    [string "../mods/workshop-389385830/modmain.lua"]:75: variable 'IsRecipeValid' is not declared
    LUA ERROR stack traceback:
    In character I have tag of "something_builder". So the purpouse is to not let other people obtain this recipe (unless thet play the same character of course). 
    So... Question is:
    Why it just stopped working if it was working just fine?
    How to fix it and how to avoid it in future? 

  8. Since everything seems to work fine let me introduce:


    Wakkari the Red Fox and Wayrra the Arctic Fox for DST


    Wakkari is a member of south fox tribe from far away lands. One feral day he get's dragged to Maxwell's world, during tribal event - Festival of Ancient Spirits, together with Wayrra the Arctic Fox of northern tribe. 

    HP: 200,
    Hunger: 150,
    Sanity: 170

    *Runs a bit faster
    *Can eat monster meat and spoiled meat
    *Can build up hound mound (which can be disadvatage is used uncarefully)
    *Eats only meat
    *Beefalo's hates him (probably for eating them...)

    HP: 140,
    Hunger: 150,
    Sanity: 210

    *Freezes slower during winter
    *Can eat monster meat and spoiled meat
    *Can build create Sanity Orb, which increases sanity for fixed period of time
    *Eats only meat
    *Beefalos hate her 
    *Has her own weapon - Orb Staff
    *Loves spiders... for dinner (gains a tiny amount of sanity by killing them)


    Note: both Wakkari and Wayrra arts are my own creations, not based on any other art/cartoons/books/movies etc. Since there have been few questions - I would like to NOT see their art beeing used for different character mods here, mainly because they are part of bigger projects, not related with Don't Starve game series. 


    Thank you for understanding and for all those positiveness they got from you yet! Enjoy :-) 




    LINKS you might like:

    Wayrra the Arctic Fox DS,ROG: http://forums.kleien...the-arctic-fox/
    Wakkari the Red Fox DS,ROG: http://forums.kleien...ri-the-red-fox/
    Wayrra the Arctic Fox DST: http://forums.kleien...arctic-fox-dst/
    Wakkari the Red Fox DST: http://forums.kleien...he-red-fox-dst/



  9. @rezecib,

    Wait since my problem is about temperature not some other feature, instead of writing whole lines like this:


    inst:WatchWorldState("startday", function(inst)
        if TheWorld.state.issummer then
          inst.components.temperature.inherentinsulation = 0



    I can just add it as those simple codes right under stats of Hunger,sanity etc?


    inst.components.temperature.inherentinsulation = 123456

    inst.components.temperature.inherentsummerinsulation = 123456 (and it's like: 1 - is overheating faster, than for example 100?)


    Literally what I want to achieve is character which:


    1.acts like Wilson WITH beard during WINTER (so is not freezing SO FAST)

    2.acts like Wilson WITHOUT beard during SUMMER (so is not overheating faster and can cool down same quick as other characters)


    While point 1 makes cooling down hard in summer.. This I'm wondering if those simple codes will do it :o 

  10. @Kzisor, really appreciate your patience to myself.


    Also found this:

    The events pushed in singleplayer by the Clock and SeasonManager components ("dusktime", "daycomplete", "rainstart", "seasonChange", etc.) no longer exist in multiplayer, having been replaced by world state watching (e.g.inst:WatchWorldState("isdaytime", callback_fn)), but for cross-compatibility the original events were wrapped using wicker, so from the mod perspective they still exist as they do in singleplayer. What wicker does is, if in multiplayer, intercepting theinst:ListenForEvent() calls for these particular events and replacing them with the corresponding inst:WatchWorldState() calls (and doing the reverse analogue forinst:RemoveEventCallback). Thus, at the mod level, usage remains exactly as in singleplayer, including the contents of the data table passed as the second parameter to some event callbacks.

    Made it more clear. So the code:

    local function WatchPhase(inst, phase)	if phase == "summer" then	inst.components.temperature.inherentinsulation = 0end	if phase == "winter" then	inst.components.temperature.inherentinsulation = 1233456endendinst:WatchWorldState("phase",WatchPhase,TheWorld)

    Should work in DST. Then If I want to make it work in DS/ROG, the easiest way, is to change 



    inst:ListenForEvent(...and ye.. what? phase? or winter/summer?). Don't really get what will be the "event" here :/

  11. did you look for a WorldWatchState that should be a WatchWorldState?


    That's my typo indeed. I meant WatchWorldState.


    Already know that WatchWorldState is DST only... 

    So I could use a ListenForEvent then, ye? And then - it should work on all 3 - DS,DST and DS ROG? 

    (not really a point of having this for normal NOT-ROGed DS, since you can't overheat but still)

  12. I know DST doesn't have ROG yet, but I want to put this part in the code for both - DS and DST.


    It's about to fix character freezing during winter, but not overheating during summer (more less like Wilson's beard, which won't kill him in summer :p)


    Goes in char.lua:

     inst:WatchWorldState("startday", function(inst)	if TheWorld.state.issummer then      inst.components.temperature.inherentinsulation = 0	endend)  	inst:WatchWorldState("startday", function(inst)	if TheWorld.state.iswinter then      inst.components.temperature.inherentinsulation = 125	endend)

    Game starts. But when character enters the world such error appears, saying that WorldWatchState is a nil value... 


    in everything.. DST and DS and ROG.


    I more less know what a nil value is, but just no idea how to fix that here :/



  13. @Foxrai, No, not their prefab files in the game files, the mod I wrote, "DST RoG Characters".


    @rons0n, No, this is a separate issue. You cannot have two recipes for the same prefab. You need to make it a recipe for a proxy prefab that then removes itself and gives a purple gem.



    Then I must be blind - only seeing MORE Rog characters... And nothing like you mentioned before in there :o


    I added sanityorbbuilder tag to my character.. Just can't seem to figure out how to connect it with the recipe... I guess it needs something like "if has tag, then can build.."


    sorry in advance :x

  14. @rezecib,


    Looks like this now:


    local common_postinit = function(inst)     inst.soundsname = "wendy"    inst:AddTag("sanityorb_builder")end

    and recipe is modified to this:


    someitem_recipe.sortkey = -8812221 (are you sure I add "-" in it?) 


    Doesn't seems to work :/ But I must admin I haven't found RecipeIsValid part for DST ROG characters.. :/ they are pretty plain comparing to normal DS characters in DST..



  15. @Foxrai, Look at DST RoG Characters. The IsRecipeValid part, and then you add a tag to the character prefab like AddTag("someitem_builder").


    But you shouldn't set the sortkey to 1, there. Set it to -50 or something, because sortkeys are what are used to send the recipes to the host (e.g. a client says "build recipe 21!" and the host says "okay, let's look up 21... that's a firepit, building it...". So by setting your sortkey to 1, you're preventing people from building whatever was recipe #1 before).


    DST ROG... ok will check that out. I kinda compared only Wickerbottom.

    So when the character has for example tag: book_builder, then only this character will be able to build "book" item? 


    So in general - the safest way is to set sortkey for like 50 or 100? And It will show up under everything else?

    Like any high numer shot, so nothing in different mod will argue with it?

  16. For Don't Starve Together, I have a recipe, as a part of character mod. It's placed in modmain.lua. 


    looks like this:

    local someitem_recipe = Recipe("someitem", {Ingredient("rocks", 10), Ingredient("log", 25), Ingredient("twigs", 8)}, RECIPETABS.TOWN, TECH.NONE)someitem_recipe.sortkey = 1someitem_recipe.atlas = resolvefilepath("images/inventoryimages/someitem.xml")STRINGS.RECIPE_DESC.SOMEITEM = "bla blablabla blah!"
    Like this, if mod is enabled, everyone on the server can make it. And the deal is - to make it ONLY the character the recipe comes from specific.So no other characters can craft it.
    I guess it's very simple, so sorry for stupid question -.-

  17. kinky to add that to a character or that just doesn't fit the style...


    Naa.. most chars just don't fit their style at all :D Just do little "censor" and it's good. Make her bra-made-of-leaves or something. 


    Try to understand developers. There has to be SOME rule. And if we let some1 pass the rule a little... another person will pass the rule more.. another more... and more... and more. 


    character has the style ;) So I guess censoring it won;t kill it :D