Jump to content

Maris

Member
  • Posts

    244
  • Joined

  • Last visited

Everything posted by Maris

  1. 0.05 means 0.05% in general. But it depends on may other factors. For example, there is a limit of items in container, so many items with high drop chance will compete to each other. Also loot is increased in areas with high zombie density.
  2. Don't delete topics. Ask other users (e.g. EnigmaGrey) if they want their messages to be deleted.
  3. Maris

    [WIP] more mod tags

    At the very beginning, I just wanted to add the tag "Build 41". For myself, I solved this issue. But then I decided to go further and make a real mod "more_mod_tags" for other modders to add custom tags. https://steamcommunity.com/sharedfiles/filedetails/?id=2138864719 But which tags should be there? This is the question. So I ask you about your ideas. I don't like too many tags, so I want to add just most popular and useful. Currently there are these tags: Build 41 Build 40 Multiplayer Interface Textures Models Vehicles Items Clothing Weapons Food Literature Medical Traits Building Bugfix Tweak Framework Language Easier Harder Realistic
  4. Is it shown as 41.38? I've got update via Steam but it's still 41.38
  5. The function EveryOneMinute() sometimes occurs twice at the same time.
  6. I mean animation + stopping running for a bit. --e.g. player:Fall() --would be helpful There are some unknown functions but they don't work: player:setFallOnFront() player:fallenOnKnees() -- adds blood player:setbFalling() player:setFallTime()
  7. LOG : General, 1592574621554> false LOG : General, 1592574621572> false LOG : General, 1592574621587> false LOG : General, 1592574621604> false LOG : General, 1592574621620> false LOG : General, 1592574621637> false LOG : General, 1592574621653> false LOG : General, 1592574621670> false LOG : General, 1592574621687> false I tried to figure out where this annoying print is and made neat print detector: print = error; But this did not help, rain of false continued. So it's on Java side.
  8. Oh, thanks, but I meant changes to exact single separate item in inventory. Your code affects ALL (new) items in the world. Btw I found a way to save weight: item:setActualWeight(0.33) item:setCustomWeight(true) But I still can't save custom changed icon of vanilla item (not custom item from my mod).
  9. Axe (FireAxe) in each hand.
  10. If I change icon: item:setTexture(new_icon); everything is fine but after reloading the game there is old icon. If I change weight: item:setWeight(0.5); item:setActualWeight(0.5); everything is fine but after reloading the game there is old weight.
  11. Okay, let's say you need DOUBLE INJECTION. Why would you need this? For example, you are a very neat modder and do not want to load the user's CPU, overwriting common game functions and making permanent injection. One of these functions is getText(). And you want to make temporary ninja injection. So we have to go a more complex way: local old_getText = nil local function new_getText(str,...) --You code (unsafe!) return old_getText(str,...) end local in_progress = false local old_render = SomeClass.render function SomeClass:render(...) --permanent injection if in_progress then if old_getText and getText == new_getText then getText = old_getText old_getText = nil end return old_render(self, ...) end old_getText = getText getText = new_getText --tempry second injection in_progress = true local result = old_render(self, ...) in_progress = false if old_getText then getText = old_getText end return result end If something goes wrong, your feature just stop working and that's it. No further game errors. P.S. Specific function render() does not return a result (by meaning), so you may omit it in this case. But it's not a mistake. Usually you have to keep the result.
  12. Actually it's not a real bug but a kind of mistake in the code. Even so there is no any text in "Category" column in inventory whlie you are washing your clothes. P.S. It caused game freeze in my mod, because the game tries to draw nil in ISInventoryPane.lua:1885, and I injected in that code, that's why I decided to report it.
  13. Let's say there is a critical game function "render": function SomeClass:render() --Game code (safe) end And you want to inject into it. As you know, replacing the whole function is bad practice. Therefore, the injection in your mod will look something like this: local old_fn = SomeClass.render SomeClass.render = function(self, ...) --Your code (unsafe) return old_fn(self, ...) end The main difficulty is that your code may contain errors with a high chance. And if something goes wrong, the user will receive a ton of red errors or the game will freeze because the function is critical and is called roughly every tick. So you want at least stop spam of errors if something went wrong. There is a solution! local in_progress = false local old_fn = SomeClass.render SomeClass.render = function(self, ...) if in_progress then return old_fn(self, ...) end in_progress = true --Your code (unsafe) in_progress = false return old_fn(self, ...) end Actually, this code was created in order to avoid recursion. But as a side effect, it allows to bypass the storm of errors. If something breaks the mod, then the mod just stops working, and the game continues without further errors.
  14. --Kill all zombies around the current player function kill_all(range) range = range or 15 range = range*range local p = getPlayer() local zlist = p:getCell():getZombieList() local playerX,playerY,playerZ = p:getX(),p:getY(),p:getZ(); local cnt1 = zlist:size()-1; for i=0,cnt1 do local zombie = zlist:get(i); local diffX,diffY = playerX - zombie:getX(),playerY - zombie:getY(); local distsq = diffX*diffX + diffY*diffY; if distsq <= range then zombie:Kill(p) end end end
  15. I tried to insert "<RGB:1,1,0>" in text of menu but it does not work.
  16. Small optimization in ISAddItemInRecipe.lua https://pastebin.com/TRmSNVnZ
  17. Maris

    Sound files

    You may search in all game data files by sound filename.
  18. player:getX() is float, and it may be 1234.5 (absX / 300) is float too! Not integer. So I think there is a mistake...
  19. Maris

    Load files order

    As I remember, server files are always loaded when you create/join game session. And lua/client files are loaded only on client (not on dedicated server).
  20. The grass is on the zombie but she was just killed.
  21. Finally! Also it would be nice if a player can fix hood (and other parts except windows) using propane torch. And ofc we all are waiting for armored parts for vehicles (including armored metal windows). At least plz add possibility for modders to use armored models of vehicle parts in their mods.
  22. You need to add custom function. It may be simple or may be complicated like this one: require "Items/ItemPicker" require "Items/SuburbsDistributions" require "Items/ProceduralDistributions" require "Vehicles/VehicleDistributions" --Duplicate loot chances (or remove loot) local function CopyLoot(old_name, new_name, mult) local cache = {} local function patch(t) for i=#t,1,-1 do if t[i] == old_name then local num = (t[i+1] or 0.01) * mult; if old_name == new_name then t[i+1] = num; --overwrite elseif new_name == 0 then table.remove(t,i) table.remove(t,i) else table.insert(t, new_name) table.insert(t, num) end end end end mult = mult or 1; for room,r in pairs(SuburbsDistributions) do for container,c in pairs(r) do if c.items and not cache[c.items] then cache[c.items] = true patch(c.items) end end end for proc,p in pairs(ProceduralDistributions.list) do if p.items and not cache[p.items] then cache[p.items] = true patch(p.items) end if p.junk and not cache[p.junk] then cache[p.junk] = true patch(p.junk) end end for vehicle,p in pairs(VehicleDistributions) do if p.items and not cache[p.items] then cache[p.items] = true patch(p.items) end if p.junk and not cache[p.junk] then cache[p.junk] = true patch(p.junk) end end end CopyLoot('Thread', 'Thread', 4) -- thread loot x4 CopyLoot('Umbrella', 'Umbrella', 2) -- umbrella loot x2 CopyLoot('Needle', 'MyMod.MySuperNeedle', 0.3) --rare super needle CopyLoot('Needle', 0) --Then remove needle from all loot tables
  23. I'd like to see that annoying message only once (or twice). Thanks god, somebody wrote the mod "Disable Welcome Message".
×
×
  • Create New...