Search Unity

TowerDefense ToolKit 4

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

  1. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,738
    Thanks John, I'll look into it and let you now asap.
     
  2. John-Sandrey

    John-Sandrey

    Joined:
    Jul 2, 2012
    Posts:
    119
    I looked around and found a little older version of NGui and exported it out and put it in, and it works so it has some thing to do with the latest release of NGui which I think was a couple days ago.
     
  3. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,738
    I've just downloaded the latest version of NGUI and install it on TDTK on Unity version 3.5.0f5.

    I haven't encounter any camera error. In fact, the only error that I've got it:

    Assets/NGUI/Scripts/Internal/UIDrawCall.cs(272,38): error CS1061: Type `UnityEngine.Mesh' does not contain a definition for `colors32' and no extension method `colors32' of type `UnityEngine.Mesh' could be found (are you missing a using directive or an assembly reference?)

    I manage to get around it by modified some of the core scripts. Could you let me know exactly what are the error you are having?
     
  4. John-Sandrey

    John-Sandrey

    Joined:
    Jul 2, 2012
    Posts:
    119
    transform.position assign attempt for 'Camera' is not valid. Input position is { NaN, NaN, NaN }.
    UnityEngine.Transform:Translate(Vector3)
    CameraControl:Update() (at Assets/TDTK/Scripts/C#/CameraControl.cs:92)
     
  5. John-Sandrey

    John-Sandrey

    Joined:
    Jul 2, 2012
    Posts:
    119
    It only happens in the pause menu of the NGui examples.
     
  6. John-Sandrey

    John-Sandrey

    Joined:
    Jul 2, 2012
    Posts:
    119
    I am also using the Paid version of the TDTK if that makes a difference.
     
  7. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,738
    Ah, I see. It's awkward really. It's a bug that is due to my own carelessness.

    You can fix it by changing line374 in UInGUI.cs to if(Time.timeScale>0) Time.timeScale=0.00000000000001f;. Basically just change the value 0 to 0.00000000000001f. If You encounter similar problem using other UI, simply make sure the timeScale is not set to zero for pause, only to the minimum value possible.

    It's kind of strange, it really has nothing to do with NGUI itself and it should have happen in other version as well.
     
    Last edited: Nov 19, 2012
  8. John-Sandrey

    John-Sandrey

    Joined:
    Jul 2, 2012
    Posts:
    119
    K i will give it a whirl in a few, don't know why the older version worked but nice work figuring it out.
     
  9. John-Sandrey

    John-Sandrey

    Joined:
    Jul 2, 2012
    Posts:
    119
    K the error is gone, but I still can not interact with the pause menu buttons. hover and the click are still inactive.
     
  10. Tsurugi

    Tsurugi

    Joined:
    Sep 21, 2012
    Posts:
    97
    I want the options for damage. The first is yours already done. The second is a linear dot damage=x(1+yr) where x is the base damage where changeable in tower editor. Where y is also changeable in tower editor and t is just the time. The third is an exponential dot damage=x+t^y where x I'd also modifiable in tower editor and y is also modifiable in tower editor and is just time. Can u add check boxes so that I can select one of the three in tower editor.

    What is your tick time

    Can you add a damage increase cutoff base on time for example after ten seconds the tower will only do that much damage.

    The effect doesn't stack
     
  11. John-Sandrey

    John-Sandrey

    Joined:
    Jul 2, 2012
    Posts:
    119
  12. John-Sandrey

    John-Sandrey

    Joined:
    Jul 2, 2012
    Posts:
    119
  13. John-Sandrey

    John-Sandrey

    Joined:
    Jul 2, 2012
    Posts:
    119
    Both are using the same TDTK but different versions of NGui.
     
  14. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,738
    @Tsurugi, I'll do what I can. I can't promise when it will be done as I've some traveling schedule coming up. Plus this is more like a feature add on rather than simple modification.

    @John, I found the problem. To fix it. Search for a gameObject named 'GeneralPanel' in the scene hierarchy under "UI Root (2D)/Camera/Anchor/Panel/GeneralPanel". Simple set the z position to 1, or anything larger than 0. The problem is the collider on that menu box that prevent the the cursor from clicking on the background object is being drawn on top of the button within the box. Hence preventing the buttons from being hovered or clicked as well. Changing the z position will switch the order and have the buttons drawn on top instead.

    Also, I missed some details over the pause function. You will need to change the following for the pause to work properly:

    line362 in UInGUI.cs to if(Time.timeScale>=0.0000000001f) Time.timeScale=1;
    line374 in UINGUI.cs to if(Time.timeScale>0.0000000001f) Time.timeScale=0.0000000001f;
     
  15. John-Sandrey

    John-Sandrey

    Joined:
    Jul 2, 2012
    Posts:
    119
    Thanks for taking the time to figure it out, I will give it a try in a few.
     
  16. John-Sandrey

    John-Sandrey

    Joined:
    Jul 2, 2012
    Posts:
    119
    Yep that was it, I wonder why the new version of NGui acts different then the last?
     
  17. John-Sandrey

    John-Sandrey

    Joined:
    Jul 2, 2012
    Posts:
    119
    You will need to mod line 362 to

    //resume timeScale
    if(Time.timeScale==0.0000000001f) Time.timeScale=1;

    to some thing like that or else it wont unpause.

    Oops didn't notice that you caught that up there
     
    Last edited: Nov 19, 2012
  18. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,738
    This has nothing to do withe the update I guess as far as I know it. The UIElement arrangement shouldn't have been that way right off the bat. Since they are just in the same position and depth, any of those elements could have been on top. It's a mistake I made and It's just by luck that the box didnt block the button in the free and older version, somehow. Maybe there's a strict rule behind the rendering of NGUI element, but then only the author of NGUI would be able to explain the criteria of a UI element being renderering on top another.
     
  19. John-Sandrey

    John-Sandrey

    Joined:
    Jul 2, 2012
    Posts:
    119
    If you get time no rush on this one, I get a warning which is the last of them then it should be perfect. It is on both NGui example.

    "UI Root (2D)/Camera/Anchor/Panel/TowerPanel/TargetingControlPriority/TargetPriorityList" has nothing for UIButtonColor to color
    UnityEngine.Debug:LogWarning(Object, Object)
    UIButtonColor:Init() (at Assets/NGUI/Scripts/Interaction/UIButtonColor.cs:98)
    UIButtonColor:Awake() (at Assets/NGUI/Scripts/Interaction/UIButtonColor.cs:50)
     
    Last edited: Nov 20, 2012
  20. EdibleDeflection

    EdibleDeflection

    Joined:
    Nov 21, 2012
    Posts:
    2
    I am impressed with the TDTK so far and it certainly is a time saver. Though I am curious if anyone has a recommendation for a save system that would allow for saving at anytime during a level. If so, are there any special considerations to allow the TDTK and the save system to function together?

    Perhaps I am looking at this incorrectly and a pre-made save system is not the best approach. Any suggestions on how to implement a save system for the TDTK would be great?
     
  21. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,738
    @John, I'll look into when I can.


    @EdibleDeflection, unfortunately there's no save system implemented for TDTK as far as I know. At least not the one where you save the progress when in playing a level. This is a tricky one indeed. To do that one would need to serialize all the gameObject and their respective state, including the coroutine and what not. Most of the pre-made save system (the way I understand them) provide a simplified way to do that so that's where I would start from if I'm to tackle the problem. After all even if you start from scratch, that would be exactly what you need to do.

    You could simplified the problem by only saving between waves. That way you only effectively ignore the creep and any shootObject/effect in the scene. But to do that you would be restircted to a less free-flowing game, one that is based on round based or wave cleared without skipped.



    Also a quick anouncement, I will be traveling on the coming few days so I apologize in advance for any delay in responding to any question. Thanks for understanding.
     
  22. spyketherobot

    spyketherobot

    Joined:
    Sep 25, 2012
    Posts:
    15
    any update for unity4 ?
    regards
    spk
     
  23. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,738
    I'm working on it. But I have to say it wont be happening so soon since currently I'm traveling and have to work mobile. You can imagine how chaotic is that. On top of that, inconsistent internet connection has been a pain to actually do the update itself. But i promise that it will come. Sorry for the inconveniences and thanks for understanding.
     
  24. spyketherobot

    spyketherobot

    Joined:
    Sep 25, 2012
    Posts:
    15
    Thanks man ;)
    great work
    spk
     
  25. Tsurugi

    Tsurugi

    Joined:
    Sep 21, 2012
    Posts:
    97
    hey songtan just wondering did u start on the add on features?
    about how long will u be done?

    thx for the effort.....
     
  26. RobertoGD

    RobertoGD

    Joined:
    Nov 25, 2012
    Posts:
    20
    Nice starter kit.
    I check the free version and will soon buy the full version.
    Are you planning any special update available soon in addition to support for Unity 4? Maybe the new functionality?
     
    Last edited: Nov 25, 2012
  27. John-Sandrey

    John-Sandrey

    Joined:
    Jul 2, 2012
    Posts:
    119
    Just a quick question, I see in the NGui examples you are using all 3 of your UI's. From what I understand which I could be wrong, I should only need the NGui ui set up?
     
  28. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,738
    Sorry for the delay...

    @Tsurugi, I cant say. I'll be traveling and attending various personal event for the coming 2-3 weeks. Suffice to say my working schedule has messed up entirely. I'm working on it on whatever free time I have. I can only promise you that I'll inform you when it's done. Really sorry, bad timing.

    @Robert, Thanks in advance. I hope you will find that this is more than a starter kit. :)
    I have no plan for any major addition at this point, apart from some bug fix and Unity4 update. If you do have any cool idea, please do let me know. If it's feasible for general context of the framework, I'll be more than happy to try it.

    @John, You only need the NGUI ui set up. If you look carefully, the other 2 UI are disabled in the NGUI examples. They are just there for testing, in case you want to switch between any ui.
     
  29. John-Sandrey

    John-Sandrey

    Joined:
    Jul 2, 2012
    Posts:
    119
    Yea I see that they are disabled, but when I remove the ui script Spawn is not working. Wasn't sure if Ngui was linked to it in some way. I can remove the ios one and it still works, as long as the ui script is there.
     
    Last edited: Nov 26, 2012
  30. John-Sandrey

    John-Sandrey

    Joined:
    Jul 2, 2012
    Posts:
    119
    Oh I fixed the button issue wit the new version of NGui, you need to turn off the ray cast clipping in the NGui camera and every thing works fine. Unless you have to have it clipped.
     
  31. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,738
    @John, I've just done a little test. It's an unintended bug. I'll fix it in the next update. At the mean time, I would suggest you to keep UI.cs in the scene or remove both UI.cs and UIiOS.cs for the time being. They wont affect the anything as long as they are disabled.
     
  32. John-Sandrey

    John-Sandrey

    Joined:
    Jul 2, 2012
    Posts:
    119
    Np iI have time, still playing with NGui trying to figure out how every thing works.
     
  33. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,281
    Get many yellow errors on the console in unity 4 when importing the latest version of TDTK from the asset store.
    Hoping for an update without the errors not so far away when your back from your traveling.
     
  34. pdp

    pdp

    Joined:
    Nov 28, 2012
    Posts:
    3
    Hello. Is it compatible with Unity 4?
     
  35. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,738
    @RandAIThor, noted. I'm in the process of porting it to Unity4. The warning message shouldn't be a problem. Please just ignore it for the time being.

    @pdp, It should be compatible with with Unity4 for the most part if you dont mind the various warning in the log. I'm in the process of porting it to Unity4.
     
  36. Tsurugi

    Tsurugi

    Joined:
    Sep 21, 2012
    Posts:
    97
    hey songtan i hope the add feature is not a big burden to u.....

    when i try to make a L shape buildable platform out of two platform and tried to line them up evenly to make a L shape there will always be a gap between the two platforms whenever i press the play button in unity to go in game mode..... why? can be fix?
     
  37. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,738
    The addition of linear and exponential incremental dot is not a big issue. I've in fact done it. I'm currently just play testing and finish up the documentation before I submit the update to AssetStore. You are welcome. :)

    As for the issue on hand. The BuildManager will auto adjust the size(scale) of the platform to fit the gird size you set. Say you are using grid size of 1 and your platform size is 3.2x4.8, it will be shrink to 3x4 so the grid fits perfectly. So you can either disable this auto-size-adjustment, or you can set the size to fit manually before placing your platform.
     
  38. Tsurugi

    Tsurugi

    Joined:
    Sep 21, 2012
    Posts:
    97
    is it possible for the next update can u add where u can change the menu type to a pie chart for the ngui UI.....

    by the way when is the next update coming out?
     
  39. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,738
    Fyi, I just submitted the update a few hours ago. It shouldnt be more than a few days before the new version goes live on AssetStore. So I'm afraid the pie menu for NGUI will have to wait.
     
  40. Tsurugi

    Tsurugi

    Joined:
    Sep 21, 2012
    Posts:
    97
    hey songtan i have some maps on tdtk v 2.0.4 and when i imported to tdtk v 2.1.3 and the script the on object cant be located even though all the scriptd are in the script folder and the console said that the ngui is affecting the problem so how do you fix it?

    about the camera... when i set a position for the camera in the scene and when i press play the camera will always jump down...... now that im making all my map 17 long and 12 height..... is there a way to set the camera so that when its zoom all the way out i will only show the edges of my map and only can zoom in....
     
    Last edited: Dec 2, 2012
  41. John-Sandrey

    John-Sandrey

    Joined:
    Jul 2, 2012
    Posts:
    119
    I hope this was an error some where, but I do not have unity 4.0. How do i get the TDTK to work with 3.5? In order for me to up grade my license to 4.0 it will cost me over $2000. I hope I did not wast $80 on this tool kit.
     
    Last edited: Dec 2, 2012
  42. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,738
    Sorry again for the delay...

    @Tsurugi, how do you import map from 2.0.4 to 2.1.3? What are the errors shown on the log? I would suggest you to import 2.1.3 on the 2.0.4 rather than the other way round. Regarding the camera, there's a known bug with older version that the camera height-position would stay constant at 0 when played. If you are using the latest version and still having the same issue, it could be your initial camera position has exceeds the zoom limit specified. Can you please set your zoom limit to Infinity or something like 9999999 to make sure it's not due to the zoom limit.

    @John, No worries, I do keep copies of earlier version which is compatible with unity3.5. and I'll keep supporting that for as long as I can. Unfortunately I dont have access to Unity3.5 right now to do the bug fix which I've done in the latest version. If you could wait 2 weeks, I'll be back to my normal work place. Then I'll fix you up with the latest TDTK which works with Unity3.5.
     
  43. John-Sandrey

    John-Sandrey

    Joined:
    Jul 2, 2012
    Posts:
    119
    Thanks, I can wait, but why don't you make it a 3.5 version, and the people that have 4.0 can just up grade? It will go from 3.5 to 4.0, but not the reverse. I am sure there are other 3.5 pro users out there that cant afford 4.0 pro yet. It wouldn't be that bad but unity let me upgrade the TDTK to 4.0, even though I have 3.5 and it should of stopped me. Now it crashes because the TDTK is updated to 4.0 on my system and I can not down grade it.
     
    Last edited: Dec 4, 2012
  44. Tsurugi

    Tsurugi

    Joined:
    Sep 21, 2012
    Posts:
    97
    thank u so much on the add on features.... its so cool....

    i just download the new update and imported the new update to my tdtk v2.1.3 and i cant play any of the maps...
    its keep saying "All compiler have to be fixed before you enter playmode"......
    $Capture.JPG
     
  45. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,738
    @John, That's a very good suggestion. Silly me for not realize it. I'll do just that when I'm back to my usual work place in about 10days time. Thanks very much for suggesting that.

    @Tsurugi, I think there's a slight error with the update. I'll check to make sure. At the mean time you could use the one from the download link I've just sent you via pm.
     
  46. Tsurugi

    Tsurugi

    Joined:
    Sep 21, 2012
    Posts:
    97
    everything is so great.....

    when i only have three towers allowed to be build the pie chart will stack one of the towers so when display there will only be two....
    plz help...
     
  47. siliwangi

    siliwangi

    Joined:
    Sep 25, 2009
    Posts:
    301
    Looks like your tower defense toolkit is conflicting with multiplatform toolkit, here is the error :
    Code (csharp):
    1.  
    2. Assets/TDTK/Scripts/C#/Platform.cs(63,14): error CS0101: The namespace `global::' already contains a definition for `Platform'
    3.  
     
  48. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,738
    @Tsurugi, I'll look it up. But since your script has been modified from the original, can you send me a copy so I can work from there. Just send UI.cs to my email.


    @HGarry, Not a big issue, it's just a name conflict. I'll fix that as soon as I can in the next update. Thanks for letting me know.
     
  49. John-Sandrey

    John-Sandrey

    Joined:
    Jul 2, 2012
    Posts:
    119
    I was talking to a couple of people, and the way they are working the 3.5 and 4.0 compatability is that they make it for 3.5 and put a zip file in the package for 4.0 users, which will fix any errors that are left after converting it over to 4.0.
     
    Last edited: Dec 9, 2012
  50. uskak41kw

    uskak41kw

    Joined:
    Dec 5, 2012
    Posts:
    4
    Please, give us a tutorial for full animated turret, or give us a working, animated prefab. That is most important part of any TD i guess. For example - building animation not working for me, so im doing something wrong. Thanks :)
     
unityunity