Jump to content

Search the Community

Showing results for tags 'Spawning'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • 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


Last Updated

  • Start


Filter by number of...


  • Start





Website URL







Found 10 results

  1. I'm running my first server and have run into a snag. I've been able to find solutions for most of my problems through googling until now. I'm trying to add a few custom spawn points to my server and am at a complete loss. I ran through Louisville claiming and releasing various houses as safehouses to record their coordinates. I have seven locations I'd use as spawn points for a custom spawn region in Louisville. Most of what I've found is for setting a single static spawn point and everything else has left me very confused. I'd like to set it up so that clicking on Louisville would send the player to one of the seven spots I picked out while retaining all the vanilla spawns from other regions. I have no idea what I'm doing with this. If anyone could help me figure this out or point me to a more concise guide on this specific thing I'd really appreciate it.
  2. As asked in the title I was curious if there's a command for it? or something that an admit can do that I've missed say similar to instant construct Had to restart my personal friendship server due to HDD death and I wanted to get me my Cossette back, Though with a decent 45 mins of Google and the what not can't find nothin'
  3. Hi folks and dev's, I've been playing PZ in multiplayer for a while now and the one thing that bugs me the most (while in MP), is how zombie spawning work. Right now, you clear an area, go home, come back within x hours and the area is "magically" repopulated. Wouldn't it be more immersive if zomboids spawned at the edge of the map and then started roaming in a random direction? Whaddya guys think?
  4. Good afternoon. After having discussed an issue on the General Thread, several people revealed to me that I am experiencing a bug instead of ignorance. You can also see the issue by clicking this link. Thank you for any assistance you may have. -TURTLESHROOM
  5. I host a private server for me and my friends. Around 25-30 days into surviving, I start running into a rhythmic lag, every 30 seconds or so I experience a lag for about 1 second. It has nearly killed me. Is it a memory leak after playing for about 13-15 hours? Maybe its because I've set stuff to respawn after 1 month (We're stationed at Twiggy's, near the gun store in West Point) and we are close to the centre of town. Anyone else having similar issues?
  6. How do I spawning zombies in multiplayer? spawnHorde(x,y,z,num) The code only work in single player. what should I do?
  7. Many Different People Using my mod have often complained that the item does not spawn. I also found that it is not working often. The only times I was able to actually find the item from the mod spawned was when I used the code: table.insert(SuburbsDistributions["gunstore"]["locker"].items, 30); Even though I have many other spawn locations declared as you see below. The only place I was able to ever find a silencer was in the gunstore in westpoint. And that was only when I spesified "locker" as the container . Using "all" as a container or room name has never worked. Never found one anywhere else. So I was hoping someone could show me what is wrong with the spawn code or the mod in question. http://steamcommunity.com/sharedfiles/filedetails/?id=639909479 here is the item spawn lua file: require "Items/SuburbsDistributions" require "Items/ItemPicker" SSilencer = {} SSilencer.getSprites = function() getTexture("Item_Silencer.png"); print("Textures and Sprites Loaded."); end -- Add items for Gun Store all table.insert(SuburbsDistributions["gunstore"]["all"].items, "Silencer.Silencer"); table.insert(SuburbsDistributions["gunstore"]["all"].items, 15); -- Add items for Police Storage table.insert(SuburbsDistributions["policestorage"]["all"].items, "Silencer.Silencer"); table.insert(SuburbsDistributions["policestorage"]["all"].items, 15); table.insert(SuburbsDistributions["hunting"]["all"].items, "Silencer.Silencer"); table.insert(SuburbsDistributions["hunting"]["all"].items, 15); table.insert(SuburbsDistributions["storageunit"]["crate"].items, "Silencer.Silencer"); table.insert(SuburbsDistributions["storageunit"]["crate"].items, 8); -- Avery rare in crates table.insert(SuburbsDistributions["all"]["crate"].items, "Silencer.Silencer"); table.insert(SuburbsDistributions["all"]["crate"].items, 4); table.insert(SuburbsDistributions["all"]["metal_shelves"].items, "Silencer.Silencer"); table.insert(SuburbsDistributions["all"]["metal_shelves"].items, 4); print("SuburbsDistributions added. "); Events.OnPreMapLoad.Add(SSilencer.getSprites); Thank you for your time.
  8. First, this all comes from NCrawler, who seems to have left the community 6 months back. It's from a beta of his YAWM that never was released. I have it since I was a beta tester for him at the time he left. The purpose of this is to allow the modder far more flexibility in how his items are spawned, when, and with what. It also allows a modder to set values lower than 0.01 for probability, in fact as low as desired (1 in 10,000, okay!). Some of this has been heavily altered by me for personal use with the KY firearms mod that's currently out in this forum, but it can work with any items mod you like. This works through the media\lua\server\Items subfolder. Add this to the bottom to start. The random value generator is used an awful lot, and the Events line is what calls the script to run each time a container is "filled" by the game engine. Without that, nothing will happen. --From RoboMat's RMUtility Modfunction rnd(_value) return ZombRand(_value) + 1;endEvents.OnFillContainer.Add(spawnNCStuff);Next is the main function. Note that "OnFillContainer" will pass 3 values to this, the room name (the first value we see in SuburbsDistribution tables, like "kitchen"), the type of container (the second value, "all" or "metal_shelves"), and the specific container being filled: function spawnNCStuff(_roomName, _containerType, _containerFilled)-- ALL THE IF AND WHILE LOOPS DISCUSSED BELOW GO IN HEREendNow we can use these in IF statements to specify when to spawn things depending on room type or container type: if _containerType == "wardrobe" then-- STUFFend if _roomName ~= "kitchen" then if _containerType == "counter" or _containerType == "locker" or _containerType == "metal_shelves" then-- STUFFendendWithin these, we can set how rare the spawn is thusly: --Roll for firearm (0.2% chance) if rnd(1000) >= 999 then-- STUFFendThe next part is a bit trickier. It requires two things. First, the code within the above IF statements. Second, a separate array outside of this entire function. Let's start with the array. Here's an example for guns and their respective ammo: gun_array = { "RKFmod.ColtPython", "RKFmod.TaurusModel444RagingBull", "RKFmod.Kimber1911", "RKFmod.Ruger1022ArchangelNomad", "RKFmod.Ruger1022", "RKFmod.MarlinModel795", "RKFmod.MarlinModel795", "RKFmod.MarlinModel795", "RKFmod.MarlinModel795",};ammo_array = { "RKFmod.357Mrounds", "RKFmod.44rounds", "RKFmod.45rounds", "RKFmod.Ruger1022ArchangelNomadMag", "RKFmod.Ruger1022Mag", "RKFmod.MarlinModel795Mag", "RKFmod.MarlinModel795Mag", "RKFmod.MarlinModel795Mag", "RKFmod.MarlinModel795Mag",};Notice how the first member of the array in gun_array matches the first member of ammo_array, and so on to the end? This is important if you want to spawn matching items together. Also notice how we've had the Marlin 795 repeated 3 times, so it takes up 4 of the 8 choices? That means it has a 50% chance of spawning IF any gun is spawned from its array. This is how to make specific entries more or less likely within the array. Now, let's assume we have several such paired arrays, one for long rifles, one for pistols, one for AR-15s, etc. We want to choose randomly which to pick from when spawning. Next the code for the main function: weaponType = rnd(100); if weaponType <= 50 then --pistols-- STUFF elseif weaponType > 50 and weaponType <= 90 then --rifles-- STUFF elseif weaponType > 90 then --AR-15s-- STUFF endSo here you can see we are choosing between which set of arrays to spawn from. Next, to pick a member of the array to spawn: gun_Index = rnd(#gun_array); _containerFilled:AddItem(gun_array[gun_index]);#gun_array means that it counts the number of entires in our gun_array. The rnd function picks a random number within that range. Then we have the main "doer" of this whole thing, the AddItem() command. This adds in the selected item to the specific container. You could just replace (gun_array[gun_index]) with ("mymod.my_gun") and it'd work just as well. Now here's a fun twist. You can add specific ammo/magazines/etc to the spawn as well: NCY_ammovar = rnd(100); if NCY_ammovar >= 40 then --Add 1 magazine for that weapon(60% chance) _containerFilled:AddItem(ammo_array[gun_index]); if NCY_ammovar >= 75 then --Another mag (25% chance) _containerFilled:AddItem(ammo_array[gun_index]); if NCY_ammovar >= 92 then --2 more mags (8% chance) _containerFilled:AddItem(ammo_array[gun_index]); _containerFilled:AddItem(ammo_array[gun_index]); end end endLet's walk through that a bit slowly. First, we have a new random value, this is just used to see if we want to spawn something or not. You could just make this 100, so something always spawns (or nix the IF statements and just follow with an AddItem() command). But here it's random, and the first checks to see if it's >= 40, which means 60% of the time we'll get ammo spawned with the gun. Notice that we're using the SAME gun_index value as before, we haven't rerandomized it, but now with the ammo array? Yes, this is how we get a matching gun/magazine/ammo spawn. Then you can see that there are two additional IF checks, for rarer likelihood of further spare ammo. This can be tailored however you like, once you understand the basic syntax of what's going on here. There's a lot more you can do with this stuff, like spawning a melee if a gun doesn't spawn, using an ELSE statement that follows the original IF statement way above. Sky's the limit. I'm not going to say this is the most streamlined code imaginable, but it works and it's pretty easy to edit on the fly and adjust to how you like it. Anyway, let's look at a finished version of what we just did (different names for some things, but exact same structure/commands): This was altered by me to work with the KY firearms mod, for personal use. I guess now it's open to all. I will also post the original YAWmod lua if anyone wants to experiment with thatj. NOTE: You will want to get rid of all the... table.insert(SuburbsDistributions["garagestorage"]["all"].items, "RKFmod.BoxOf22");...type code if you want to do this, or at least that which is relevant to what you're trying to achieve with these functions. Anyway, thanks should go to NCrawler, wherever he is, as far as I know he was the one to come up with this approach and code for this game.
  9. Hello all, I'm doing a mod set in a different world to Project Zomboid, one without zombies, but where basically a long time before the game most people died instantly. As such, the world is filled with lots of smelly old bodies. What I would like to know is if it's possible to spawn zombies that are pre-dead in such a way that they are in the same places/numbers as "living" zombies would be, ie. spawned using the black and white BMP file in WorldEd? I know there's a "spawn dead zombie" function somewhere, but I want the world to be filled with thousands of dead bodies and I can't work out all the co-ordinates for them obviously, and I want the bodies to be similarly laid out as the zombies, ie. much more in towns and none in the countryside.
  10. Hey all, I am wondering how I would go about spawning an object, say for example a box or a barrel or whatever, when the player fires a specific weapon? What I'm thinking of is just messing around with something the player can equip, which will "Auto-create" something else, maybe a box, or another weapon or something, when the equipped weapon is fired, how would I go about starting to do something like that?
  • Create New...