Jump to content

Stormy

Member
  • Posts

    64
  • Joined

  • Last visited

Everything posted by Stormy

  1. Stormy

    Reloaded

    "In the current version of PZ, the code that makes up the reloading system is huge. It became a problem for both ourselves and modders to make changes" Uh... apologies. In my defence my coding has got a lot better.
  2. Stormy

    Launch Procedures

    Not gone forever. This makes me happy
  3. Last time I checked it's stored as a client side variable. It should be possible for the server to 'push' this variable to each client on connect.
  4. I'm at work so I can't see the fields but here we go... The principle of the setUpGun method is to determine whether the item that has been clicked on is a reloadable item..... It checks that there is a corresponding lua weapon type (which was created and added into ReloadUtil:addWeaponType(wepBow1)) for the item that was clicked on and uses the item name to do so. If it finds one, it looks at the lua weapon type's reloadClass field... and then sets up the item to use the corresponding lua file for performing the reload activities. It is important to remember that this is done once for an item. After the first time, it uses the item's modData (information about the item that is saved out each time PZ saves). One of the pieces of information saved is the reloadClass. What I want to do is twofold... 1. Everytime you see an if statement checking the reload class in the two functions I mentioned, print the reloadClass before the if statement so we can make sure it is correct. 2. Make sure you are using a clean save so that nothing incorrect has persisted. I'll admit the reloading stuff can be a bit confusing. I can try the script myself and see if it works. Is there anything in addition to the snippets you've posted to test this?
  5. Keep noticing something new each time I look. The command window screenshot you posted says that the error occurs in ISSemiAutoWeapon.lua. However, the file that it should be using is ISShotgunWeapon. This is determined by: reloadClass = 'ISShotgunWeapon'. Why it is using the wrong one for this weapon only I still can't understand. From a new game, put a bunch of print statements in the ISReloadUtil:setUpGun(weapon) function and the ISReloadUtil:syncItemToReloadable(item) function. Try and determine why it would be going into the ISSemiAutoWeapon branches of each of those.
  6. Ok... as a sanity check, can you just try removing the space from the item name.... 'Homemade Bow' -> 'HomemadeBow' Also, check every field in the item (I can't remember and don't have the code in front of me... apologies). My concern is that one of the reloading scripts is using the name to identify the weapon type and there is some sort of mismatch or the name is null
  7. Can you check that wepBow1 variable is assigned immediately after creating it (do a print statement or something). The complaint is that it can't find the ammoType field in a null table.... i.e the table doesn't exist. I'm concerned the assignment to the wepBow1 variable is being lost somehow.... Things to try: 1. Change the variable from local to global by removing the local keyword.... Maybe the table is being deleted. 2. Check the addWeaponType function is actually working. Put some print statments in the reload util lua
  8. Sorry. I guess I should have read the problem properly.... When writing lua scripts loops can not be used to wait for something to happen. Nor can you tell the thread to sleep for a little bit. Essentially doing so will cause the entire game to wait for the loop to finish and since the game never changes state, the game time is never increased and your while loop will always return false, waiting for eternity. What I think people tend to do is add functions into the onTick event of the game. Something like, local startTime = GameTime:getInstance():GetMinutes()local myFunction = function() local currentTime = GameTime:getInstance():GetMinutes() if(currentTime == startTime+5) print('5 minutes has passed') endendEvents.OnTick.Add(myFunction)Essentially you should think of tha game as being one massive loop. Everything in the Events.OnTick collection is executed once every cycle of that loop. There is a more complex solution in this thread: http://theindiestone.com/forums/index.php/topic/1931-how-to-delay-processing-of-a-function/
  9. Object tried to call nil is referring to the method getMinutes() which is doesn't exist in your code. The way you are calling it, you would need your own lua function called getMinutes(), wheras what I think you want to do is call: GameTime:getMinutes() or GameTime.getMinutes() I'm not sure which off the top of my head. Essentially you need to specify that you want to call the getMinutes() function on the GameTime object. In short replace line 29 with mins = GameTime:getMinutes() You may need to change the colon to a period... I've not used lua in ages.
  10. Do item files permit free text such as The CureCreated by BassairFor Steam Build 21 Where exactly is the crash? (Posting from work)
  11. It's actually "Themâ„¢" Can't infringe on that copyright. OT: What's wrong with just calling them zombies? That's what they are in the end. I think the canon for most zombie's is that the concept has never been encountered before in any context unlike vampires/werewolves which have a richer legend. I think the battery (http://www.imdb.com/title/tt2272350/) is the only one to have actually referred to them as zombies and even then it's reluctantly.
  12. Presumably the intention would be it is either an acquired skill or a very expensive feat and wouldn't be every man and his dog. This idea is very doable. The decay slightly harder due to the map streaming.
  13. Stormy

    Explosions - again

    I think in that one you're looping through the surrounding tiles without taking into account walls that might be blocking the route. I could be wrong and have been wasting my time.
  14. Stormy

    Explosions - again

    http://youtu.be/5Yqp2tpR9ws
  15. Stormy

    Explosions - again

    Been working off and on with this for a while now. Scraped enough together for a short video. http://youtu.be/cmrYgd1Ys9c If indoors, explosions fill the space they're in. I think fire is turned off in the version of zomboid I'm running. There are a few things I'm still struggling to work out such as knocking back zombies; Sprites are drawing in a funny way; really should be animating the explosions. I also need to factor in the z axis and door/window destruction.
  16. Stormy

    Moving dead bodies

    sprite = IsoObject.new(gridSquare, zombie:getSprite:getName(), "ZombieCorpse") square:AddTileObject(o.sprite); (untested )
  17. Stormy

    Moving dead bodies

    The camping.lua has a good example of drawing sprites on tiles (If I remember when I get home I'll dig out the code). Each sprite will presumably have an identifier and you may be able to retrieve it from the IsoDeadBody. You can then use this to recreate the sprite in the new tile.
  18. The camping lua scripts contain information about placing items in the world. In fact there should be a good example for placing items in there because the fireplace is placed in much the same way as you would like to.
  19. The language used in the item.txt is zomboid's own. Extending these items isn't really possible, you just copy the entry and replace the values you want. I don't have the code in front of me so this probably won't be very useful but I'm guessing the recipes are operating in one of two ways... a) you define a list of possible items that can be used as each ingredient. in which case you just add the new item to the respective ingredient list b ) you have a series of near-identical recipes with slightly different names and ingredients. In which case you need to add your own.
  20. I've implemented this. Going to sort out bolt action next and sort some more bugs. Will upload it all in a few days.
  21. It doesn't work for me either. I'm guessing you need to register first.
  22. Just to make clear so no-one feels like I'm stepping on their toes. I'm simply making the reloading mechanic easier to be taken advantage of by other people. I am not adding items myself for anything more than just testing. For example, If I implement bolt action reloading that uses a magazine, I will not add any sprites, items, or animations. So if your character requires a rifle, you can create the item, the sprites etc and then have it implement the relevant reloading style through the links provided.
  23. tommysticks has provided me with the line that the capacity inconsistency is originating from. I'll double check when I get home from work and fix that one. If I'm not too tired I'll also implement the revolver reload style which I haven't got round to doing yet. The reload difficulty would be saved where other settings such as keyboard config and screen res are being saved. If they are being saved, I'll track down where that needs to be done as well. I've took a quick look at the MainOptions.lua and on line 567 there is a call to the getCore():saveOptions(). This is a call to the java which must be handling the settings. It may be difficult to get this to save out but I can take a look.
  24. I'm not an expert on the mod directory stuff. I'm running off this: http://theindiestone.com/forums/index.php/topic/2011-how-to-use-the-modloader/ So if the C:\Users\Stormy\Zomboid\mods\ doesn't work and the c:\program files x86\steam\steam apps\common\PZ\ I don't know what to suggest. You can work by dropping the files into the actual directories. Can you launch the game, go to the mod screen and tell me what the filepath it suggests there is?
×
×
  • Create New...