Search the Community
Showing results for tags 'Lua'.
Found 8 results
-
It's been years since anyone has mentioned anything about LuaSocket and its usability in Don't Starve Together. Since I am currently in the process of making a mod that requires the internet extremely briefly (just to receive one string), I've come across LuaSocket in my research. The only mention of this in the context of Don't Starve was when @simplex mentioned it a long time ago here: and I know simplex knows quite a lot about the stuff working behind Don't Starve... My brother and I put it into a mod and tried to load it up, but our final problem was in getting lua to accept the core.dll file that was key to the whole thing. I've seen in some places that Don't Starve does not accept LuaSocket, however all that conversation happened about 5 years ago (at least). I really want to know if someone else has any information on it. If @PeterA knows anything about Don't Starve's lua limitations in terms of adding packages, that would be amazing. For more details about this crazy researching venture, we are currently experimenting using python and its urllib package and attempting to let it talk to lua using Lunatic-Python. It's getting complicated since we'll probably end up having to include a copy of python 3+ AND lua 5.1+ in the mod which is VERY unconventional to say the least. There's also a C module called http that let's you access the internet, but we're not sure how to plug that one in since it doesn't have any lua. -------------------- For those who don't know, LuaSocket is basically just an extension to lua that allows you to access the internet. Lunatic-Python github is here: https://github.com/bastibe/lunatic-python
-
Been over 3 years since [1], so what are the roadblocks? Arguably LuaJIT got more mature but the game got richer so even more justifies aiming for performance.
-
So, I asked for help of someone who seems to understand the game's code well to help me out to understand how to place what where. Long story short, it didn't help. But I learnt a few things, which, for whatever reason, I've never seen anyone mention before (I feel like there needs to be a whole thread with a bunch of tutorial explanations and perhaps videos, which explain how stuff works, where stuff is, where to put what, what to consider and what each thing does): * DS/DSt is/are written in two languages; C++ and Lua * DS/DST (not entirely sure on this one, actually) was not made on a games engine, but rather entirely from program code (if this is the case, then this is what most likely complicates everything a lot). * The game's code in functions, somehow calls out some form of data from somewhere (I've no idea why or how this works). I've worked a little with actionscript 3.0 and have understood the fundamentals in order to create a basic game on Flash/Adobe Animate and the language has been very much like Lua from the looks of it (with some differences, which I've noticed, like "then" and "end" being used instead of "{" and "}" for functions and statements). Just trying to set up event listeners, putting in a few functions and some statements within the function would simply crash the game for me. I really want to get into DST modding, but I cannot because of things that seem like weird anomales to me until explained. I and I'm sure many others would appreciate, at least one video tutorial, explaining the basics of modding Don't Starve and/or Don't Starve Together specifically. An hour tutorial on lua will help me understand lua better, but it won't help me understand Don't Starve/Don't Starve Together code better, possibly because the game is so complex. Reading the manual of lua also simply confused me. So please, if anyone has the 1 hour or whatever of their day free at some point or whatnot and you understand the game's code well, could you please make a tutorial, which would help us DST code newbs understand it better, to a point where just knowing and understanding the basics of proper programming languages (and by proper, I mean quite high-level languages, like Actionscript or Lua, but not so high level as GML, cause dear god; try out GML and it'll throw a whole bunch of stuff you know about programming out the window. Not to say it's a bad language; it's good for understanding the very basics of programming, but all else becomes alien if you start with it and then move on to understanding something like Actionscript or Lua or Python perhaps) would let you create some great mods after you've watched the tutorial (just, better if it's not a character modding tutorial, because the amount of character mods out there, it seems like they're pretty easy to grasp and everything else is quite different from that). Kind regards, SANESS
-
This is for a Waverly mod I'm making. It needs to be able to craft Wickerbottom's books, and must make all neutral and hostile, or other, mobs to attack her on sight. Thanks in advance. ~Union
-
Hello fellow DST modders, I am in the progress of making a character mod and need some help with the scripting. My problem: One of the character perks is that items have a small chance to instantly break on use (regardless of remaining item durability). I just need a pointer on how to get the and item that the player is currently using and on how to change the durability of the item on use. Thanks a bunch in advance!
- 1 reply
-
- Help
- Character Mod
-
(and 4 more)
Tagged with:
-
i have attached the log file, but i keep getting an error, mainly Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. repeatedly, any ideas, help much appreciated! log.txt
-
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
-
I used these commands (which worked pre-Together) "inst.components.eater:SetCarnivore() inst.components.eater.strongstomach = true"Doesn't seem to do anything now though. Anyone know where to look for a solution to this? Here is the rest of my primary lua file:local MakePlayerCharacter = require "prefabs/player_common"local assets = { Asset( "ANIM", "anim/player_basic.zip" ), Asset( "ANIM", "anim/player_idles_shiver.zip" ), Asset( "ANIM", "anim/player_actions.zip" ), Asset( "ANIM", "anim/player_actions_axe.zip" ), Asset( "ANIM", "anim/player_actions_pickaxe.zip" ), Asset( "ANIM", "anim/player_actions_shovel.zip" ), Asset( "ANIM", "anim/player_actions_blowdart.zip" ), Asset( "ANIM", "anim/player_actions_eat.zip" ), Asset( "ANIM", "anim/player_actions_item.zip" ), Asset( "ANIM", "anim/player_actions_uniqueitem.zip" ), Asset( "ANIM", "anim/player_actions_bugnet.zip" ), Asset( "ANIM", "anim/player_actions_fishing.zip" ), Asset( "ANIM", "anim/player_actions_boomerang.zip" ), Asset( "ANIM", "anim/player_bush_hat.zip" ), Asset( "ANIM", "anim/player_attacks.zip" ), Asset( "ANIM", "anim/player_idles.zip" ), Asset( "ANIM", "anim/player_rebirth.zip" ), Asset( "ANIM", "anim/player_jump.zip" ), Asset( "ANIM", "anim/player_amulet_resurrect.zip" ), Asset( "ANIM", "anim/player_teleport.zip" ), Asset( "ANIM", "anim/wilson_fx.zip" ), Asset( "ANIM", "anim/player_one_man_band.zip" ), Asset( "ANIM", "anim/shadow_hands.zip" ), Asset( "SOUND", "sound/sfx.fsb" ), Asset( "SOUND", "sound/wilson.fsb" ), Asset( "ANIM", "anim/beard.zip" ), Asset( "ANIM", "anim/seras.zip" ), Asset( "ANIM", "anim/seras_fed.zip" ), Asset( "ANIM", "anim/seras_starved.zip" ), Asset( "ANIM", "anim/seras_sunlight.zip" ), Asset( "ANIM", "anim/seras_nightmare.zip" ),}local prefabs = {}local commentMoonlight = 1--startregen parameters: first parameter = tick size. second parameter = tick frequency-- stat/apperance differences night/day hungry/starvedlocal function updatestats(inst) local health_percent = inst.components.health:GetPercent() if GetClock():IsDay() then if inst.strength == "mighty" then inst.components.health.maxhealth = 160 inst.components.health:StopRegen() inst.components.combat.damagemultiplier = 1 inst.components.hunger:SetRate(2*TUNING.WILSON_HUNGER_RATE) inst.components.sanity.dapperness = TUNING.DAPPERNESS_SMALL inst.components.temperature.inherentinsulation = 30*6 inst.components.locomotor.walkspeed = (TUNING.WILSON_WALK_SPEED * 1.1) inst.components.locomotor.runspeed = (TUNING.WILSON_RUN_SPEED * 1.1) inst.AnimState:SetBuild("seras") commentMoonlight = 1 elseif inst.strength == "normal" then inst.components.health.maxhealth = 120 inst.components.health:StopRegen() inst.components.combat.damagemultiplier = 0.8 inst.components.hunger:SetRate(0.8*TUNING.WILSON_HUNGER_RATE) inst.components.sanity.dapperness = 0 inst.components.temperature.inherentinsulation = 30*4 inst.components.locomotor.walkspeed = (TUNING.WILSON_WALK_SPEED * 1.0) inst.components.locomotor.runspeed = (TUNING.WILSON_RUN_SPEED * 1.0) inst.AnimState:SetBuild("seras_sunlight") commentMoonlight = 1 elseif inst.strength == "wimpy" then inst.components.health.maxhealth = 60 inst.components.health:StopRegen() inst.components.combat.damagemultiplier = 0.4 inst.components.hunger:SetRate(0.7*TUNING.WILSON_HUNGER_RATE) inst.components.sanity.dapperness = TUNING.DAPPERNESS_SMALL*-1 inst.components.temperature.inherentinsulation = 30*2 inst.components.locomotor.walkspeed = (TUNING.WILSON_WALK_SPEED * 1.0) inst.components.locomotor.runspeed = (TUNING.WILSON_RUN_SPEED * 1.0) inst.AnimState:SetBuild("seras_starved") commentMoonlight = 1 end inst.components.health:SetPercent(health_percent) inst.Light:Enable(false) elseif GetClock():IsDusk() then if inst.strength == "mighty" then inst.components.health.maxhealth = 250 inst.components.health:StartRegen(1, 5) --regeneration speed 1hp/ 3sec inst.components.combat.damagemultiplier = 1.5 inst.components.hunger:SetRate(1.5*TUNING.WILSON_HUNGER_RATE) inst.components.sanity.dapperness = TUNING.DAPPERNESS_SMALL inst.components.temperature.inherentinsulation = 30*6 inst.components.locomotor.walkspeed = (TUNING.WILSON_WALK_SPEED * 1.2) inst.components.locomotor.runspeed = (TUNING.WILSON_RUN_SPEED * 1.2) inst.AnimState:SetBuild("seras_fed") elseif inst.strength == "normal" then inst.components.health.maxhealth = 200 inst.components.health:StopRegen() inst.components.combat.damagemultiplier = 1.2 inst.components.hunger:SetRate(0.8*TUNING.WILSON_HUNGER_RATE) inst.components.sanity.dapperness = 0 inst.components.temperature.inherentinsulation = 30*4 inst.components.locomotor.walkspeed = (TUNING.WILSON_WALK_SPEED * 1.1) inst.components.locomotor.runspeed = (TUNING.WILSON_RUN_SPEED * 1.1) inst.AnimState:SetBuild("seras") elseif inst.strength == "wimpy" then inst.components.health.maxhealth = 70 inst.components.health:StopRegen() inst.components.combat.damagemultiplier = 0.7 inst.components.hunger:SetRate(0.7*TUNING.WILSON_HUNGER_RATE) inst.components.sanity.dapperness = TUNING.DAPPERNESS_MED*-1 inst.components.temperature.inherentinsulation = 30*2 inst.components.locomotor.walkspeed = (TUNING.WILSON_WALK_SPEED * 1.0) inst.components.locomotor.runspeed = (TUNING.WILSON_RUN_SPEED * 1.0) inst.AnimState:SetBuild("seras_starved") end inst.components.health:SetPercent(health_percent) inst.Light:Enable(false) elseif GetClock():IsNight() then if GetClock():GetMoonPhase() == "full" then inst.components.health.maxhealth = 500 inst.components.health:StartRegen(2, 0.5) --regeneration speed 2hp/ 1sec inst.components.combat.damagemultiplier = 1.5 inst.components.hunger:SetRate(-5*TUNING.WILSON_HUNGER_RATE) inst.components.sanity.dapperness = TUNING.DAPPERNESS_HUGE*-5 inst.components.temperature.inherentinsulation = 30*20 inst.components.locomotor.walkspeed = (TUNING.WILSON_WALK_SPEED * 1.8) inst.components.locomotor.runspeed = (TUNING.WILSON_RUN_SPEED * 1.8) inst.AnimState:SetBuild("seras_nightmare") if commentMoonlight == 1 then inst.components.talker:Say("It's full moon. I don't feel right...") commentMoonlight = 0 end elseif inst.strength == "mighty" then inst.components.health.maxhealth = 260 inst.components.health:StartRegen(1, 2) --regeneration speed 1hp/ 2sec inst.components.combat.damagemultiplier = 2.0 inst.components.hunger:SetRate(1*TUNING.WILSON_HUNGER_RATE) inst.components.sanity.dapperness = TUNING.DAPPERNESS_SMALL inst.components.temperature.inherentinsulation = 30*6 inst.components.locomotor.walkspeed = (TUNING.WILSON_WALK_SPEED * 1.3) inst.components.locomotor.runspeed = (TUNING.WILSON_RUN_SPEED * 1.3) inst.AnimState:SetBuild("seras_fed") elseif inst.strength == "normal" then inst.components.health.maxhealth = 250 inst.components.health:StartRegen(1, 3) --regeneration speed 1hp/ 3sec inst.components.combat.damagemultiplier = 1.5 inst.components.hunger:SetRate(0.8*TUNING.WILSON_HUNGER_RATE) inst.components.sanity.dapperness = 0 inst.components.temperature.inherentinsulation = 30*4 inst.components.locomotor.walkspeed = (TUNING.WILSON_WALK_SPEED * 1.2) inst.components.locomotor.runspeed = (TUNING.WILSON_RUN_SPEED * 1.2) inst.AnimState:SetBuild("seras_fed") elseif inst.strength == "wimpy" then inst.components.health.maxhealth = 80 inst.components.health:StopRegen() inst.components.combat.damagemultiplier = 1.1 inst.components.hunger:SetRate(0.7*TUNING.WILSON_HUNGER_RATE) inst.components.sanity.dapperness = TUNING.DAPPERNESS_LARGE*-1 inst.components.temperature.inherentinsulation = 30*2 inst.components.locomotor.walkspeed = (TUNING.WILSON_WALK_SPEED * 1.0) inst.components.locomotor.runspeed = (TUNING.WILSON_RUN_SPEED * 1.0) inst.AnimState:SetBuild("seras_starved") end inst.components.health:SetPercent(health_percent) inst.Light:Enable(true) end end-- hunger speechlocal function onhungerchange(inst, data) if inst.strength == "mighty" then if inst.components.hunger.current < 130 then inst.strength = "normal" inst.components.talker:Say("The hunger has returned...") end elseif inst.strength == "wimpy" then if inst.components.hunger.current > 60 then inst.strength = "normal" inst.components.talker:Say("I need more!") end else if inst.components.hunger.current > 145 then inst.strength = "mighty" inst.components.talker:Say("I feel alive!") elseif inst.components.hunger.current < 55 then inst.strength = "wimpy" inst.components.talker:Say("Bloody hell... feels like I'm slowly fading away.") end end updatestats(inst)endlocal starting_inventory ={ -- Put vampire attack 'item' here}local fn = function(inst) -- choose which sounds this character will play inst.soundsname = "willow" -- a minimap icon must be specified inst.MiniMapEntity:SetIcon( "wendy.png" ) -- default hunger level inst.strength = "normal" inst.components.hunger.current = 125 -- Emit light at night / Night vision local light = inst.entity:AddLight() inst.Light:Enable(false) inst.Light:SetRadius(10) inst.Light:SetFalloff(0.75) inst.Light:SetIntensity(.6) inst.Light:SetColour(235/255,12/255,12/255) -- Stats varies day/night inst:ListenForEvent( "dusktime", function() updatestats(inst) end , GetWorld()) inst:ListenForEvent( "daytime", function() updatestats(inst) end , GetWorld()) inst:ListenForEvent( "nighttime", function() updatestats(inst) end , GetWorld()) updatestats(inst) -- Sanity Changes inst.components.sanity.night_drain_mult = 0.5 inst.components.sanity.neg_aura_mult = 1.1 inst.components.sanity:SetMax(TUNING.WILLOW_SANITY) --Update hunger status inst:ListenForEvent("hungerdelta", onhungerchange) --Carnivore, can only eat meat. Can Eat Monster Meat. inst.components.eater:SetCarnivore() inst.components.eater.strongstomach = true return inst endreturn MakePlayerCharacter("seras", prefabs, assets, nil, nil, starting_inventory)The code for the Wolfgang-like hunger (along with day/night power changes) isn't working at the moment either, but I figure it might be the same problem at the core. Thanks!
- 2 replies
-
- Custom character
- Seras
-
(and 2 more)
Tagged with: