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


Interests

  1. I tried to get example from food's poison traits, at first. But I found it is coded in Java, which is far from my coding capacity. So, is that possible to make a recipe forbidden using rotten food? I mean only using scripts or lua? Is there lua files that have similar functions that I could use as example?
  2. memsid

    Luas don't match

    I'm installing mods on a remote server and keep getting 'luas do not match the servers' even though they are the exact same files, I've added them in servertest.ini, and loaded.txt in different orders. The mods also work just fine in single player... what's the problem?
  3. Hi. I am currently working on the building mod and after I looked at the new log walls I want to implement something like it is done there with rope, strings and ripped sheets. In essence I want to have a building option that works with different items as a requisite, but needs only one of them. This is a test if I get it working. The option in particular is not that important. I tried different approaches, none of them worked. I am currently at this: The option in the submenu is working, it looks if one of the gastanks is in the inventory, and if one is, the option gets "white". But when I click it, nothing happens. In the console it says: function: onSmallPropaneTank -- file: BuildingMod.lua line # 2341 function: onMouseUp -- file: ISContextMenu.lua line # 78 attempted index: getInventory of non-table: null----------------------------------------- STACK TRACE The line 2341 is in the onSmallPropaneTank function. It's the line with the first "if not" I'd tried a positive condition ("if" instead of "if not") before, but that didn't work and the "getSpecificPlayer(player):getInventory():contains("xxx")" allways uses an "if not", so I went for that. It looks better if I use only "if", like this: But with that I get the same error message. Atm I think the problem is not if I use a positive or negative condition, but something else, and I am at a loss what this could be. Any help would be much appreciated. I am beginning to understand the lua code and my try and error method in this particular case hasn't got me very far.
  4. Hello. I want to change some behaviour in the current trapping system. For that, I want to override ISTrap:addBait and ISTrap:removeBait. Is that possible by just creating a media/lua/server/Traps/ISTrap.lua and re-defining those two functions? Or is there some more magic to do so?
  5. I have 2 problem as the topic title suggests. One of them being the problem that I dont know how to create a timer in lua. On a other project I was used to a sleep(float) function. The other thing that I tried was with os.time but that didn't work out as well.(crashed upon using it) The second problem is that I can't find a method to let me play a sound and set the radius for it.(like a weapon that was fired) I have found the playsound() method but I dont think it will be the same as a used gun, but more as a sound effect. sorry for the code in the spoilers it doesnt seem to like me .
  6. I made a mod for build 25 and 26 where I created my own occupation and traits based on some "The Walking Dead" characters. Now I can't get them to work on build 27. Did something change? What am I missing?
  7. Hi! Being the huge fan of zombie survival games that I am I thoroughly enjoy playing PZ. So much so that I got my own server running (176.58.126.21:64300) and started looking into customizing it right away. I know that PZ has a rich API that is accessible through Lua and wrote a trivial mod following RoboMat's instructions to get a hang of the essentials. I also know you can add items to the game. With all that what I am wondering about is how that can be possibly fed into multiplayer at this point? Here are some concrete questions: Is it possible to use Mods at all in MP?If so is there a distinction between serverside and clientside mods?serverside: Mod only needs to be installed on server and its functionality is propagated to clients. Therefore clients could connect to such a server with a vanilla installation of PZclientside: To be able to play on a server that has a certain mod installed clients would need to install that mod prior to joiningIs it possible to supplement server behaviour using Lua scripts outside of a mod? Things like location-specific chance-based triggers for certain events?Thanks in advance!
  8. Hi, I come to present this problem that me comes happening very of followed, when I try to connect to an Internet server, since to a server route hamachi, it connects me, the presentation of the game appears and then it jumps a cartel saying "your lua files are not the same as the server's. the game will now exit, sorry", I hope that they could help me, since I cannot get to any server, hope that they could understand me, since I am using a translator, thanks
  9. Hello, I'm new to modding Project Zomboid and, if someone has a moment, I'm having a few difficulties. My questions revolve around an issue I'm having where I'm not able to use 'require' to get my other modules like I normally would. Here is what I would like to do in a bare bones example: --File: media/lua/server/MyMod/MyMod.lua MyMod = {} print('Setting up...'); MyMod.module1 = require 'MyMod/Module1.lua'; print('Loaded module: '..MyMod.module1.foo()); --File: media/lua/server/MyMod/Module1.lua local M = {} function M.foo() return 'I\'m Module1!'; end return M; When I load the mod I get an exception telling me MyMod.module1 is null, when I expect to get my returned Module1 table, or an exception that it could not find the file. --Output: Loading: ../media/lua/server/MyMod/MyMod.lua Setting up... ----------------------------------------- attempted index: foo of non-table: null ----------------------------------------- So, if you bare with me I have three related questions: 1. Does PZ stop me from using require to load other lua files? why? (or am I doing it wrong?) 2. Why does PZ load every .lua file in my mod. I normally expect a single point of entry, such as loading the file "MyMod/MyMod.lua" which would then allow me to decide what modules the mod loads. Is there a reason it doesn't have a single point of entry and how should I be using this to my advantage? 3. Other mods declare their modules using their mod name as a prefix to avoid possible conflicts; I was hoping I could avoid pollution of the global scope and just have everything under one roof, i.e inside MyMod, instead of MyMod;MyModModule1;MyModModule2;etc. Is there any way to do this? Thanks for reading, Any questions/clarifications please ask! Logan. Update: I'm guessing my issue with require() has something to do with the differences between Kahlua2 and Lua 5.1? (only because my example works fine using Lua 5.1)
  10. So I am looking for any information on retrieving and altering the remaining durability of a battery in code. I'm not finding much documentation on their use. Or any mods that make use of them in order to see how it is done. By the looks of things, in a multiplayer game I can use a torch, deplete the battery partially. Extract the battery and it is returned to max life. From the look of the recipes, taking the battery out just seems to craft a brand new one. Though I may be mistaken. Does this mean storing the depletion of a battery is not implemented yet? (Build 27) I would be really happy for any information regarding retrieving or altering the life of a battery in lua. Also greetings! ~
  11. Hi guys I know some of you are considering diving in to mod making. I'd like to share some resources I made for that. Adding items, weapons and recipes does not require programming abilities. Everyone can do it, I promise Check The basics of adding items and recipes if you would like to learn how to add your own weapons, foods or other items to the game. There's also a tutorial showing how to add your own sprites to the game made by RoboMat. If you have experience with another programming language check out this hello world example Your first project zomboid lua script Also there's a Lua syntax reference Further more there's a popular event reference for the more trained LUA modders. This list shows the possible events our functions can hook up too. There's currently no commenting feature on pz-mods.net, so comments and features are greatly appreciated here. (Has been added now) And of course if you would like to share your mods, please submit them to pz-mods.net and we'll take good care of them. pz-mods.net is closed to new mods as the website is likely to be phased out. That's all. Hope you have fun with it.
  12. Governor

    Game shut down

    When i try to launch multiplayer, game shut down to desktop when "Loading Lua". Why?
  13. Hey, I'm making mod with injectors. There's quite much I need to make, at least for learning's sake. Is there any more efficient way of making crafting result multiple items than using OnCreate with Lua? Well, that's not so important, it works this way so that can be left there. But more importantly, I need to get my hands on player's needs at lua scale, meaning I need to get modify all these pain, depression, hunger, thirst, and to temporary modify increase and decrease multipliers. I can't find those myself (I tried digging) so I hope someone of you can tell me where to get all that. I can't remember right now what all other stuff I need help with, but these are first that came in mind. Reason where I need these are my so-called potions with longer effects, and to prevent continuous injecting without nasty side effects, like pain and getting heavily toxicated (yes, mixtures use alcohol), or eventually death. (That's grim) if someone wants to know more, I'm willing to tell. My data is a bit scattered and unorganized so I don't attach it here, at least not yet. Kinda messy text, but I hope you can dig out what I meant. Asking is always my last resort Thanks in advance.
  14. Alright, so I figure I will start of with HI! I am the new guy on the block. I would have brought you a fruit basket or something but those pesky zombies ate the fruit... and the basket Then they ate lead from my shotgun :cool: I would also like to apologize in advance if there is already a thread on this topic, I did have a look for one but I came up with nothing. Now, down to business. I am attempting to write LUA mods/addons for PZ. so far I have just followed these two tutorials on how to do this: http://pz-mods.net/guide/your-first-pz-lua-script/ http://pz-mods.net/guide/robomats-mod-tutorials/#toc4 (only the I Love turtles script so far) I have experience programming in C++, VB, and Python. I am fairly confident in my ability to program but for the life on me I cannot figure out how to get the scripts I have written to run in game. I am simply looking for suggestions for the mistake(s) I am making and or what it is I am messing up. Thank you in advance for your help for the convience of all I have attached the two LUA Files I wrote as .txt files hastalavista.txt Iliketurtles.txt
  15. Hey everyone, I am currently looking for a part time or full time programmer for a game that I am currently working on called "Project Hybrid Two". I would prefer one from the United States or the UK. I am looking at using the leadwerks game engine so skills in C++ and LUA will be required. If you are interested in my project check it out here. I am working on getting some 3D art up and out the moment so updates apart from words are scarce. Thank you for your time, - Ben Contact Information - Skype: Ben_Stan385 Email: HeadClot88 at Gmail dot com
  16. Heyho, I've created another tutorial over at pz-mods.net which explains how to use inventory context menus. How to create Inventory Context Menus It especially shows you how to differentiate between single items, stacks and multiple stacks of items. Hope it helps! P.S.: http://thecodinglove.com/post/47120159615/when-my-code-works-on-the-first-try
  17. Can someone make lua for me that will only run when my recipe in the pistol whip mod that changes the gun to blunt weapon? This lua will need to run when the crafting recipe is started and will empty the gun of it's bullets, shells and/or magazine placing them in your inventory. So user clicks crafting recipe, lua keeps ammo, starts crafting recipe. And add disable recipe if durability is depleted. Edit: Ya know, Tumblr is going to lose a-lot of bandwidth because of us.
  18. Hello, all! I'm just wondering how i would go about creating a simple GUI box in-game that has a text box and a button on it when a player presses a key? There's some Clydes in it for you if you help! ;D
  19. hi everyone, apperently shortly after I released my new script for languagesupport in luascripts The IndieStone changed there forums so here is my topic back! It's more compact as before (merge of multiple script files) 1. PZMLoader 2. PZMLLittle 3. LanguageSupport for luascripts 4. UnlimitedTraits PZMLoader changelog: PZMLLittle changelog: LanguageSupport UnlimitedTraits changelog:
×
×
  • Create New...