• Content Count

  • Joined

  • Last visited

Community Reputation

4 Neutral

About Batmanwarrior

  • Rank
    Junior Member

Recent Profile Visitors

402 profile views
  1. Hi, I'm trying to make a local function that use the talker component when equipping a weapon, but the game doesn't like it. It says "the variable HuntIsOn is not declared". How can i declare the function/variable? Thanks EDIT: I managed to get it working somehow.
  2. @Sannom I can help you with the light on night-only. Make a function with these lines of code: And also a periodic task that will check constantly if it's day or night: That should do the trick It will also solve the issue where the light turns off when you revive, because the function will constantly be ran every 1/5 of a second. Best regards
  3. Hey, I have uploaded a mod on the workshop and it works just fine. But for one of my friends, the game crashes when he's about to choose the character. The log.txt says something like this: Any idea what may cause this issue for some players, but works perfectly fine for the majority? Thanks in advance. Best regards
  4. @Zchu You can upload the mod to the workshop, but make it visible for friends-only. That way you can update the mod whenever you want, without sending your characterfiles to your friend every time. Then you can both work on your custom characters and it will always be synced, (as long as you update the workshop article using Dont Starve Mod Tools).
  5. Not sure if this would solve anything, but in my code its GLOBAL.Recipe(..ingredients..). Maybe you should try with SCIENCE = 0 to see if it is what causing the error. If you have implemented some other recipes that are working, im sure that you got all the code you need. Try to change science to 0 and see if you can craft it, also try to add GLOBAL with capital letters before recipe. I'm also new to modding, but this worked for my custom item. Good luck! EDIT: From trivia on dontstarvewiki: "The Shadow Manipulator used to be the tier 3 Science research lab, before Science and Magic research were separated into different categories." Maybe there's another command instead of science, like magic(?)
  6. Hey guys, I found some code to enable a lightsource at night (nightvision) but right now it is visible for all the players on the server. I want it to be playervision-only. This is the code for the "light": Is it possible to make this light (or any other light) player-only? I really think that nightvision is a cool perk, but it's a gamebreaker when everyone can see it. I looked into woddie's code for beaver, but it's just the same as stated above. Since it was singleplayer, it worked as intended. Is it possible to make a player-only light now when it's multiplayer? Best regards
  7. Nevermind, I just figured it out! It should be inst.entity:AddNetwork(), and it's inserted within the function in the prefab.lua if anyone else is reading this topic in hope for some guidance. Thank you very much guys, I really appreciate it! Have a great day!
  8. Without that line no matter the amount of debugging you do it will not show up on the clients machine. @Kzisor, @rezecibYou are both right, it was something with the animations. I was looking through some other codes to get an idea which animations I can use, and I tried with the cutstone as a last resort. This is what i changed: Where "theheart" is the template in spriter, and "monsterheart" is the animation name in spriter. Now it works like intended and it also shows when i drop it, thank you very much!! However, is inst:AddNetwork() needed for other clients to see the item? I tried to insert this code into both modmain and monsterheart lua, but the game crashed both times. Where should addnetwork be inserted?
  9. Hi, I just made a custom prefab and it works as intended, I can eat it, craft it, it stacks and shows in the inventory. BUT when i drop it, it is invisible. This is the third day of trial and error, I really need some help. I used the spriter program in Dont starve mod tools to make a new project and compile it into anim folder, but I think that i've missed something along the way. Here's my code for the prefab: { Asset("ANIM", "anim/"), Asset("ATLAS", "images/inventoryimages/monsterheart.xml"), } -- Write a local function that creats, customizes, and returns an instance of the prefab. local function fn(Sim) local inst = CreateEntity() inst.entity:AddTransform() inst.entity:AddAnimState() MakeInventoryPhysics(inst) inst.AnimState:SetBank("cutstone") inst.AnimState:SetBuild("monsterheart_build") inst.AnimState:PlayAnimation("idle") inst:AddComponent("inventoryitem") inst.components.inventoryitem.atlasname = "images/inventoryimages/monsterheart.xml" inst:AddComponent("edible") inst.components.edible.ismeat = true inst.components.edible.foodtype = "MEAT" inst:AddComponent("stackable") inst.components.stackable.maxsize = 10 return inst end -- Add some strings for this item STRINGS.NAMES.MONSTERHEART = "Monsterheart" -- Finally, return a new prefab with the construction function and assets. return Prefab( "common/inventory/monsterheart", fn, Assets) Here's the modmain if that helps: I just want the item to be visible when dropped on the ground, that's the "only" part left. I've looked in the log.txt but i can't see what the problem is (if it's supposed to show there). If needed, I can attach other files so you can have a look at it. I appreciate your help, thanks in advance! Best regards Batmanwarrior
  10. Hey, I downloaded the sample prefab template and I managed to get everything to work properly in-game without crashing, (images, .scml build, tex-files etc). But I can't figure out how to make it edible.. The goal for this prefab is to work together with my custom character to make him level up when eating it. I will try to add a custom recipe for the prefab later, but for now I just need help with the edible part. This is the code so far (scripts/prefabs/meatchunk.lua): So basically, I need a few lines of code to make this prefab edible. Thanks in advance! Best regards Batmanwarrior