Jump to content

That Homeless Guy

Member
  • Posts

    18
  • Joined

  • Last visited

Everything posted by That Homeless Guy

  1. I was just wondering how are you supposed to handle buildings crossing a cell border?
  2. Seriously guys after 3 months has nobody any Idea how to access the player states? I just want to know how the player runs/sneaks I have scoured the files and nothing comes up. Even if I could force the animations and change the player speed then I could work with that. ANYONE?? Say something, anything.
  3. Bump. I cannot develop this mod any further until I get access to the movement states. PLEASE HELP!! I need to know how I the game handles these actions and where. Any help is appreciated.
  4. I can't seem to find what toggles the movement states between walking, running, and sneaking/armed stance. Anybody know what they are? Or should I just modify the players walkspeed and multiply it by the appropriate skill level in getGlobalMovementMod, getSprintMod and force the animations to play?
  5. Perfect I assume the counter event is Event.OnGameExit. I was aware that the gamestate changed in between clicking and the game being visible. I just wasn't sure how t could be referenced. I haven't used an Event driven system like this since I got my java certification.
  6. I can't seem to find anything in the game code that detects when the game has started. eg: after the click to start screen. I found that the game keeps track of gamestates but searching "InGameState" yields nothing in the Lua. I have a click responsive script that spits an error on the "Click to start" screen. It is a benign error and the script has no use in the loading states or menu state so it's not a huge issue but I'd rather clean up the error for my mods users. I was getting by with a test for if the player existed before, but now that I have added some more functionality, the error occurs because the player exists when other elements of the game world don't until the black loading screen is gone.
  7. Updated to v0.2 Latest Update: <>The meatbag no longer ignores containers or cancels movement when a container is clicked on. Instead the meatbag will try and navigate to a spot beside the container. <>Other minor bugfixes. <>Code refactoring.
  8. Final solution. Worked it out by trawling the game code. TTG_Click.isInventory = function(square) for i = 0,square:getObjects():size()-1 do local obj = square:getObjects():get(i); if obj and obj:getContainer() then return true; end end endThank you RoboMat for all your help.
  9. Thank you I don't know if that helped but I'm using it anyway I explored the game files for getWorldObjects() and found that the devs use obj:size() -1 to iterate through tables. Like so. TTG_Click.isInventory = function(square) local objects = square:getWorldObjects(); if objects ~= nil then for i = 0,objects:size()-1 do if instanceof(objects[i], 'ItemContainer') then -- Or was it InventoryContainer?? :S return true; end end endendI have found that neither ItemContainer nor InventoryContainer yield a true response but I'll continue to search. Edit: I have done some searching and found that InventoryContainer appears to be the correct one. (As per the code that spawns loot into containers) I cannot seem to get a true though and the conditional for testing is the same as far as I can tell. More research needed methinks.
  10. It keeps throwing attempt to call nil here no matter how I try and iterate a loop for i = 0, #objects - 1 doI have tried for i = 0,table.getn(objects)-1 doI can't seem to get this to run. I'd kill for a real debugger and break points
  11. Perfect I'll try it out and see what we get.
  12. This is actually how I gather the grid position but I am wondering is there a function like IsContainer(obj) or IsContainerHere(x,y,z) and so forth?
  13. Thanks I see how it does this but that is on right click and doesn't actually look for containers. I am using left click to test a tile with and I am specifically looking for containers. Neither of which this does, I do not wish to create a context menu either. It's a step in the right direction but not quite what I'm looking for.
  14. I was wondering how you detect an inventory such as a cabinet or fridge on the ground. I want to be able to test to see if there is an inventory on the tile I have clicked on. Edit: Assume I have the grid co-ordinates in world space and I want to derive from the grid co-ordinates if there are any containers in that space.
  15. This mod aims to allow the player to move using the left mouse button. By enabling this mod you will move to a location in the same manner as the right click contextual option but by simply left clicking on the desired location. This does not remove WASD controls. To Do: 1) Bugs, bugs, bugs. 2) Add an options menu to toggle it on and off. 3) Make the meatbag "Run To" while while "Shift" is being held. 4) Make combat work more naturally with this system. 5) Make sneaking work with this system. 6) Bugs, bugs, bugs. Latest Update: <>The meatbag no longer ignores containers or cancels movement when a container is clicked on. Instead the meatbag will try and navigate to a spot beside the container. <>Other minor bugfixes. <>Code refactoring. Known Issues: (This list will change) #1) A benign error occurs on starting/Loading a game after you click to start the game. #2) Related to #1. The meatbag will try and navigate to "a" location appon clicking to start after starting/Loading a game. If you have any questions, comments, feedback, or suggestions please let me know. If you do try it and decide to uninstall it Please let me know why. This information helps me make the mod better. Enjoy. v0.3 coming soon. Note: this mod currently uses it's own scripts and does not overwrite existing game files. This means it should survive updates for the foreseeable future and shouldn't have any clash of compatibility with other mods unless they overwrite certain files themselves. (No problems so far) I would warn players to try this on a meatbag you don't hold any love for as the move to system in PZ can be somewhat awkward at times if you aren't used to it. This might get you killed if you are used to WASD. You can currently find the mod through the steam workshop in the link below. steamcommunity.com/sharedfiles/filedetails/?id=600699360 Non steam DL Below Click To Move v0.2.zip
  16. I have started modding PZ and I was experimenting with key registry trying to figure out which keys are what by printing them in the console. This failed to print keys to console so I tried spawning something to the players inventory (something I've done before) I have searched and found no info on left click behaviour or detecting it. But this piece of code just doesn't work and through testing Print(); doesn't work in code that does work. The sub directory for this file is media\lua I have also tried media\lua\server and media\lua\client. TTG_Click = {};TTG_Click.characterInfo = nil;TTG_Click.click = function(_keyPressed) local player = getSpecificPlayer(0); local key = _keyPressed; player:getInventory():AddItem("Base.Pistol"); print(key);endEvents.OnKeyPressed.Add(TTG_Click.click);Any Ideas on what's gone wrong? The file is called TTG_Click.lua Edit: Thank you for moving me I was on the help sub forum for mods when I clicked start new topic don't know how it ended up there. Requesting a mod remove this thread. I never found out what the issue was but I was directed to a completely different solution and implementation.
×
×
  • Create New...