Jump to content

Search the Community

Showing results for tags 'Lua'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • News & Announcements
    • News
  • Project Zomboid
    • PZ Updates
    • General Discussions
    • Bug Reports
    • PZ Support
    • PZ Multiplayer
    • PZ Community & Creativity
    • PZ Suggestions
  • PZ Modding
    • Tutorials & Resources
    • Mods
    • Items
    • Mapping
    • Mod Ideas and Requests
  • General Games Development
    • Indie Scene
  • Other Discussions
    • General Discussion
    • Forum Games & Activities

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Twitter


Location


Interests

  1. Like on the old forums people can post their requests for lua additions in this thread. Please just post requests here and don't debate about the ones made. The devs are perfectly capable of deciding what to add and what not to add Anyway, here we go: New / Changed Events: EveryMinute: Self explanatory.EveryHour: Self explanatory.OnUnequip: When Item is unequipped from the primary or secondary slot.OnItemUse: When item is used in the inventory. (E.g. "Eat Food" or "Bandage Wound")OnContainerUpdate: When the item containers are updated (parameters: table of contained items, getType() of the u
  2. Hi. I decided to add a new type of clothing: a hard hat, jacket, and pants. Based on the standard ones: Jacket_Camo Green, Hat_Army, and Trousers_camogreen. Changed textures, drew new icons, and created the necessary files. Here is a list of files and what I wrote in them: Folder: \media\clothing\clothingItems Files: Jacket_CamoMP.xml, MP_Hat_Army.xml, Trousers_CamoMP.xml I changed two lines in each file. The path to the texture: <textureChoices>clothes\jacket\jacket_camomp</textureChoices> <textureChoices>clothes\jacket\jacket_camomp</textureChoices
  3. For example, ClothingRecipesDefinitions.lua by now: ClothingRecipesDefinitions = {}; ClothingRecipesDefinitions["Sheet"] = {materials="Base.RippedSheets:4" } --ClothingRecipesDefinitions["Belt2"] = {materials="Base.LeatherStrips:1"} ClothingRecipesDefinitions["FabricType"] = {} ClothingRecipesDefinitions["FabricType"]["Cotton"] = {}; ClothingRecipesDefinitions["FabricType"]["Cotton"].material = "Base.RippedSheets"; ClothingRecipesDefinitions["FabricType"]["Denim"] = {}; ClothingRecipesDefinitions["FabricType"]["Denim"].material = "Base.DenimStrips"; ClothingRecipesDefinitions["FabricTy
  4. Maris

    Exit Game Event?

    Is there any event when the game (dedicated server) is about to go down just before saving the game?
  5. Maris

    Really Real Time?

    I'm trying to set current real time. local SEC_TO_HOUR = 1 / (60 * 60) function makeRealTime() local tm = getGameTime() local t = os.time() --utc local day = tm:getDay() --8 local month = tm:getMonth() -- 6 local year = tm:getYear() -- 1993 local current = tm:getTimeOfDay() --in hours local hour = round(current) --9 local game_t = os.time{year=year, month=month+1, day=day+1, hour=0, min=0} --utc local diff = round(t - game_t) --in seconds current = current + diff * SEC_TO_HOUR -- OK to increment days (tested) tm:setTimeOfDay(current) end Events.OnCreatePlayer.Add(function()
  6. The function EveryOneMinute() sometimes occurs twice at the same time.
  7. 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()
  8. 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 be
  9. 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.
  10. Small optimization in ISAddItemInRecipe.lua https://pastebin.com/TRmSNVnZ
  11. Hey, so I was wondering if it would be possible to add an interaction button to zeds, nothing fancy, more like a proof-of-concept. If you press your right mouse button on an zed an small interaction button should pop up (like on anything else interactable), if i click it some function or so should be triggered. Im pretty new to modding Project Zomboid, im not quite sure where to start but I found some example LUA scripts from the devs located in: \media\luaexamples\ui But I dont know if its the right to look at, any tips or help would be appreciated.
  12. Hi. I'm thinking about the creation of a mod for our roleplay PZ server : an icon showing on the character while its player is typing something in local chat. Being aware that another player is currently typing could be very useful on a roleplay server. I'm looking for solutions, as no Lua event is linked to this specific situation. As for now, I have tried to simply capture the "OnKeyPressed" event for the "Return" key (I know it's not either an elegant or a pro approach as keybinding could change.) But I can't even manage to capture the event... Is the return key out of "O
  13. -- when you or a npc try to hit something xpUpdate.onWeaponHitXp = function(owner, weapon, hitObject, damage) local isShove = false if hitObject:isOnFloor() == false and weapon:getName() == "Bare Hands" then The function getName() returns translated name! It may be not English. So it should be: weapon:getType() == "BareHands"
  14. Hi, i encountered this bug, when i wanted to add another mod to my already running game. When you click on the "choose mods" button when loading the game, you get an empty screen (only the background picure of the game still exists). Now, this bug doesnt happen, if you clicked atleast once on the "Mods" button in the main menu before attempting to do this (once per game start is enough). As i found out, the reason for this is, that the game tries to display a box with text, using a function that does not exist. In the file "ISModsNagPanel.lua" in the location Steam\steama
  15. Updated to 34.28 Sorry for taking so long guys, I switched jobs and I spend most of my free time trying to figure out this being a father thing lol. My son is only 8 months old and I spend all of my free time with him. He and his mother went on "vacation" to visit family out of town so I finally got time to complete the mod. Sorry, and I hope everyone hasn't lost interest. When you choose one of the custom hairstyles at the character creation menu the character preview will show the player bald. Don't freak out, that is completely normal and as of right now there is no
  16. Hello Guys! Recently I'm playing PZ extensively with my Girlfriend and because I have 3 monitor's I always have the map (http://map.projectzomboid.com/) open on one of the other monitor's. One thing that annoyed me was that even in borderless window mode I had to click out of PZ to move the map to see everything I wanted. Finding the position of your player was also a bit annoying, so one night I sat down and started programming and PZTracker was the result. PZTracker connects the online map to the game. The map will follow your player position if you like and you can move around (arrow k
  17. I can create a class like this local noise = InventoryItemFactory.CreateItem("Peace.SoundBeacon"); local noiseTrap = IsoTrap.new(noise, cell, square); noiseTrap:addToWorld(); but I cant create some classes, i get an is nil error local radioLinePre = RadioLine.new("Test Message", 1, 1, 1); Is it just that some of the classes arent accessible in lua, or am i missing a namespace or something? I dont have much experience with lua.
  18. For example: local bd; local function fnEveryTenMinutes() if not bd then bd = getPlayer():getBodyDamage(); end ..... end Events.EveryTenMinutes.Add(fnEveryTenMinutes); I think it should reduce overhead on api calls.
  19. RoboMat's Modding Tutorials - An introduction to modding for Project Zomboid - I - Introduction I1 - Where to start I2 - What is needed I3 - Lua Tutorials I4 - Other Resources II - The first steps II1 - Getting the connection II2 - The entry point: Events III - The first mod III1 - Preparations III1a - Folders III1b - Our mod's identification card III1c - The actual lua script III2 - Adding items to the inventory III3 - Handling keys III4 - Detecting the correct key IV - Custom professions IV1 - Creati
  20. setTeachedRecipes(java.util.List<java.lang.String> teachedRecipes) For example, how to use this function? setTeachedRecipes({"Recipe 1", "Recipe 2"}) ?
  21. How to change the amount of starting perk points? I have a company that does my hosting but I have to tell them what to edit ect...anyone know? and will it affect future players?
  22. Good afternoon. I attempted to search through the Vanilla rendition of PZ's files to find the script that represents the White Microwave, to no avail. Much to my chagrin, it does not exist in the SCRIPTS file and is only referenced in the Translation file. The Microwave sound effect is there, but for the likes of me, I can't see where the Microwave itself is located. The reason I want to know the answer to this is because the "Hydro Craft" Mod has several items that can spawn in cabinets that are exact, but non-functioning, duplicates of placable Furniture. For example,
  23. So... you want hotkeys the player can press that does something for your mod. The problem: The player should be able to reconfigure these keys, so they don't conflict with the players existing setup or other mods they have loaded. Sure you can have these keys setup in a 'settings.lua' file the player can edit, but that leads to its own problems... If a user edits this file, and the mod is designed for multiplayer, then they'll have issues connecting to servers since the checksums won't match. Maybe you're feeling clever, and decided to write these settings into a set
  24. Hello. In collaboration with the admins of the Redboid community server, we have discovered a bug that prevents Linux clients from joining Windows-based servers. It seems that there is a mismatch between the contents of the "media/lua" folder between the clients. Specifically, the Linux client has the following file, which is not present in the Windows client: lua/client/OptionScreens/WorldScreen.lua This causes Linux clients attempting to connect to show the following error message: "You have been kicked because your game files do not match the server's.".
×
×
  • Create New...