Hello Guest

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - profanicus

Pages: 1 2 [3] 4 5
31
I've had this happen a couple of times on PC with earlier Unity versions as well. I don't know what was causing it but the solution was to delete the library folder and let Unity rebuild everything, assuming you are using meta files of course.

32
Support / Re: [2.1] Rearrange the tilemap palette
« on: August 02, 2013, 07:37:02 am »
It's probably referring to the scratchpad, check out the reference for a quick run-down on it.

33
Support / Re: Animating the Alpha in a Sprite
« on: July 31, 2013, 11:23:59 am »
I tried it and you're right - seems like a bug. The animation clip moves the sliders but the sprite itself doesn't update. But it does when you drag them manually or access the property through script.

34
Support / Re: Help! I lost my text shader!
« on: July 30, 2013, 04:44:55 am »
Gradient font uses the test_0 texture.

35
Support / Re: Advice needed for design of 2D title with 2D Toolkit
« on: July 19, 2013, 02:09:59 am »
3. Does the tilemap support animated tiles (not a big deal at all, just curious) and does it support having an opaque material and a transparent material? not sure how all that works yet, still diving in!

I saw this wasn't answered:

No support for animating tiles. It's fairly easy to do though, just SetTile through a sequence of different ids. Obviously only change what is visible to limit Build cost.

Sprite collections do support multiple materials, and hence so do tile maps. You've probably already read this by now but here is the doc page on it.

36
Support / Re: OnDown event not triggering
« on: July 19, 2013, 01:48:20 am »
Ok I figured out why it's not working. I was missing the OnEnable and OnDisable methods. Why are these necessary? I haven't seen these referenced in any C# events tutorial, or as a method inside Unity.

They are referenced in the Unity docs, check out the list of Monobehaviours here.

37
Support / Re: Unity Versions
« on: July 19, 2013, 01:44:36 am »
Unity recently made a big song-and-dance blog post about the quality of their product and how much money they are putting into QA and bug fixes. Hopefully some of these materialise soon, as Unikron has mentioned that some issues pointed out a year ago still aren't fixed in the latest 4 version.

Personally I switched back to 3.5 after hitting that nasty lighting bug with the custom camera matrix, since 4.2 has been such a long time coming and they don't seem to be rolling these fixes into the smaller releases. I'll be glad to go back to 4 once it's actually working properly, but somehow I get the feeling that tk2d 2.2 will be out before that happens... ;)

38
Support / Re: Font outline - Changing color along with text.
« on: July 19, 2013, 01:06:04 am »
Unikron mentioned distance fields in another thread, so I was thinking maybe that is something you could look into for this? I imagine you would need to export from your font package with extra padding though to accommodate the distance information it uses.

Here is Valve's original paper on the technique, which includes how to do outlines (and drop shadows) in the shader. And here is a way to make the distance data without an encoding application, using Photoshop.

Note that I haven't tried any of this with tk2d, I was just reading about it after Unikron mentioned it. :)

39
Support / Re: Advice needed for design of 2D title with 2D Toolkit
« on: July 18, 2013, 07:10:05 am »
Hiya :)

We need advice on what parts of 2D Toolkit to use ie best tool for the job advice please:

1. we need to make a tile based level with lots and lots and lots of tiles. Lots of them. It's a big level.

2. we need to be able to render some of the tiles either invisible or just hide them. This would need to also remove any collision within that space for the removed tile.

3. we need to query the kind of tile it is - is it a tile that can be destroyed? This isn't too vital, we could maintain separate lists for destructable tiles and solid tiles.

4. A nice-to have would be to change the image of that tile, for example, progressive damage to it.

That pretty much sums up our total needs. Thanks for any advice.

2d toolkit is going to make this easy ... :) The tilemap system is what you need. Basically 2d arrays where each grid location holds a sprite of a particular id, which you can change programmatically. You can have multiple layers, and paint vertex colours (not per layer yet though).

1. Get 2.1 beta 2, and check the tilemap demo included in that, it's fairly sizeable. The editor chunks the resulting meshes to your size specifications, and defaults to a good 'batchable' size for each bit of mesh. If it's so big that you'll need to be streaming meshes in and out, well Unikron can comment on that, and practical limits to the system...

