Jump to content

Search the Community

Showing results for tags 'client'.

  • 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

Found 5 results

  1. Hi... again... so after a long hours of trying to make corpse removal i got to the point that i remove corpses but only on server side (after i respawn i dont see corpses, but everyone else sees it) For testing purpouses I make that OnPlayerDeath event on server side and it worked then, but thats not what i need. I need it strict client -> server. Here im sending player object to the server function PlayerDataCollector.OnPlayerDeath(player) if PlayerDataCollector.isReviving then debugPrint("OnPlayerDeath - Player died while reviving. Skipping.") sendClientCommand("RevivingClient", "isReviving", { true }) return end sendClientCommand("RevivingClient", "isReviving", { false }) PlayerDataCollector.isReviving = true end Here im receiving it on the server and im putting player square to the array function commandModule.RevivingClient.isReviving(player, args) if player ~= nil then if args[1] == true then debugPrint("RemovePlayersServer - OnPlayerDeath - Putting square to the alt list.") altDeathSquares[#altDeathSquares+1] = player:getSquare() elseif args[1] == false then debugPrint("RemovePlayersServer - OnPlayerDeath - Putting square to the list.") deathSquares[#deathSquares+1] = player:getSquare() end else debugPrint("RemovePlayersServer - isReviving - Player object is null.") end end Here im executing checks on the squares to see if there is a body function OnTick(ticks) checkDeathSquares(deathSquares, bodyIds) checkDeathSquares(altDeathSquares, altBodyIds) clearDeadCorpses(bodyIds, false) clearDeadCorpses(altBodyIds, true) end function checkDeathSquares(squares, bodyids) for key, square in pairs(squares) do local bodies = square:getDeadBodys() if bodies == nil or bodies:size() == 0 then return end for i=0, bodies:size() - 1 do local body = bodies:get(i) bodyids[body:getObjectID()] = body end squares[key] = nil end end Here im deleting corpses and dropping player items on the ground function clearDeadCorpses(bodyids, fullclear) for objectId, body in pairs(bodyids) do local bodysquare = body:getSquare() if not fullclear then local bodyinv = body:getContainer() local items = bodyinv:getItems() local itemsarray = {} if items then for i=1, items:size() do local item = items:get(i-1) table.insert(itemsarray, item) end end for i=1,#itemsarray do bodysquare:AddWorldInventoryItem(itemsarray[i], ZombRandFloat(0, 0.99), ZombRandFloat(0, 0.99), 0); bodyinv:Remove(itemsarray[i]) end end bodysquare:removeCorpse(body, false) bodyids[objectId] = nil end end Unfortunately the lack of modding documentation with examples makes it more difficult to understand the problem maybe someone more experienced with project zomboid modding could help me
  2. The test case on line 125 of file media/lua/client/ISUI/ISInventoryPaneContextMenu.lua to check if a Dish Cloth or Bath Towel can be used to dry the player off needs parentheses around testItem:getType() == "DishCloth" or testItem:getType() == "BathTowel" to make the line look like if (testItem:getType() == "DishCloth" or testItem:getType() == "BathTowel") and playerObj:getBodyDamage():getWetness() > 0 then in order to fix a bug where the dry dish cloth has the option to be used when the player is dry because it's only checking if there's a dish towel, or if there's a bath towel and you are wet; instead of checking if they have a dish cloth or bath towel, as well as being wet.
  3. hi, im hosting a stable branch server for a few friends. two days ageo steam updated the stable branch of teh client, but not the steam dedicated server. i cant upgrade the server nor can we downgrade our clients, what am i supposed to do now?
  4. I am trying to write a shopping list mod and am having trouble with a key piece. I already have the recipe, UI for editing the list etc complete, but when I was testing with a friend we noticed that when I made changes to a list after it was created he was not able to see the updates. I started looking into sendClientCommand and sendServerCommand and was able to successfully pass my playerIndex to the server, and have the server send a message back to the client.. but I can't for the life of me figure out how to tell the server to update the mod data on the specific item I just updated on the client since sendClientCommand won't accept complex inputs like an InventoryItem. Anything I can think of seems like it would be prone to not working 100% of the time. Like if I were to make sure the item was on the player first (not ideal) and then find it by name, type, category, there are possibilities for the wrong list to be updated. There seems to be quite a few methods around transmitting mod data, but none of them seem to work with an InventoryItem, and I can't find any ways to convert an InventoryItem into something that has any of the mod data transmission methods either. Is this possible to do or am I chasing a unicorn here?
  5. Hey guys, I've been working on getting my mod to work on multiplayer and since there are very little resources on that topic I have a few questions. isClient() / isServer() What these methods do is clear, however when I call isClient() in a file that is located in shared it returns false although the initial call flow was triggered client side. So I execute a UI action located in client and call my reload script located in shared but isClient() returns false. Can anyone give me further information on these two methods? ModData I noticed that if I modify moddata on client side, it will not affect the moddata on server side. Now I looked through the existing code and found: transmitModData() - That sounds like exactly what I need, however it is not available on the HandWeapon object weapon:transmitModData() - Object tried to call nil player:sendObjectChange('addItem', { item = kit } ) - Seems to send a request to the client to add an item, I'm not sure if every object supports this and what the exact syntax is, can I just call any method on the target remote object with parameters? Can anyone elaborate on this function? Does anyone have another idea how I could sync the modData of an object betwen client and server? My first attempt to use sendClientCommand - process it server side and change the moddata failed to accomplish what I need.
×
×
  • Create New...