Foxrai Posted February 5, 2015 Share Posted February 5, 2015 Well I tried asking in other thread but they seem dead.. So I'll let myself post a new one. If I have working handslot item in Don't Starve, what I need to do to make it work in Don't Starve Together?The Item is character specific, comes with the beggining of the game and is not craftable (no recipe!) Yet no addictional functions, it's just plain like spear - sharp/weapon tags. When I start the DST server only the host gets the item. Also somehow the HP,Hunger and Sanity of my char are messed up. I think it's ok without the item added (the issues ONLY FOR GUESTS) Host always works fine. I guess it's some small line missing but I can't figure out what and where :/ So basicly: what is the difference between DST and DS hand gear mods? What to add? :/ Sorry if its stupid question. Link to comment Share on other sites More sharing options...
Kzisor Posted February 5, 2015 Share Posted February 5, 2015 @Foxrai, first off it's not a stupid question. Secondly, it is recommended to read to sticky at the top of this sectionby rezecib to fully understand the differences brought to Don't Starve Together from Don't Starve. Finally, because it's an easy question to answer I'll give you the answer, but please read the sticky! You need to add inst.entity:AddNetwork() to your local function fn, right after the other entity initialization code. You'll also need the following code before any components since components do not run on the clients computer. if not TheWorld.ismastersim thenreturn instend I hope this helps. ~Kzisor/Ysovuka Link to comment Share on other sites More sharing options...
Foxrai Posted February 5, 2015 Author Share Posted February 5, 2015 @Foxrai, first off it's not a stupid question. Secondly, it is recommended to read to sticky at the top of this sectionby rezecib to fully understand the differences brought to Don't Starve Together from Don't Starve. Finally, because it's an easy question to answer I'll give you the answer, but please read the sticky! You need to add inst.entity:AddNetwork() to your local function fn, right after the other entity initialization code. You'll also need the following code before any components since components do not run on the clients computer. Finished reading the sticky twice before posting previous post. Now took a peek again too... And I swear I had those in mod o.o maybe I added too much of stuff... looks like this now: local inst = CreateEntity()local inst.entity:AddNetwork()local trans = inst.entity:AddTransform()local anim = inst.entity:AddAnimState()local sound = inst.entity:AddSoundEmitter()MakeInventoryPhysics(inst) and before ANY components the other lines stands. I also had: inst.entity:SetPristine() <<< such line Donno where from tho.. I probably read somewhere to add that -.-' Hmmm does that mean the same goes for the characters itself? Link to comment Share on other sites More sharing options...
Kzisor Posted February 5, 2015 Share Posted February 5, 2015 @Foxrai, the character should not need those lines if set up correctly as that is already handled behind the scenes. Link to comment Share on other sites More sharing options...
Foxrai Posted February 5, 2015 Author Share Posted February 5, 2015 @Kzisor ok. Not touching the character then. Gonna be testing it soon then looks like this now (skipping assets lines): local prefabs = {} local function fn() local function OnEquip(inst, owner) owner.AnimState:OverrideSymbol("swap_object", "swap_bellstaff", "swap_bellstaff") owner.AnimState:Show("ARM_carry") owner.AnimState:Hide("ARM_normal") end local function OnUnequip(inst, owner) owner.AnimState:Hide("ARM_carry") owner.AnimState:Show("ARM_normal") end local inst = CreateEntity() local inst.entity:AddNetwork() local trans = inst.entity:AddTransform() local anim = inst.entity:AddAnimState() local sound = inst.entity:AddSoundEmitter() MakeInventoryPhysics(inst) anim:SetBank("bellstaff") anim:SetBuild("bellstaff") anim:PlayAnimation("idle") if not TheWorld.ismastersim thenreturn instend inst:AddComponent("inspectable") inst:AddTag("sharp") (...) > weapon stuff blablabla inst:AddComponent("equippable") inst.components.equippable:SetOnEquip( OnEquip ) inst.components.equippable:SetOnUnequip( OnUnequip ) return instendreturn Prefab("common/inventory/bellstaff", fn, assets, prefabs) Link to comment Share on other sites More sharing options...
Kzisor Posted February 5, 2015 Share Posted February 5, 2015 @Foxrai, move the tag above the if not TheWorld.ismastersim then line as that is needed for clients. It would be beneficial if you posted your entire mod so that I can see exactly what is the root cause of the problem. Link to comment Share on other sites More sharing options...
Foxrai Posted February 5, 2015 Author Share Posted February 5, 2015 (edited) @Foxrai, move the tag above the if not TheWorld.ismastersim then line as that is needed for clients. It would be beneficial if you posted your entire mod so that I can see exactly what is the root cause of the problem. There goes... in filesmodmain.luabellstaff.luawakkari.lua Edited February 5, 2015 by Foxrai Link to comment Share on other sites More sharing options...
Foxrai Posted February 5, 2015 Author Share Posted February 5, 2015 @Kzisor, In those files Tag is not moved yet. I didn't have opportunity to test it yet tho... :/ waiting for some1 to come online.. Link to comment Share on other sites More sharing options...
Kzisor Posted February 5, 2015 Share Posted February 5, 2015 (edited) @Foxrai, I think I found the issue. local inst.entity:AddNetwork() is wrong. Remove the local from it and it should work correctly. Also in your wakkari.lua file in the master_postinit function you don't need the following line: -- Minimap iconinst.MiniMapEntity:SetIcon( "wakkari.tex" ) common_postinit is ran on both the server and the client and master_postinit is only ran on the server. Edited February 5, 2015 by Kzisor Link to comment Share on other sites More sharing options...
Foxrai Posted February 5, 2015 Author Share Posted February 5, 2015 @Foxrai, I think I found the issue. local inst.entity:AddNetwork() is wrong. Remove the local from it and it should work correctly. Also in your wakkari.lua file in the master_postinit function you don't need the following line: -- Minimap iconinst.MiniMapEntity:SetIcon( "wakkari.tex" ) common_postinit is ran on both the server and the client and master_postinit is only ran on the server. Ok I see o_o Thank you for having patience to me in the first place... Is really a noob if it comes to coding :/ even with reading forums tutorials and original ds files xP It just hates me. Link to comment Share on other sites More sharing options...
Kzisor Posted February 5, 2015 Share Posted February 5, 2015 @Foxrai, it's okay, everyone has to start somewhere. I will be making a series of guides to help new modders take their beginning steps into modding Don't Starve and Don't Starve Together. The first chapter is already out, it's about setting up your working environment to achieve the maximum efficiency possible while developing mods. Link to comment Share on other sites More sharing options...
Foxrai Posted February 5, 2015 Author Share Posted February 5, 2015 @Foxrai, it's okay, everyone has to start somewhere. I will be making a series of guides to help new modders take their beginning steps into modding Don't Starve and Don't Starve Together. The first chapter is already out, it's about setting up your working environment to achieve the maximum efficiency possible while developing mods. Indeed there is many of the tutorials and stuff but none really explains WHAT DOES WHAT in the mods...Only like: Make it that way! Why? Because! Some things are simple to figure out by looking on original DS items, but not everything...Like for example I'm fighting with "Light" add now. It will come and it's satisfaction when you made it.. but still. Nice of you to make such introduction to mods ^^ Link to comment Share on other sites More sharing options...
Foxrai Posted February 5, 2015 Author Share Posted February 5, 2015 @Kzisor, I guess with character it wasnt that issue o.o for free time - i donno if it's the item causing it thats why keeping in this thread - Item seems to be fine. Ow wait.. If I have master postinit then it means it's only for HOST ye? So only person hosting server gets that? And under that there are character statistics.. Shouldn't I change master to common for DST? that's in wakkari.lua 'cause atm character run by guest doesnt have any stats (hunger, sanity etc) nothing. And all of these are under "master" Link to comment Share on other sites More sharing options...
Kzisor Posted February 5, 2015 Share Posted February 5, 2015 @Foxrai, clients do not need to have the statistics ran on their side as they do not have the components to handle that running. Statistical information should only be ran on the server side as otherwise it would cause an error. There are certain exceptions to this such as speed, but many things have replica's which already do all the hard work for you. If I'm understanding correctly when a player joins your server their UI isn't showing correctly? Is this an accurate assessment? If not could you please provide a screen capture to better denote exactly the issue clients are seeing? Link to comment Share on other sites More sharing options...
Foxrai Posted February 5, 2015 Author Share Posted February 5, 2015 (edited) @Foxrai, clients do not need to have the statistics ran on their side as they do not have the components to handle that running. Statistical information should only be ran on the server side as otherwise it would cause an error. There are certain exceptions to this such as speed, but many things have replica's which already do all the hard work for you. If I'm understanding correctly when a player joins your server their UI isn't showing correctly? Is this an accurate assessment? If not could you please provide a screen capture to better denote exactly the issue clients are seeing? I tried changing them tho.. but it's no difference at all... looks like this :attaching log as well.. (from client position)and new prefabs but as i said with old ones it was exaclty the same...(corrected double minimap in prefabs, and changed commons/master) NOTE: THERE IS NO DEAD PLAYER on map! World is fresh generated, just the two of us who are on the screen. So the ghost icon is a bug as well... -.- HOST works fine NOTE2: the item works fine after Your modification log.txtwakkari.lua Edited February 5, 2015 by Foxrai Link to comment Share on other sites More sharing options...
Kzisor Posted February 5, 2015 Share Posted February 5, 2015 @Foxrai, post your entire mod folder as a .zip file so I may take a closer look at other moving parts in the mod. It might be something completely unrelated to the wakkari.lua file altogether. Link to comment Share on other sites More sharing options...
Foxrai Posted February 5, 2015 Author Share Posted February 5, 2015 (edited) @Kzisor, Here goes: character.lua is the same as post above... (hope the upload worked - didn't let me upload .rar second ago.)wakkari.zip Edited February 5, 2015 by Foxrai Link to comment Share on other sites More sharing options...
Kzisor Posted February 5, 2015 Share Posted February 5, 2015 (edited) @Foxrai, I've made some changed and now it works. Specific changes I made were in the wakkari.lua file. I changed:return MakePlayerCharacter("wakkari", prefabs, assets, master_postinit, common_postinit, start_inv)to:return MakePlayerCharacter("wakkari", prefabs, assets, common_postinit, master_postinit, start_inv) I also reversed your changed making the master_postinit contain all the component information. I've attached the working version. Tested with the dedicated server software while I was a client. You can connect to Dedicated-Ysovuka2 password 123 to test if this .zip file works for you. Edited February 5, 2015 by Kzisor Link to comment Share on other sites More sharing options...
Foxrai Posted February 6, 2015 Author Share Posted February 6, 2015 @Kzisor, Ow I coudln't check it yesterday but I will check it today (connection problems). Editing this post when I do Link to comment Share on other sites More sharing options...
Foxrai Posted February 6, 2015 Author Share Posted February 6, 2015 @Kzisor, Hmmmm believe it or not.. But I just send Your zip to my friend and same added to my mods.. And still the same issue o.o Can this be just me? Tho I don't have ANY other mods installed apart from where's my beefalo o.o Link to comment Share on other sites More sharing options...
Kzisor Posted February 6, 2015 Share Posted February 6, 2015 @Foxrai, I recommend both you and your friend, delete the entire folder from your mods folder and extract it there again. Also make sure the modmain and other files aren't inside a secondary file from extraction. Link to comment Share on other sites More sharing options...
Foxrai Posted February 7, 2015 Author Share Posted February 7, 2015 @Foxrai, I recommend both you and your friend, delete the entire folder from your mods folder and extract it there again. Also make sure the modmain and other files aren't inside a secondary file from extraction. Did everything you said :/ I guess I'll just pass on it for now... Checked it with 3 people. Everyone confirmed the same error :/ Link to comment Share on other sites More sharing options...
Kzisor Posted February 7, 2015 Share Posted February 7, 2015 @Foxrai, that is very strange as I was capable of running it on a dedicated server and on both my PC's it ran flawlessly. Link to comment Share on other sites More sharing options...
Foxrai Posted February 7, 2015 Author Share Posted February 7, 2015 @Kzisor, Hmmm... Can I add You on Steam maybe? Link to comment Share on other sites More sharing options...
Kzisor Posted February 7, 2015 Share Posted February 7, 2015 @Foxrai, sure. I'm Ysovuka on steam. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now