Jump to content

Search the Community

Showing results for tags 'isoobject'.

  • 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 2 results

  1. Creating and Manipulating World Objects Seen questions pop a few times regarding placing objects on the map so decided to make a little tutorial on it. Most of the tutorial is written in a single file included in a mod you can download below. The code is commented so you can see whats going on. I recommend loading the lua file in your favorite editor and starting a custom game without zombies with the mod activated in windowed mode so you can play with the mod ingame and read the stuff in the lua file. How it works? The mod allows you to place a red cube on a empty tile, every time you click that tile again the code will do some stuff with the object, you can all see it in the code comments. Target audience. The mod is written for beginning modders, however it might be that there's some stuff useful for more experienced modders here and there. You'll have to judge it yourself. Code. The code is written so that one can follow the tutorial line by line, as such it does not reflect proper implementation but rather serves as a showcase of things you can do and implement properly yourself. You can also build uppon the code supplied in the mod to use it as a testbase for experimenting with objects and their methods. I suggest also digging in TIS lua files regarding buildable objects and their context menu's. About sprites. To create a graphic for your object you'll need to make a transparent image of 64 width and 128 height. This covers one tile and one layer of height in the game. Included in the mod are a few sprites, i suppose you could use "cube_floor.png" as a template: About java. It's highly recommended you have some way of looking up java source classes & methods. The javadocs can be used, personally i've used JDGUI up until now. With JDGUI you can open any class file in <root>/zombie/ directory and it opens up the entire project space as such: Many of these classes are made available in lua to work with. Often they require to be constructed first. To do so you can look up the constructors: In lua you'll have to use the 'new' method like so: local myObj = IsoObject.new("parameters here");By matching the set of parameters in .new() to the ones found in the java constructors you can call the appropriate one. All other methods can then be called on that instance of the IsoObject like so: myObj:setSprite("test");local sprite = myObj:getSprite();The lua file for reference Download Regards, Turbo
  2. 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!
×
×
  • Create New...