Jump to content

RAINBOW

Member
  • Posts

    103
  • Joined

  • Last visited

Everything posted by RAINBOW

  1. "Tin can traps" When you eat a Canned food item, you get an empty tin can. When you have a few tin cans, why not use the wire item to make a noise trap, similiar to barbed wire. It would make noise when a player or deadhead was within distance, and is subject to damage.
  2. marfiuss, "EasyPickins" (The post before this one) has given you the solution there but if Enigma is right, is it true then, that this solution won't apply to Build26 servers? That's pretty devastating to those of us hoping to have persistent worlds running.
  3. AH! Badtrix, I scrolled up and noticed your post- I neglected it the first few times I sought help here- IsDoor and IsWindow are DEFINATELY in there mate. As for IsoThumpable- something either "IS" or "ISN'T" thumpable. so you set your window objects(thumpable value) to TRUE. Pre-existing code is the best thing I'm finding about this lua malarky! it's when you gotta write your own stuff it becomes hard, anyway, check out the lua files in the "require" field at the top- because you're a bit new, you might not realise that -all- the functions within the "require 'xxxfilename.lua'; at the top of (Some) of your code will ALSO be fully available in whatever one you are currently editing. In other words, keep open more than one window in your IDE (Notepad++, Eclipse, IntelliJIdea etc) when you have those require statements. They are also known as "#includes" in some other languages. Hope I helped a bit. PM me anytime anyway, I'm pretty sure what I explained will help you out. Just wanted to make sure of this too for you: Where I say "True" make sure it's not the value "1". This is NOT the same thing as true (Like in some other languages). Also, did you know values don't default at "Zero", that lua has a unique identifier called "Nil". It's pretty handy, but you'll find that out further on down the road.
  4. Haha, excellent. Sometimes a repeat post is needed with me. Thanks for being patient. "Code" was definately a bad choice of words on my part, I was after a way to 'end' a context menu. There is literally no documentation on this stuff, most of the stuff is commented in the code, and I am not averse to trawling through it- Incidentally, I dug open the Erosion mod, and it utterly, utterly terrified me. it was too big for me to make sense of what was going on, except on a micro level.- anyway, I'm never looking for complete solutions, but rather a "Way" of doing things. I gotta mention as well, I'm COMPLETELY new to lua! I know my java, but I've no idea what I'm doing with lua. It's proving not too bad, I mainly hit stupid syntax problems. I'm certain too this thread will prove useful to the community too, certainly later on, when the modding community REALLY explodes! After all its got a for loop cycling through a table value- AND a Timed Action! someone out there except me -must- be having similar probs. I got my mod working now where when a player "Right clicks" on a tile with the default "Military Grade Fence" sprite, it will add a new property to it, (after checking it hasn't been done before) and bring up the Context option "Cut Fence". From there it just fires debug statements, but it's not hard to alter the original sprite properties to a new an improved sprite(Image) of a cut hole in the fence. (I hope!) I'll need to add in the IsoProperty "IsClimbable" too, but hopefully that won't cause too many issues as that is pre-existing code.
  5. Enigma, what do all these "Nils" represent? _context:addOption("Hi!", nil, nil, nil) I thought I'd be able to plug in "ISTimedActionQueue.add(TAFenceChop:new(_player, v, 50)" here, no joy though.: _context:addOption("Hi!", ISTimedActionQueue.add(TAFenceChop:new(_player, v, 50), nil, nil) Whats the code for removing a context option?
  6. Enigma. Wow. You completely nailed what I was after- Here's a screenie of what I needed returned, and now thanks to you I have! fencing_01_50 is indicative of the "Military Grade" fence that is one of the default fence objects that people can use in their maps. I thought about being selfish, and writing a wee bit of code that would only work when I make my own map, but there's no reason(now I have this) that I can't make it universal, so it grabs the sprite from a right click, and package it in a "Bolt cutter" mod. All I added was a "v:getSprite():getName();" and right clicked the military fence in my test map! I've also learned something here, using a for loop in lua to cycle through a table! For anyone wondering what I was doing wrong, here's the important bit of code that Enigma linked: for i,v in ipairs(_worldObjects) do square = v:getSquare(); square:StartFire() end I had neglected that worldobjects was a table value. The for loop acts here like a "ticker tape dispenser" pulling out the required part, so that the letter v (the IsoObject in this case) becomes relevant.
  7. Enigma: "v is the "IsoObject" that I right click on" Harraka: Ah! So you -can- set the properties of a tile in Tilezed somewhere... Okay, first on the agenda is download the EROSION mod. Take a look under the hood there. Thanks guys. Back in a tick
  8. The lipstick decal thing is a good one. I'm still experimenting with my code affected my world map though, so it'll be a while before I will be able to do it.
  9. I should probably clarify, I tried doing "GetSprite" calls, "GetName()" and things, and I couldn't seem to grab anything "Unique" to a chain link fence. for example, when debugging, a "getObjectName();" returns simply "IsoObject". Nothing unique to the fence.
  10. Okay! In my endeavour to create a "Boltcutter" item, I'm comfortable with creating my own sprite, and it acting as an inventory item- There's 2 things I need to know however that relate to "Affecting the world" which are: 1: I have FORGOTTEN! the name of the lua file that the "OnGameBoot" event uses to cycle through literally everything on the map, I had it last night at 2am, but forgot to put it in my notes! (If anyone can help I'd appreciate that!) 2: Creating my own IsoObject. I'm happy that I can overwrite the "OnFillWorldObjectContextMenu.fetch" when a player right clicks a square, but ultimately what I am looking for is where the "v:getSprite():getProperties();" is originally set. (v is just the instance of the IsoObject right clicked in the fetch.) Once I know where the IsoObject:setProperties() takes place, I should be able to dig out the "Default" Chain link fence sprites. I ran all of the methods I could find in the javadoc to try and dig out any kind of unique identifier I could- Perhaps the IsoObjectType is set in the map editing suite somewhere? Anyway, I'd bet this would be a useful thread to anyone actually wanting to affect the world, in particular default items. Cheers in advance!
  11. Anyone out there know what the format of paint files used is for the standard .bmp files used in custom maps for PZ? I only ask, because I prefer photoshop to "Paint.net" which is listed in this (Excellent) mapping tutorial, Here. Other people might use Illustrator or whatever. But its nice to be able to use the tools you are comfortable with- OH! I should probably explain why I don't use Photoshop "Anyway" as it will work just as well, - Well, the WorldEd map tools were generating some odd errors (I suspect in no small part because I was saving in a weird format) such as the colour for "Sand" not being recognised (210, 200, 60 - I think? from memory) in the top leftmost corner up to fifty pixels of my map- and paint.net worked fine. Anyway. anyone know?
  12. My suggestions! (Also my changelog from my server, things I hope to implement) Game Features * Whisky cleans wounds * Scurvy from no vitamin C * Crowbar/lockpick/bolt cutters automatic use when in secondary slot * Clotheslines. Dry clothes. * Tumble Drier appliance, dries clothes. * Amputation * Make faucet clunk noise (When water shut off) * Weapon jams * Lipstick. Can (type) 'graffiti' on stuff (A decal) * Suture party members wounds with twine * Gas powered electricity generators for houses * Option on game start to alter percent chance of zombification * Corrugated iron Childrens chemistry set Flares smoke grenades Fishing Net caffeine pills Spices - can cover up the taste of rotten meat, removing the nausea effect Boltcutters, cut a hole in chainlink fence Padlock Bag of Doorknobs(Weapon) = Doorknobs + sheet Makeshift riot shield = Garbage can lid(When equipped in secondary) TRAPS! Quality rabbit trap : Mailbox + Twine (Catchs cotton tails as Dale says!) Stake Trap : Wooden Plank + Kitchen Knife OR Screwdriver + Fresh Meat (Zombies spear themselves on them as they are daft and approach to get the meat) Tin can Trap : Tin cans + Twine + Sturdy sticks
  13. Lots of stuff needing added first though, as a coder there are definately things there that are higher priority for them. Sucks. But it is smart. There are lots of things missing in the code, let's not jump the gun, our time can be spent better while we wait. At least that's my opinion. I haven't even got a 'proper' website up for my server yet, or an IRC channel... (Did you know there are custom functions in PZ that hook into our IRC channels? Fucking awesome. ) I've got two guys learning the map editor making stuff but I'm busy learning lua. Phuket, I'm going to take a stab, and guess that you are revamping the game into something completely different? I'm glad directX is the format that models are being used in PZ tho. That is the best supported in all the 3D modelling programs for export/import.
  14. I had a scout around the lua files, and even checked on the javadoc, wasn't able to find any way to communicate except for the "Q" key to yell/attract zombies. (Or skype etc with an outside/third party program) Is it safe to assume it will be implemented later on? Or am I just not looking in the right place? EDIT: I found the Chat folder here: "C:\Program Files (x86)\Steam\SteamApps\common\ProjectZomboid\media\lua\Chat" and I have noticed the event is commented out- why? is there more work going into it? -- Here is the event that has been uncommented out. (Build 23 at time of posting) Events.OnKeyPressed.Add(onToggleChatBox);I'm going to rifle through the "Changelog" for the newer builds again, see if there's something I missed-
  15. This makes alot of sense to me now. My tutorial needs redoing I fear! - Where you write: local oldF = ISEatFoodAction:perform(); and then call it later on, it certainly saves on a whole load of redundant code that occurs when doing it 'my' way!!! I wasn't aware you could store a function like "ISEatFoodAction:perform();" in a local variable, you use "oldF" here.
  16. WOW. You weren't kidding about the UI being pretty intense. I think I'll just wait until you dev's create a "Join Server" option. I don't envy you the task having took a look "under the hood" there- Consider the thread closed- I've just got so much more I could be getting on with, especially when considering you(The Devs) will probably add that stuff in once you're happy with the multiplayer beta testing. Seriously. Wow.
  17. AH HA! I found a folder called "OptionScreens". Took some trawling but I got there!
  18. Where should I begin looking? Any suggestions RoboMat? I'm just not sure where to start with regards to if this is even possible. I'm currently digging in "ISButton:new" inside the ISButton.lua
  19. I've had a look inside the "LastStandSetup.lua" found in the SteamApps/lua folders. I noted that essentially, the Last Stand and subsequent Challenges, are in fact written as if by the way of a modder- that is to say, everything in there is handled from event handlers. Neat. I've took it upon myself (after being unable to find anything on the forum under User Interfaces), to have a shot at achieving the following: STEP 1: Create a button that slots in alongside the initial game UI. Like so: STEP 2: Once the button is clicked, execute the code to join the server's I.P Address. And thats it! basically! I haven't looked at any of the multiplayer code, but I've been diving into the UI stuff, would I be right in assuming it is not without the realm of possibility to use the following event: OnPostUIDraw To create some kind of button to achieve this? Watch this thread for more progress as it happens-
  20. I think really, it's more than a mod in the traditional sense of the word. The idea is to be able to have players who join the ability to affect the world through version updates. A persistent world, see? I'm breaking it down into malleable parts, you see I'm implementing a custom "Questing" system once some more NPC tools are available. Thats number one on the agenda, but has been sidelined until afforementioned NPC tools are brought in. I'm chalking other things off the list one by one as I go. I started with the custom trait : "Vegetarian", which is now complete apart from the part which applies the Moodle effect Nausea, because (Surprise, surprise!) MoodleFactory simply doesn't exist yet (Build 23 at time of writing) To give you an idea of 'scheduling', my mappers haven't created anything except a test map for last stand (So far!) but it has taken me 1 week to create and test the custom trait I added in, I'll come back here after I complete the next part I think I'll check off the list, which will be: Crowbar can break into windows automatically if in inventory I'll revamp the Secondary Slot into a customisable system, which will make actions like crowbaring a windor, or lockpicking a door a case of simply left clicking it. (Haven't looked, but I'm guessing I'll start in the OnFillWorldObjectContextMenu.lua)
  21. RobertJohnson, this forum post inspired me to write a tutorial on where to go/how to navigate through the lua to write your custom code. I've put it on my persistent worlds website. The advanced tutorial will follow on from it, showing people how to write the custom code itself- I reached a point where it is better to wait for some more development before I post the second part or continue with the custom trait- The development, incidentally, is for MoodleFactory related methods, which (I think?), are currently not implemented(nothing in the javadoc), but probably on the way once higher priorities are sorted out. Note: The fact they are not implemented only bolsters my faith that I have joined this modding community at an early stage, and that wonderful things are on the horizon for my server, since I will have plenty of time to prepare my server before the game hits a peak player count. OH! Here's the link to my tutorial Edit: Has undergone major changes since a week ago- http://www.sanctuary-pz.com/#!tutorialvegetarian/c1su
  22. I've written my own tutorial which leads on from your excellent "custom profession/custom trait" tutorial. It shows how I personally "Hook" into the lua files to create my custom code. Alot of people will be familiar now with the basics, I think, and are eagerly awaiting your next part! If you wish to check out my tutorial, you can find it here, on my makeshift website- http://www.sanctuary-pz.com/#!tutorialvegetarian/c1su It (hopefully) shows how you can hook into the custom right click function and associated methods, in this example "ISEatFoodAction" or in other words, how to execute code whenever a player finishes eating something. Note: it's designed for intermediate scripters/programmers, but it is very comprehensive, so give it a go even if you are a beginner, remember, ultimately, all I do in the whole thing is use the Ctrl+F or "Search" function to find key terms. But it gives a pretty good idea of navigating through the whole lua/java stuff.
  23. If any other modders or beginners, or the admins have some suggestions or ways to improve the tutorial, let me know, i'll amend it.
×
×
  • Create New...