Jump to content

halomantis

Member
  • Posts

    12
  • Joined

  • Last visited

About halomantis

  • Birthday 05/31/1978

Profile Information

  • Gender
    Man

halomantis's Achievements

  1. Back in the day (before build 33) I had a simple little log sled. A container that only allowed logs to be stored in it. I accomplished this by basically making a container that had 0 capacity and using a function to put the logs in the sled. Which worked great. But after build 33 this function seemed to die. Let me include the full scripts. first the script for the log sled and putting logs into it. There is a "Placebo" item as the result, it is removed automatically. Also LogSledTest is called to verify the player really has a Log Sled so I don't have to use it as part of the recipe. item LogSled { WeightReduction = 99, Weight = 9, Type = Container, Capacity = 0, DisplayName = Wooden Log Sled, Icon = LogSled, } /************************RECIPES************************/ recipe Put Log In Sled { Log, SkillRequired:Woodwork=1, Result:Placebo, OnTest:LogSledTest, CanBeDoneFromFloor:true, OnCreate:PutLogInSled, Category:Carpentry, } Next the functions (No laughing) function PutLogInSled() local player = getSpecificPlayer(0); MaxLogSledCount = player:getPerkLevel(Perks.Woodwork) * 4; print("MaxLogSledCount: " .. MaxLogSledCount); LogSledCount = 0; for i = 0, getPlayer():getInventory():getItems():size() - 1 do if getPlayer():getInventory():getItems():get(i) ~= nil and getPlayer():getInventory():getItems():get(i):getType() == "LogSled" then BagID = getPlayer():getInventory():getItems():get(i) for t = 0, BagID:getInventory():getItems():size() - 1 do if BagID:getInventory():getItems():get(t):getType() == "Log" then LogSledCount = LogSledCount + 1; end end end end LogInventoryCount = 0; for i = 0, getPlayer():getInventory():getItems():size() - 1 do if getPlayer():getInventory():getItems():get(i):getType() == "Log" then LogInventoryCount = LogInventoryCount + 1; end end print("LogSledCount: " .. LogSledCount); print("LogInventoryCount: " .. LogInventoryCount); while LogInventoryCount > 0 and LogSledCount < MaxLogSledCount do for i = 0, getPlayer():getInventory():getItems():size() - 1 do if getPlayer():getInventory():getItems():get(i) ~= nil and getPlayer():getInventory():getItems():get(i):getType() == "LogSled" then print("Made it this far"); container = getPlayer():getInventory():getItems():get(i); container:getInventory():AddItem("Base.Log"); LogSledCount = LogSledCount + 1; end end if getPlayer():getInventory():contains("Log") then getPlayer():getInventory():Remove("Log"); LogInventoryCount = LogInventoryCount - 1; end print("LogSledCount: " .. LogSledCount); print("LogInventoryCount: " .. LogInventoryCount); end if LogInventoryCount > 0 then player:Say("I can't figure out how to add more logs") end end function LogSledTest() if getPlayer():getInventory():contains("LogSled") ~= false then return true else return false end end function DLH_Functions.ErasePlacebo() if getPlayer():getInventory():contains("Placebo") then getPlayer():getInventory():Remove("Placebo"); end end Events.OnTick.Add(DLH_Functions.ErasePlacebo); All the prints kick off EXCEPT for the "Made it this far" which shows that I am somehow not able to get the id of the logsled or something to that effect. Long winded and likely an easy fix, but the poo I am throwing at the wall isn't sticking yet.
  2. Ok after some time looking at the DirtyWaterMod (which has been a massive help in this), I did a quick translate function to remove the IGUI from the name put there by ISFishingAction. I do always love learning more
  3. The getText() call is built into the games ISFishingAction, which is used for when the player fishes. Part of that code is to build the name of the fish with the size.
  4. Ok so I have been delving deeper. I added a line to the translate file in the main media folder IG_UI_EN IGUI_Fish_LongnoseGar = "Longnose Gar", Everything ran just perfect, I used my new "lure" to catch the new fish. Sooooooo.... really the question comes to something really simple or harder depending on the answer. How do I add an item to the translation table without editing the main file in the media/lua/shared/translate folder.
  5. Ok so I have gotten new Fish and New bait to work, meaning they are added to the Fishing.fishes and Fishing.lure but the problem I am having is getting to the new fish to show up when caught. What is happening is that when you catch them they are showing up as Medium IGUI_LongnoseGar 12cm blah blah. Now my guess is that it has something to do with the translate file. I am trying to find a way to fix this without having to edit any of the main files. if not fish.noNameChange then fishToCreate:setName(getText("IGUI_Fish_" .. fishType.size) .. " " .. getText("IGUI_Fish_" .. string.gsub(fish.name, "%s+", "")) .. " - " .. size .. "cm"); endThis is the line I think is causing the problem in ISFishingAction to create the fish. Not that anything is wrong with it, obviously just what is making the IGUI_Fish_ appear. In IG_UI_EN translate you can see IGUI_Fish_Medium = "Medium", IGUI_Fish_Pike = "Pike", So this looks like where they build the fish name and whatnot off the data from the fish. Ok lots of info probably not needed, but there we go.
  6. I did make a small code change to your mod to help with troubleshooting some of our recipes. All it does is give a list of items that the recipes are um not correct enough to cause an error with CraftHelper. This helps a whole ton since the recipes were truly missing something or just plain messed up. Line 14 Debug_Save_List = ""; Line 80 Debug_Save_List = Debug_Save_List .. ", " .. recipe:getModule():getName() .. ":" .. recipe:getName() and I enabled the code at 277, just to get the whole debug thing to start. I did notice with the current change it doesn't like the Cut Animal (Specifically the bird one).
  7. I was looking to speed up someone getting bored or unhappy while in a building (calling it stircrazy ) I did see getBoredom/setBoredom or getIdleboredom/setIdleboredom but neither of these seem to affect the bored moodlet or are affected by a book... and haven't found anything for happiness in the IsoGameCharacter.Stats. What could I be missing here? Thanks beforehand! v/r, James.
  8. Again RoboMat, you are awesome! Going to plow through this, but I am certain you pointed me way further than I was.
  9. Is there any way to check for the lightlevel a player is standing in, to possibly build a phobia to darkness trait? Also checking if it is day time or night time. I did see the isNight() but not sure exactly how to use it as a true check like we do with RainManager.IsRaining(). Thank you before hand.
  10. I was working on some professions and traits. My brother brought up the idea that he loves reading and hates that the players get "bored" while reading... So I was looking for a way that you could make a trait like "bookworm" to stop the getting bored while reading. Thanks for the reply either way.
  11. Does anyone know how to check to see if the player is say resting, reading a book, fishing or just any general task that has a progress bar? Thanks beforehand.
  12. It is because the items are missing from the newitems.txt file. I went through and found each item missing or omitted from both the newitems.txt and items.txt and put them in. You can compare them with the ones found in the main games media directory to find the missing items.
×
×
  • Create New...