Search Unity

TowerDefense ToolKit 4

Discussion in 'Assets and Asset Store' started by Song_Tan, Apr 18, 2012.

  1. MajorNightmare

    MajorNightmare

    Joined:
    Nov 27, 2012
    Posts:
    4
    Hi Song,

    Love it, but the new version won't load now!

    Fatal Error: type == kMetaAssetType pathName.find("library/metadata") != 0

    Yes 2 versions would be a nice, 1 for 3.5 users and another v4. I had the previous version working fine in version 4. Now I get the error above I think on the FlameTower asset during the import from the asset store.

    I'm pretty much stuck now. Bitmap2Material won't export in Unity 4 and TDTK only works in version 4. Well used to...
     
  2. puzzlekings

    puzzlekings

    Joined:
    Sep 6, 2012
    Posts:
    404
    Hi Songtan

    I have been evaluating the Free version and the toolkit is very impressive, so great work - I am just about to buy this.

    I do have a few questions.

    1) I wondered why sometimes a Build Platform has a red square rather than a green square which prevents building. It seems to be something to do with the positioning related to other objects? i.e. if I move the platform up or down a bit then it seems ok?

    2) In the future might it be possible to support building on platforms that are tilted? is it might make for some really interesting ideas.

    3) Which interfaces does the iOS version support?

    A couple of other suggestions just to back up what others have suggested a) Unity 3.5 4.0 support in one b) the ability to support curved paths and c) showing any kind of integration with the turret tower prefabs would be great

    Once again many congrats on the whole toolkit, and the videos were very helpful. Looking forward to getting the full version.

    Cheers

    Nalin
     
  3. uskak41kw

    uskak41kw

    Joined:
    Dec 5, 2012
    Posts:
    4
    1)That happens cos platform crossed by some colliders. You can remove collision from the buttom object, platform got own collision.
    2)You can do tilted platforms, just comment or remove 88 string in build mananger script.
    //make sure the plane is perfectly horizontal, rotation around the y-axis is presreved
    basePlane.eulerAngles=new Vector3(0, basePlane.rotation.eulerAngles.y, 0);
     
  4. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Hello all,

    Sorry for not responding for your post. I've been disconnected from the internet for the past few days.

    I understand that there has been some issues regarding the new update to Unity4. I'll remedy that as soon as I can when I'm back to my normal work place next Monday/Tuesday. Expect a fix that support both unity3.5 and unity4. While I'm on that, I'll try to incorporate all the small fix or add sample prefab where it's needed.

    Now to answer what I can:

    1. it's just like uskak41kw said. check the collider in the scene.

    2. again, it's just like uskak41kw said. However I cant guarantee that everything will work perfectly after you disable that line. I'm pretty sure I disable tilted platform for a reason.

    3. I dont quite get what you are asking. But the full version comes with 2 additional UI which supported mobile platform. It support touch input. The camera too.


    Once again I'm very sorry for all the delays and inconvenience caused.
     
  5. uskak41kw

    uskak41kw

    Joined:
    Dec 5, 2012
    Posts:
    4
    So what about prefab of full animated tower? :)
    Upgrading makes my turret to loose turret element )
     
    Last edited: Dec 12, 2012
  6. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    I got that. I'll see what I can do about it.
     
  7. uskak41kw

    uskak41kw

    Joined:
    Dec 5, 2012
    Posts:
    4
    Attach it anywhere asap for now please. :) That is last thing what separates me from buying full version. This and upgrades. Will be very useful for upgrades to copy a previous version of the tower in inspector. For example, when i doing all the same in lvl 2 turret - after upgrading my turret loosing barrels (turret object ellement).
     
  8. EdibleDeflection

    EdibleDeflection

    Joined:
    Nov 21, 2012
    Posts:
    2
    Thank you for the info. (I thought my original post actually posted but did not, I have been away for some time). Anyways, we are still plugging away at trying to solve the save issue and hopefully will have it figured out at some point.
     
  9. Tsurugi

    Tsurugi

    Joined:
    Sep 21, 2012
    Posts:
    97
    hi songtan
    did u get my email regarding the issue of the pie chart if not i have send u one mail to your gmail and another to your unity account...
     
  10. digitalzombie

    digitalzombie

    Joined:
    Dec 10, 2007
    Posts:
    86
    In the asset store, the description says it requires Unity 3d 4.0. Is there a 3.5.7 version? Thanks.
     
  11. puzzlekings

    puzzlekings

    Joined:
    Sep 6, 2012
    Posts:
    404
    Thanks for the replies Songtan and uskak41kw.

    Will let you know about tilted platforms ;)

    N
     
  12. John-Sandrey

    John-Sandrey

    Joined:
    Jul 2, 2012
    Posts:
    119
    I was just wondering how the 3.5 support is coming along?
     
  13. John-Sandrey

    John-Sandrey

    Joined:
    Jul 2, 2012
    Posts:
    119
    I seen you fixed the NGui in your 4.0 to where I can get rid of the unessary ui scripts, what can I do to fix this with 3.5?
     
  14. skyinworld

    skyinworld

    Joined:
    Dec 2, 2012
    Posts:
    1
    Shoot Object will be emitted in the base of the tower,
    How can the object to be launched in the barrel?
    Thank you
     
  15. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Hi all,

    I'm finally back to my normal work place. I'll finish the update (unit3.5 and unity4 compatible version) by tomorrow, hopefully along with other request. Thank you for your patient and understanding.

    @Tsurugi, I got your mail. Will work on it.

    @digitalzombie, version compatible with Unity3 should be coming real soon.

    @uskak41kw, you mentioned loosing barrel object when upgrade your tower. What do you mean by loosing exactly? Does the barrel stop animating or it stop to trace the target. Did you assign a new barrel or turret object for the upgrade? I did discover some bug when revising the code so I'm fixing that. But if you shouldnt have a problem if you left the gameObject or animation field such as TurretObj, BaseObj, Clip, etc. empty. Those field are meant to be left unassigned unless you want a different turret/shootObject/animation for the tower upon upgrade.

    @skyinworld, take a look at prefab missle tower, specifically at the child object turret. It contains a component TurretObject.cs which allows you to assign shootPoint(s) for the turret. The shootPoint are meant to be empty gameObject placed under the hierarchy of the turret which act as a reference point of where the shootObject should be fired from. If you haven't assign any shootPoint or indeed you turretObject hasn't got a TurretObject component, the shootObject will be fired from the position of the tower object itself.

    Hope that clear some doubts. Once again, very sorry for the inconvenience.
     
  16. digitalzombie

    digitalzombie

    Joined:
    Dec 10, 2007
    Posts:
    86
    Thanks. Looking forward to it.
     
  17. John-Sandrey

    John-Sandrey

    Joined:
    Jul 2, 2012
    Posts:
    119
    Thanks Songtan looking forward to it to.
     
  18. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Just uploaded the new update which should be compatible with both Unity3.5 and Unity4 to the AssetStore. Hope it will be live soon.

    Please note that I made a name change to Platform.cs to PlatformTD.cs to avoid conflict with other 3rd party package. You might have to change the file name in your project in order for things to work properly
     
  19. Tsurugi

    Tsurugi

    Joined:
    Sep 21, 2012
    Posts:
    97
    songtan i tried the script you sent me and it didnt work. here is a pic of what the console said.....

    can u make something that will tell the players what the enemy type is.... i will attach a pic to explain.... $Capture.JPG $Capture2.JPG
     
  20. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Just sent you another copy. Please try that out.

    Regarding the incoming enemies info display, it's not really an easy fix since it will involve additional UI element. I'll see what I can do, it will probably be an addition of the next update, if I can make it.
     
  21. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Christmas/New Year sales! Currently at $55 down from $80. Limited duration only! Get it while it last!

    Sorry in advance for the shameless plugging. :)

    Have a great holiday season!
     
    Last edited: Dec 20, 2012
  22. John-Sandrey

    John-Sandrey

    Joined:
    Jul 2, 2012
    Posts:
    119
    Thanks for the update but when you get time, can you take a look at the NGui examples. They work fine the first time around, but when you complete all the waves and hit restart the wave spawning only spawns one wave and the wave counter does not increment up. The normal examples work just fine so I am thinking it is in the NGui UI code when the game is reset.
     
    Last edited: Dec 20, 2012
  23. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Of course. Thanks for letting me know. I'll look into it.
     
  24. John-Sandrey

    John-Sandrey

    Joined:
    Jul 2, 2012
    Posts:
    119
    Oh if it helps, when the wave timer counts to 0 nothing spawns and starts to count negative. You can hit the spawn button and they will spawn but the wave is not incremented.
     
  25. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    I've found the bug. Just a small typing error. Please change line215 in UInGUI.cs form
    Code (csharp):
    1.  
    2. SpawnManager.onWaveStartSpawnE += OnNewWave;
    to
    Code (csharp):
    1. SpawnManager.onWaveStartSpawnE -= OnNewWave;
     
  26. John-Sandrey

    John-Sandrey

    Joined:
    Jul 2, 2012
    Posts:
    119
    Yep that was it thanks.
     
  27. supernat

    supernat

    Joined:
    May 3, 2011
    Posts:
    45
    Hi Song,

    Thanks for a great toolkit. I am using the toolkit somewhat outside of the ordinary, making a tower defense game that doesn't use weapons, so I need to change the Damage and Armor types to account for this (need many different types). However, if I set the type manually in the UnitTower script, say set the ArmorType value to 1, when I open the Tower Editor, it resets it to 0. In the tower editor, I can't change it at all, like it's read only. Any ideas?

    Thanks,
    Chris
     
  28. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    @supernat, Thanks for the feedback. That is definitely a bug. I've just pm you a link where you can download the fix.

    As usua, I'll include this fix in the next update. If anyone else urgently need this fix, please let me know.
     
  29. John-Sandrey

    John-Sandrey

    Joined:
    Jul 2, 2012
    Posts:
    119
    When you get some time, when using NGui point and build with the show build option selected. The shadow of the pre build of the tower stays after the tower is built. I can disable it, but I like the looks of seeing what's going to be built.
     
  30. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    noted, I'll look into it and fix it as soon as I can.
     
  31. joduffy

    joduffy

    Joined:
    Jul 30, 2011
    Posts:
    34
    Hi,

    I got the TDK toolkit a while back. I just wanted to know if you could use the same BuildPlane in multiple different paths as part of their waypoints
     
  32. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Yes you can. ExampleScene2 does just that. :)
     
  33. joduffy

    joduffy

    Joined:
    Jul 30, 2011
    Posts:
    34
    Thank you :)

    And thanks for making TDK.

    I couldnt come up with a better framework myself, good job.
     
  34. joduffy

    joduffy

    Joined:
    Jul 30, 2011
    Posts:
    34
    Hi,

    I am getting errors around the Platform script.
    It says the name of the script does not match the class.

    Which is true. The script is called platform, but the class is called PathOnPlatform. If I change the name of the script to PathOnPlatform you then get errors saying it needs to be derived from Monodevelopement.

    In example scene 2 it says it cannot load the script.

    I am still diving into the code of TDK but dont want to break anything so I thought I would ask you.
     
  35. wheelbarrow

    wheelbarrow

    Joined:
    Sep 12, 2011
    Posts:
    177
    I have a tower that uses a beam (laser) shoot object. Unfortunately, the gun barrel still tilts upwards to allow for an arc as if firing a projectile, which looks really stupid seeing as how the beam shoots in a straight line to the target. The earlier versions of TDTK had the option to turn the arc off, is that option still in the latest version? The example scenes are no help, they have cubes for the towers.
     
  36. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    @Joduffy, I've changed the class Platform name to PlatformTD as of last update following a notification that it's conflicting with other package. Unfortunately the unity importer wont change the file name of the script if you are importing into an existing project. I'm afraid you have to do that manually. Simply change the name of Platform.cs to PlatformTD.cs. There's no need to change anything in the code. Sorry for the confusion.


    @Wheelbarrow, The tilt angle of the turret is based entirely on the shootObject, subject to the animation mode of the tower itself. it will only face the target if the animation mode is set to full. On top of that, only tower that use 'projectile' ShootObject will aim upward to create an arc. Even so, that's only applicable if you the shootObject has been given an angle. This is explained in the ShootObject section of the documentation. Even though I only use cube for the example towers, you will find that the beam tower aim straight at the target while the canon tower is tilted upward from the direction of the target. It sounds to me like either you are using the wrong ShootObject type, or the prefab is aim upward by default (the barrel is tilted even though x-axis rotation is 0).
     
  37. wheelbarrow

    wheelbarrow

    Joined:
    Sep 12, 2011
    Posts:
    177
    Yep, the original gun model had the barrel tilted. I rotated the barrel to be level after I made it a tower, but it obviously has to be done before turning the original object into a tower...did that and it works fine now, thanks.
     
  38. joduffy

    joduffy

    Joined:
    Jul 30, 2011
    Posts:
    34
    Hi Songtan,

    Everything seems to be moving along nicely now.
    I am looking into how you connect to NGUI. So I am reading you pdf file you made.

    One question.
    I added the minimap but the texture I am using appears darker in the minimap then the texture should be.
    Is there any reason for this?
    I tried looking how through the different settings but no luck so far.
     
  39. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Thanks for pointing this out. I have never notice it myself. To fix the problem. Please change line93 in MiniMap.cs to

    map.transform.localScale=new Vector3(0.1f*mapSize.x, 1, 0.1f*mapSize.y);

    It's just a minor correction changing the y-value of the vector from 0 to 1. I'm not entirely sure why it doesnt work with 0. Probably something to do with UV mapping. Sorry for the trouble.
     
  40. Tsurugi

    Tsurugi

    Joined:
    Sep 21, 2012
    Posts:
    97
    which line do i need to delete so that i can still build towers when i pause the game.....

    can you modify the code so that when i the pie chart hits the edge of the map i will re arrange.....
    $Capture.JPG
     
  41. joduffy

    joduffy

    Joined:
    Jul 30, 2011
    Posts:
    34
    Thanks Songtan,

    That fixed my problem.

    I was just wondering if there is a way to have the minimap work like NGUI components.
    So that the minimap adjust it size based on the screen resolution.

    You can do this in NGUI by unchecking the Automatic options in the UI Root.

    I was going to look into modifying your minimap script to have it work with an NGUI texture. I just wanted to know if you tried this at all?
     
    Last edited: Dec 31, 2012
  42. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    @Tsurugi, I assume you are using UI.cs. In which case simply modify line144 to following:
    Code (csharp):
    1.  
    2. if(Input.GetMouseButtonDown(0)  !IsCursorOnUI(Input.mousePosition)){
    As for the pie menu. I'm afarid it will take some time. I'll try.



    @joduffy, map that resize automatically according to the screen resolution is pretty straight-forward. But I'm not sure what you mean by 'have it work with an NGUI texture'.

    To have it scale with the screen resolution, simply change line70 of minimap to following:
    Code (csharp):
    1. Rect mapRectNormalized=new Rect(mapRect.x/Screen.width, (Screen.height-mapRect.y-mapRect.height)/Screen.height, widthScale, heightScale);
    The widthScale and heightScale being the size scale to the screen resolution which should take value between 0 to 1.
     
  43. joduffy

    joduffy

    Joined:
    Jul 30, 2011
    Posts:
    34
    Hi Sontang,

    With regards the minimap I will try and come up with a better explanation. What I am trying to do is use an NGUI texture to act as the minimap but have all the functions of yours. The reason why I want to do this is to have a visual on what size the minimap would be and were to place it. I also wanted to use an anchor with the minimap so that it would move with different screen resolutions and change dynamic to fit the screen i.e the layout would always be the same relative to the rest of the NGUI interface(so if the minimap was in the top right hand corner of the screen, thats were it will stay).

    I am almost finished my sandbox version of my game with TDK. But I ran into the following error when using my paths:

    ArgumentOutOfRangeException: Argument is out of range.
    Parameter name: index
    System.Collections.Generic.List`1[UnityEngine.Vector3].get_Item (Int32 index) (at /Applications/buildAgent/work/3df08680c6f85295/mcs/class/corlib/System.Collections.Generic/List.cs:633)
    PathTD.CreateLinePath () (at Assets/TDTK/Scripts/C#/PathTD.cs:130)
    PathTD.Start () (at Assets/TDTK/Scripts/C#/PathTD.cs:73)

    I did look around but the problem eludes me.
    You did mention before to change the Platform.cs to PlatformTD.cs as it was conflicting with someone else on the asset store.

    I did find someone else who had this problem in your forum:
    http://forum.unity3d.com/threads/132736-TowerDefense-ToolKit-v2.0/page5

    I also get another error having to do with the objectpoolmanager. So creeps are not spawning at run time.
    To save time, I have attached a screen shot of the errors at run time.

    https://www.dropbox.com/s/o6x2o7n8mfpty9e/tdk_path_error.png

    There is a complaint about a missing script which you had used for your TargetPriorityList. It was on the BaseSlicedSprite. But that should not be an issue as I only copied the UI over from your example scene 1 with NGUI so I could create my own UI with NGUI. I will be deleting this soon.

    Thanks for all your help Songtan.



    It seems I get this error if using the Creep healer:

    NullReferenceException: Object reference not set to an instance of an object
    UnitCreepAttack+<SupportRoutine>c__Iterator35.MoveNext () (at Assets/TDTK/Scripts/C#/UnitCreepAttack.cs:374)
    UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
    UnitCreepAttack:OnEnable() (at Assets/TDTK/Scripts/C#/UnitCreepAttack.cs:228)

    It goes away if I replace the creep healer with a standard creep in the spawn editor. Any ideas why?

    It also seems I get the other error when using platforms. There is no index error if i just use way points.
     
    Last edited: Jan 2, 2013
  44. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Sorry for the delayed respond. I was out pretty much all day yesterday.

    Either you are using an older version of UnitCreepAttack.cs, or you are having an object with a collider in the scene assigned with a layer which is the intended layer for creep. Please check your LayerManager setting and see if there's any unintended collider in the scene.

    It's very likely that it's not the fault of ObjectPoolManager. My bet is the creep are spawning alright, it's other problem (probably pathing) that stop the creep moving their initial spawn position, makes it look as if no additional creep is spawned.

    Very unusual place to have an error. You mentioned that you were trying to modified content in Platform.cs before changing the name to PlatformTD.cs. Have you revert all the modification you made?

    Also looking at the error log you sent me, there's a missing script error before the pathTD error. Can you make sure that is cleared out first. I'm not sure if that is cause the the missing script on NGUI or others. Also it would help if I can have a look at the scene and the way the path is setup. You can send any further info to my email, you can get my email in the documentation.


    I have never try something like this but I imagine it can be done. But it would be some what very different from current implementation of course. For instance, It would be better to set up the map base texture and appearance in the editor. Then the way to calculate the position of the blip will be different.
     
  45. NexrageStudios

    NexrageStudios

    Joined:
    Aug 17, 2012
    Posts:
    4
    Does anyone know how to make the projectile shoot out like a mortar would, by going straight up and then towards the creep? Right now mine no matter what doesnt angle and goes straight towards the creep.. Im using 2D instead of 3D, and also have a orthographic camera.

    Thanks for your help!
     
    Last edited: Jan 2, 2013
  46. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    You can make the projectile simulate a projectile arc by setting the MaxAngle of the projectile shootObject prefab. The highest you can go is 40 if I remember correctly. Mind you this is also affected by MaxRange. The angle will only reach the maximum value you specified if the target range is equal or higher than MaxRange.

    You should be able to see the arc regardless of orthographic or perspective camera. As long as your orthographic camera isnt viewing from top down.
     
  47. NexrageStudios

    NexrageStudios

    Joined:
    Aug 17, 2012
    Posts:
    4
    Can I have the max angle at 90 degrees? So it shoots straight upwards first and then goes to the creep?
     
  48. hanger102

    hanger102

    Joined:
    Jan 3, 2013
    Posts:
    13
    I am really interested in this but the only thing stopping me is not having a shop. Can you add a shop where you have to buy different type of towers. And you can only buy or upgrade towers between levels. Like this game http://www.stickgames.com/dawn-of-the-zombies.html So pretty much a castle defense game. That would be a pretty nice addon to this.
     
  49. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    I'm afraid that is not possible atm

    Nice idea, I'll see if I can explore the it when I have time on my hand.
     
  50. Tsurugi

    Tsurugi

    Joined:
    Sep 21, 2012
    Posts:
    97
    what do u have new in the new jan 8 edition update?

    can u inform me when u have the edge pie chart adjustment implemented and the ui for the players so they know what enemy comes next.....