• Content Count

  • Joined

  • Last visited

Community Reputation

59 Excellent

1 Follower

About FurryEskimo

  • Rank
    Senior Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hello. I'm working on an improvement to some of my own code, but need a way to detect when a player has right clicked on their own follower. I think this code is very similar to what I need, but I don't really understand it.. Could anyone offer some advice so I can make my own version? This code appears to be a 'sit' command (which is cool), but I needed something simpler, a simple way to check if the follower's leader right clicked on them. local SITCOMMAND = GLOBAL.Action(4, true, true, 10, false, false, nil) local SITCOMMAND_CANCEL = GLOBAL.Action(4, true, true, 10, false, false, nil) AddComponentPostInit("talker", function(self) local old_Say = self.Say function self:Say(script, ...) if self.inst.prefab == "saberlion" then if script and type(script) == "string" then script = script:match("^%$%$(.*)$") or "GAO GAO GAO!" end end return old_Say(self, script, ...) end end) AddReplicableComponent("followersitcommand") SITCOMMAND.id = "SITCOMMAND" SITCOMMAND.str = "Order to Stay" SITCOMMAND.fn = function(act) local targ = act.target if targ and targ.components.followersitcommand then act.doer.components.locomotor:Stop() act.doer.components.talker:Say("Sit!") targ.components.followersitcommand:SetStaying(true) targ.components.followersitcommand:RememberSitPos("currentstaylocation", GLOBAL.Point(targ.Transform:GetWorldPosition())) return true end end AddAction(SITCOMMAND) SITCOMMAND_CANCEL.id = "SITCOMMAND_CANCEL" SITCOMMAND_CANCEL.str = "Order to Follow" SITCOMMAND_CANCEL.fn = function(act) local targ = act.target if targ and targ.components.followersitcommand then act.doer.components.locomotor:Stop() act.doer.components.talker:Say("Come!") targ.components.followersitcommand:SetStaying(false) return true end end AddAction(SITCOMMAND_CANCEL) AddComponentAction("SCENE", "followersitcommand", function(inst, doer, actions, rightclick) if rightclick and inst.replica.followersitcommand then if not inst.replica.followersitcommand:IsCurrentlyStaying() then table.insert(actions, GLOBAL.ACTIONS.SITCOMMAND) else table.insert(actions, GLOBAL.ACTIONS.SITCOMMAND_CANCEL) end end end)
  2. Found it! forumthread = "" Edit: @-t-Oh thanks for that! I wasn't notified that anyone had responded. I'd been searching my files for a web-address, not half an address.. Great work on your recent mod btw, it's been very popular!
  3. It's come to my attention that the 'More Info' button for mods (within the Mods category of the main menu) does not reliably work. Does anyone know how this button works? Presumably it's getting the link some somewhere, but I don't see the link anywhere with the individual mod files..
  4. We got it working. Turns out I made a typo and it wasn't working even though the code was right. AddModRPCHandler(modname,"ToogleSwimming",ToogleSwimming) GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.key_to_swim, function() --Recoded with IronHunter's help. if not GLOBAL.ThePlayer or GLOBAL.ThePlayer.prefab ~= "wildchild" or GLOBAL.TheFrontEnd:GetActiveScreen() ~= GLOBAL.ThePlayer.HUD then --Prevents toggle being used by other players and on character select screen. return end --Now that we can confirm that ThePlayer isn't nil we can attempt to run the player controller code local playercontroller = ThePlayer.components.playercontroller if playercontroller then local v1, v2 = playercontroller:IsEnabled() --"Gives two values, the 2nd value being False means you're using the crafting search bar." if v2 == false then --Don't allow toggle if player is using crafting search menu. return end end --[[ if ThePlayer.HUD ~= nil and ThePlayer.HUD:IsCraftingOpen() then --Do not toggle ability if crafting menu is open. return end --]] if GLOBAL.ThePlayer then SendModRPCToServer(MOD_RPC[modname]["ToogleSwimming"]) end end)
  5. So it appears there’s an issue.. When the player is on the character select screen and pressed the key, ThePlayer is called but it crashes the server.. I’ve tried a few ways to fix this but nothing’s worked yet. Does anyone have a suggestion?
  6. Well I really appreciate your insight! I did what I could to learn everything in the last two evenings, but I'm a writer by trade, working 10 hours days. I try,,
  7. @IronHunter Huh, well what do you know, that worked! Where did you find this information? I was trying to solve this without asking but couldn't find a source anywhere. Also thanks for explaining how the placer works. I got that working months and months ago and moved on, but I never really figured out what it was doing.. I had more important stuff to focus on, like the swimming code, which drove me up the wall..
  8. Wait, did this change return Prefab("ice_den", ice_den, ice_den_assets), --Unsure what this does. Used by game to find assets? MakePlacer("ice_den_placer", "ice_den", "ice_den", "idle") --Seems to control what assets are used when placing a new tent. This was in another mod: return Prefab("common/eteleporter", fn, assets, prefabs), Prefab("eshockfx", eshockfxfn, assets), Prefab("eteleringenter", enterfn, assets)--, -- MakePlacer("common/eteleporter_placer", "esentry_item", "esentry_item", "idle") Edit: You responded at the exact moment I did haha. Reading your response now.
  9. @IronHunter I believe I added the placer. I added it in a few different places, but this was the only spot I found that didn't result in an error, yet it doesn't seem to work. I've been looking for an example in the vanilla code and other mods, but I'm a bit tied up with my family, so I haven't made too much progress. I went looking for information about this in the beta release notes but haven't found anything. AddRecipe2("ice_den", { Ingredient("twigs", 6), Ingredient("cutgrass", 6), Ingredient("ice", 8) }, TECH.SCIENCE_ONE, {builder_tag = nil, atlas = "images/inventoryimages/ice_den.xml", image = nil}, {"CHARACTER", "STRUCTURES", "WINTER", "RESTORATION"}, {placer="ice_den_placer"})
  10. This info must be on the forums already so perhaps someone could point me in the right direction? I’ve been able to update all my recipes, but my structures are still broken.. They’re placed immediately upon being built, rather than letting the player decide where they should be put. Anyone know how to fix this?
  11. Phew, got it! Big thanks to Vyuri who's hard work found a solution! I made a few small edits, but this worked perfectly! local playercontroller = ThePlayer.components.playercontroller local v1, v2 = playercontroller:IsEnabled() --"Gives two values, the 2nd value being False means you're using the crafting search bar." if playercontroller and v2 == false then --Don't allow toggle if player is using crafting menu. return end
  12. We already have code to detect when the player is typing in the chat, but do we know how to detect when the player is using the crafting menu?
  13. @Moracalle Some of that is fairly simple. I'd suggest starting with a basic guide on how to make a custom character mod: Once you have that ready you can ask people how to make those edits. 1. Because she's a cat, I want a higher sanity drain for wetness☆ This would be increasing the sanity wetness multiplier. I've never done this but I'm fairly certain it exists. Look in the component file for sanity and then look for wetness or moisture. 2. Maybe some kind of sanity penalty for eating meat that is not a crockpot dish, but not sure right now. This would likely be a ListenFor code related to eating, and then the game would need to check what the item is. I'm not too familiar with how this is done, but the simplest way would likely be to check the name against a list/array. 3. No sanity drain from ghosts like Wendy☆ I think that's basic, just set the ghost sanity drain modifier to 0 in the character's master_postinit file. I may be wrong about that though, I haven't looked at Wendy's code and there may be another way. To make pigs/etc. hostile I think instead of a "player" tag in their master_postinit code you add "monsterplayer" That might be enough. I'm not familiar with how to make custom crafting menus or ghost followers, but I'm sure there are others who could help. Like I said though, it might help if you got the basics working and then ask how specific functions can be added. If all of this is too much for you then there's always the option to commission someone to do the work for you, but even then it can help a lot if you at least try to get it working first and then go looking for help once you've gotten stuck. I don't think there are many people who will be able to give you a completed mod file with all of what you jsut described pre-prepared for you. OH, and downloading NotePad+ will make the coding easier, although different people prefer different coding tools. Modly they're highlight keywords and help tell you what code relates to what other code.
  14. @CarlZalph I was poking around in the component file, but perhaps I overlooked that! SetPercent would have been useful, but I didn't see that in the sanity config. I'll take another look.
  15. Figured it out! Apparently it's different from setting health, for some reason.. inst.components.sanity.current = 120 vs inst.components.health:SetCurrentHealth(120)