3. Use GetTile and GetTileAtPosition to get the ID of the sprite at a tile grid or world location respectively. Then use that ID in GetTileInfoForTileId to get the structure that holds the metadata.  Each tile type (sprite ID) has built-in string, int, float and prefab (no bool) which you set in the editor, under Data tab. The beta 2 demo also shows the use of the prefab system.

2 & 4. The sprite at a particular tile location can be changed to another using SetTile, and cleared using ClearTile. Call Build after all changes are complete. Any changed collide will be automatically rebuilt (so Cleared tiles will have no collide) but I understand collide changes are relatively expensive. Your collision is set up on the sprites themselves in the Sprite Collection editor.

The system can also read in Tiled .tmx maps if you want to use that editor for some of its advanced auto-edging features, or if you are thinking of procedurally generating maps then some people around here have done that as well.

40
Support / Re: TileMap Questions
« on: July 15, 2013, 02:45:21 am »
Pretty sure the 2.1 scratchpad feature will handle both of those, yes.

Select all your 'x' and 'o' tiles using the rectangular picker as normal, and paint them into a new scratchpad. Name it 'tree' or whatever. Then use the eraser/delete like normal to remove the 'o' bits from the tiles in the scratchpad. Then you can 'select all' on the scratchpad whenever you want to paint the tree. All your scratchpads are saved between sessions.

41
Releases / Re: 2D Toolkit 2.1 beta 1
« on: July 14, 2013, 11:40:03 pm »
Started supporting 2D Toolkit. I think it's just so well supported. Will be buying my copy when I get round to needing it. The sprite attach stuff pushed my fat ass over the edge to migrate :)

Question though - with your tilemap stuff, can we remove tiles during play on a temporary basis - ie user wants to create dig dug? Also is there meta data somewhere for identifying what tile it is so we can just procedurally add collision?

Thanks for supporting your work - many people don't.

The support on this product is fantastic, I don't know how Unikron finds time to actually do anything productive!

You can change the tile type at any given co-ordinate on any layer freely at runtime, which includes a 'clear' type. After all your changes you call 'rebuild' to recreate the mesh - I'm not sure if it rebuilds the whole layer or just the affected chunks.

You 'get' a tile by passing either X & Y grid or world space co-ordinates, and it returns the type of tile at that location. If the tile is 'clear' then you get a -1. You can then access the info for a tile, which includes some user meta data - a string, an int, a float and a prefab. A prefab will spawn automatically though this replaces the tile visual.

42
Releases / Re: 2D Toolkit 2.1 beta 1
« on: July 11, 2013, 07:26:09 am »
Unikron, it looks like lighting on tilemaps does not work atm.
And i cant use this to fix it: http://unikronsoftware.com/2dtoolkit/forum/index.php/topic,1080.msg5137.html#msg5137

Am I missing something?

Find the tk2dTileMapMeshBuilder.cs file, search for this line:
Code: [Select]
chunk.mesh.RecalculateBounds(); and add this below it:
         
Code: [Select]
chunk.mesh.RecalculateNormals ();

43
Support / Re: Zooming in while maintaining UI position?
« on: July 11, 2013, 02:14:17 am »
Make sure the anchor is the child of the ui camera. Ideally make the anchor through the Create menu rather than adding component, as tk2d then forces you to stick it on a camera.

44
Support / Re: Zooming in while maintaining UI position?
« on: July 11, 2013, 12:04:25 am »
When I import the anchor package, it seems that the two editor scripts crash Unity just like it did for profanicus. For me, however, it crashes when I import either the tk2dCameraEditor.cs OR the tk2dCameraAnchorEditor.cs. I have no clue what the issue is.

Yep this happened for me with the anchor package, and again with the 2.1 beta as well. After it crashes, manually deleting the camera editor files in explorer and re-importing worked for me.

45
Support / Re: [QUESTION] 2DTK Camera Has Me Completely Confused!
« on: July 10, 2013, 12:36:06 am »
Ortho size is basically half the physical viewing height of the camera.

Example: if you stacked 10 one-meter cubes in your scene such that they are centered to the camera in the game view, and set your ortho camera to size 5, then the cubes will fit exactly between the top and bottom edges of the game view. Set ortho size to 1, and you will see two of those one-meter cubes instead.

Personally I'd use the 2.1 beta and use the awesome new 'pixels per meter' setting instead. :)

Pages: 1 2 [3] 4 5