Search Unity

TowerDefense ToolKit 4

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

  1. seidgaparov

    seidgaparov

    Joined:
    Jul 18, 2013
    Posts:
    12
    It should vary=(
    for example:
    1lvl
    unit - A
    CD 1.5

    2lvl
    unit - B
    CD 2

    3lvl
    unit - C
    CD 3
     
  2. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,452
    In that case, you need to add the new variable in TowerStat. You will find that in the bottom of the UnitTower.cs, along with other stats like damage, cooldown, etc. You can't missed it.

    Then in TowerEditor.cs, the code goes like this:
    Code (csharp):
    1. EditorGUI.LabelField(new Rect(startX, startY+spaceY, 200, height), "SpawnUnit: ");
    2. tower.upgradeStat[i].SpawnUnit=(GameObject)EditorGUI.ObjectField(new Rect(startX+lW-30, startY+=spaceY, 100, height-2), tower.upgradeStat[i].SpawnUnit, typeof(GameObject), false);
    3.  
    4. EditorGUI.LabelField(new Rect(startX, startY+spaceY, 200, height), "Spawn CD: ");
    5. tower.upgradeStat[i].SpawnCooldown=EditorGUI.FloatField(new Rect(startX+lW-30, startY+=spaceY, 100, height-2), tower.upgradeStat[i].SpawnCooldown);
    Then in InitStat() and UpgradeStat(), you will have to assign those value in TowerStat to the local value. Just take a look at the two function and you will understand what you need to do.

    Hopefully that's all.
     
  3. Light113

    Light113

    Joined:
    Jan 14, 2013
    Posts:
    7
    I am having a problem with TDTK, I want to control tower by players.
    for example, players unlock 10 towers, but I want you to play up to 6 towers of his battles. This problem similar to abilities and perk.
    More specifically, I designed a tower containing the entire interface, and allows players to choose a lower number for battle.
    I look forward to your response soon, this is very important for me.
    Thanks.
    Email:dr.light113@gmail.com
     
  4. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,452
    Sent you an email respond. :)
     
  5. jeff-smith

    jeff-smith

    Joined:
    Feb 24, 2012
    Posts:
    19
    We just bought TDTK--nice toolkit. I'm using the Unity 4.6 beta with uGUI and I was wondering if you have any plans to support uGUI in the future. Thanks!
     
  6. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,452
    Definitely, I plan to do that as soon as uGUI is out.
     
  7. jeff-smith

    jeff-smith

    Joined:
    Feb 24, 2012
    Posts:
    19
    Within a single scene, is there a way to make certain towers available for BuildPlatform 1, for example, and other towers available for BuildPlatform 2?
     
  8. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,452
    Absolutely. When you select the BuildPlatform, you should be able to check which tower is to be enabled/disabled for the platform. That is assume that platform already have a PlatformTD component attached to it. But if you haven't got a PlatformTD component attached, just drag the script and add it manually.
     
  9. RedTofu

    RedTofu

    Joined:
    May 9, 2014
    Posts:
    25
    Hi Song, I am wondering if there's a method to convert and use mecanim humanoid animation to legacy animation, as I got a package with wonderful characters, but I can't use them because they are humanoid. Is there a way around this? Many thanks!
     
  10. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,452
    Honestly I'm not sure. To tell the truth I'm not familiar at all with mecanim. I'm not even sure how to get them to play in the editor. I'm sure there's a way to get them to work. Just that since I dont know anything about it, I cant really comment on it.

    Very sorry not being able to help here.
     
  11. jeff-smith

    jeff-smith

    Joined:
    Feb 24, 2012
    Posts:
    19
    Thanks, Song.
     
  12. RedTofu

    RedTofu

    Joined:
    May 9, 2014
    Posts:
    25
    Song, Thanks for your reply. I will take a look if there's alternative way to use mecanim animation. If anyone else knows, please give me a guide as well. Really appreciate that...as I got a few mecanim animation which will work really well for my Tower Defence game.

    I have come across another problem with the perk system. Say that I want to unlock Poison Cloud I in my current level. I have enabled that in the AbilityManager as well as in PerkManager. Somehow when I start the game, the Poison Cloud is already activated and can be used without unlocking it. Is there something I'm missing?
    I assume I just enable it in the AbilityManager and PerkManager without checking the "Unlocked" box. I'm quite new in Unity here so please advise. Thank you so much.
     
  13. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,452
    You dont need to enable the ability you want to use in the AbilityManager. Enabled ability are readily available to use from the get go. You just need to enable the perk that unlock the ability in PerkManager. A note tho, just enable it, not unlock it (dont check the unlock flag) otherwise the perk will be unlocked from the get go and the ability will again be reaily available.
     
  14. RedTofu

    RedTofu

    Joined:
    May 9, 2014
    Posts:
    25
    Thank you Song for your reply. I have tried as you mentioned. When I try to the run the game, I'm unable to access the Perk Menu inside the game (menu simply does not pop-up) I have copied the UI_NGUI game object from your example scene to my scene. Everything seems to work fine other than the Perk Menu. It maybe because of that. Any reason why or missing? Thanks
     
  15. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,452
    Make sure you have a PerkManger in the scene otherwise you wont be able to acces perk menu. The game simply assume that perk system is not required in the scene.

    You can refer to example scene "ExLinearEndlessNGUI", specifically the setting on PerkManager and AbilityManager in the scene. It does exactly what you want. Disable PoisionCloud from the start and it can only be unlocked via perk.
     
  16. RedTofu

    RedTofu

    Joined:
    May 9, 2014
    Posts:
    25
    Thank you for your reply. I realised it's the UI_NGUI problem as I used the default UI gameobject it works perfectly fine. What I did was I copied the UI_NGUI from your example scene "ExLinearEndlessNGUI" to my scene. I have PerkManager in the scene as you mentioned already. Is there something I got to change? Thanks.



    Actually I got an error saying the following (see below). I'm not sure what triggered this. Sorry I might be asking a simple question, but I'm really new to this.

     
    Last edited: Jul 25, 2014
  17. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,452
    Is the default ExLinearEndlessNGUI scene working? Is that the only error you get? Have you made any change at all? To the Abilities, Perks and Resources? I suspect you might have messed up something as you shouldn't be getting that error.
     
  18. RedTofu

    RedTofu

    Joined:
    May 9, 2014
    Posts:
    25
    I run ExLinearEndlessNGUI scene and the perk menu is not giving response as well. I have not done any changes to the abilities, perks and resources (at least to the sample scene). I'm not sure what I have messed up here.

    Like I said before if I run my scene without NGUI, it works fine. It should be the NGUI giving me an error here.



    One thing I edited in the codes was this under PerkEditorWindow.cs. This was because I got an error saying the path was wrong, so I just correct the path and I didn't get the error again.

    Code (CSharp):
    1. xmlDoc.Save(Application.dataPath  + "/TDTK/TDTK (Base)/Resources/PrefabList/Perk.txt")
     
    Last edited: Jul 25, 2014
  19. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,452
    I just test it myself. The example scene should work just fine right out of the box. The fact that yours is not working means something is not right. if you havent dont any serious editing, I would suggest you to re-import the whole package. make sure the default example scene is working and start from there.
     
  20. RedTofu

    RedTofu

    Joined:
    May 9, 2014
    Posts:
    25
    Thanks for the reply. I want to know if it is the correct method to copy and paste the UI_NGUI Game Object from your sample scene to my scene? Or is there suppose another way to this? Thank you.
     
  21. RedTofu

    RedTofu

    Joined:
    May 9, 2014
    Posts:
    25
    Song, I have done what you said. I have actually created a new project. Import TDTK package, TDTK(NGUI FULL) package and NGUI package.

    I ran the ExLinearEndlessNGUI scene without changing anything and I got an error message (see below). Then I'm stuck in the Perk Menu and cannot close it.

     
  22. eajones

    eajones

    Joined:
    Aug 1, 2013
    Posts:
    45
    Song,

    Likely a very quick question--playing with a mazing platform, and find that my creep go through it without mazing.
    Does this with towers in TDTK kit as well as ones I made. What am I not doing correctly with the creep that allows them to do that?
     
  23. Hothtrooper44

    Hothtrooper44

    Joined:
    Jul 27, 2014
    Posts:
    1
    @eajones Either you have your unit set to flying, or your tower's collision box is too small probably.

    @songtan I see that under the attack script for minions there is a "Attack Strategic Point" option. What does this do, and how do we use it? Also, is there a way to prevent creeps from attacking immune towers? I would like to make certain towers available to be attacked and others ignored.
    Secondly, I was wondering if I could make "RunNGun" attack style units stop to play their animations? Or make "StopNAttack" units move down the path during cooldowns rather than stand still and wait for the next swing. Can something like these be done to allow a natural look to stand still attacking animations on units that should keep moving after attacking?
     
  24. cruzan2

    cruzan2

    Joined:
    Jul 16, 2014
    Posts:
    4
    I have some issues on mobile, dragndrop does not work neither does tooltips on both pointnbuild or dragndrop, i am using the latest ngui 3.6.9 and have deleted both ngui and tdtk and reimported and same issue.
     
  25. Rod-Galvao

    Rod-Galvao

    Joined:
    Dec 12, 2008
    Posts:
    198
    There are two classes in TDTK that keeps conflicting every time the project is updated:

    Utility
    CameraControl

    Do you mind changing the name of them? They are too common.

    Regards,
    R.
     
  26. t0xic0m

    t0xic0m

    Joined:
    Jun 28, 2014
    Posts:
    12
    Hello,
    how can i change to Touch Input for Android Devices?

    Greetz
     
  27. crunchyoverseas

    crunchyoverseas

    Joined:
    Nov 27, 2013
    Posts:
    29
    Hi song,

    Does TDTK require pro?
     
  28. RedTofu

    RedTofu

    Joined:
    May 9, 2014
    Posts:
    25
    Hi Song, I'm wondering if there's a way for my creeps to walk around the towers. Since the creeps are spawned in slightly different positions, sometimes they will just walk through the towers. I have set a box collider to both the towers and creeps, what else do I have to do so that the creeps won't walk through the towers?

    Thanks!
     
  29. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,452
    Dear oh dear. I'm so so sorry for going missing for such a long time. For some reason I'm not getting any notification at all since my last post. If any of the questions you ask is still unresolved, please let me know or send me an email.

    But I do have a good news. I'm pleased to announce that TDTK3 is now on its way. I've been working hard at rebuilding the whole toolkit from scratch. The new version requires Unity4.6 and runs the new uGUI. Here's a screen shot of the new UI.


    For more info, please visit my development blog. Sorry again those whose post I've missed.
     
  30. kuolema

    kuolema

    Joined:
    Sep 22, 2014
    Posts:
    5
    Hey Song - I have been trying to figure out why the tower damage range wasn't working (it always hit using the upper end of the damage range). I'm pretty positive I haven't modified any of the scripts, and I'm using the latest version (2.2.5f4). I found a simple typo in UnitTower.cs, line 1599, 1600:

    Code (CSharp):
    1. float dmgMin=damageMax*(attBuffMod+PerkManager.allTowerAttackBuffModifier)+bonus;
    2. float dmgMax=damageMax*(attBuffMod+PerkManager.allTowerAttackBuffModifier)+bonus;
    dmgMin should use damageMin*(...), so changing that fixed everything. You may want to double check yours to see if this typo exists as I'm pretty sure I didn't change anything, but I couldn't be sure. The other instances of setting dmgMin looked good though!
     
  31. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,452
    Noted, thanks for letting me know. I'll check to be sure. :)
     
  32. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,452
  33. TensonHanzo

    TensonHanzo

    Joined:
    Sep 16, 2012
    Posts:
    13
    Thats exciting news about TDTK3! I've been away for awhile so I'm a bit behind on the news and updates surrounding TDTK. Will the new version (or does the current version) support tower idle animation? For example, if I have a humanoid like tower, does this framework support it's idle animations, such as breathing or dancing around? I'd like to give my towers some lifelike behaviors so they don't stand motionless until a creep comes by. I tried accomplishing this a few versions ago (the last time I was able to utilize Unity and TDTK) and was unsuccessful. This could be a case of user error... Yup still learning.
    Thanks.
     
  34. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,452
    Fyi, I have switch the animation system used to mecanim in TDTK3. Shouldn't stop you from playing the legacy animation clip tho. I haven't actually try out the new system for idle animation, but I imagine it's not too difficult to do that. Maybe it's just me, but using mecanim seems to have make things a lot more easier than the legacy system.

    At any rate, I'll try to make sure that is supported upon the actual release.
     
  35. eajones

    eajones

    Joined:
    Aug 1, 2013
    Posts:
    45
    TDTK3 looks awesome!

    Hopefully a simple question--what is the minimum model needed for a turret? Can you have it have only the turret portion of the turret (with shoot point, shoot object, barrel object, turret script, etc), or do you have to also have a base, etc. as part of that? After getting some weird turret action (likely a vertex point problem, although I couldn't fix it), I tried making only a floating turret but failed. Can one make only a floating turret (no base, etc)?
     
  36. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,452
    There is no minimum model for a turret. In the simplest setting, a turret tower can work an empty gameObject with UnitTower component attached on it. Both the baseObject and turretObject are pretty much optional. You can experiment with the default tower, take away ether of the base or turret object and it should wok just fine. However to get the turret aim at the target correctly you might have to follow certain template. My guess is that is what cause you trouble.

    If you have never watch the video about how the hierarchy setting within a turret-tower works, I would suggest you take a look at that. It should give you an fairly good idea of how things work. If you are really struggling, you can send me the model in question. I can help you set one prefab up which you can refer to as an example.
     
  37. Devision4

    Devision4

    Joined:
    Jan 12, 2013
    Posts:
    1,338
    agh please release beta version. u4.6 won't be released soon.
     
  38. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,452
    I'm happy to send you an advance copy if you already have the current version. Please send me an email.

    Mind you there's still no documentation for TDTK3 yet.
     
  39. Devision4

    Devision4

    Joined:
    Jan 12, 2013
    Posts:
    1,338
    awesome, I will purchase it today and send you email
     
  40. vpinto

    vpinto

    Joined:
    Apr 6, 2013
    Posts:
    11
    hi, just wondering if you can provide any details on the A* path-finding component? I can't seem to find any details about integration with A* pathfinding anywhere anywhere
     
  41. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,452
    There's a script named PathFinder.cs. That's where all the A* pathfinding code goes. Mind you it's heavily depending on the node graph generated on each of the platform. You can find the defination of the Node class and graph generation algorithm in another script named NodeGenerator.cs. Hope this help.
     
  42. kuolema

    kuolema

    Joined:
    Sep 22, 2014
    Posts:
    5
    Hey Song, I happened to find a couple more errors related to damage over time. It seems the Clone method for the Dot class (in UnitTower.cs) is missing
    Code (CSharp):
    1. clone.stackable=stackable;
    in the definition to copy over the stackable flag. Otherwise dots are never stackable!

    Also related, it looks like a copy/paste typo in the DotRoutineStack method (irrelevant code removed):
    Code (CSharp):
    1. while(tick<=tickMax){
    2.     ApplyDamage(dot.SampleDamage(dotTick), dmgType);
    3. }
    the variable dotTick is not used in this loop (it's only used for non-stackable DOTs) and should simply be tick

    EDIT:
    Also, I think this was also an error but it could have been caused by me editing some of the modifiers. Again, just a copy/paste error in the Clone method:
    Code (CSharp):
    1. clone.modifier1=modifier1;
    2. clone.modifier1=modifier2;
    the 2nd line shouldn't reset clone.modifier1, it should set clone.modifier2
     
    Last edited: Nov 23, 2014
  43. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,452
    You are absolutely right. There are quite a few errors there. My bad. I'll make the correction and upload the fix shortly. Thanks a bunch for letting me know.
     
  44. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,452
    TDTK v2.2.6 now on AssetStore - with v3.0b included

    Hi all, I've just uploaded another update to AssetStore. This will be the last update of TDTK2. The next update will be TDTK3, which is based on Unity4.6 and not backward compatible.

    Apart from some minor bug fixes, it might please you to know that TDTKv3.0b is now included
    with current update. As it's not a complete release, it's still lacking documentation. But if you are familiar with TDTK, I'm sure you will be at home right away. But do take note that it's meant for Unity4.6 and it's not backward compatible, so please dont try to import the package to existing TDTK project.

    Enjoy! :)
     
    Last edited: Nov 27, 2014
    Cogent likes this.
  45. spyketherobot

    spyketherobot

    Joined:
    Sep 25, 2012
    Posts:
    15
    yo
     
    Last edited: Nov 27, 2014
  46. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,452
    Woot, it's official! TDTK v3.0 is finally here!

     
    Cogent likes this.
  47. Cogent

    Cogent

    Joined:
    May 14, 2013
    Posts:
    356
    Awesome asset and I have to say Songtan supports his assets!

    Seriously, the best item I've purchased on the asset store.

    Thanks for the hard work!

    :cool:
     
  48. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,452
    No, I should be thanking you for your support! :)
     
    Cogent likes this.
  49. TensonHanzo

    TensonHanzo

    Joined:
    Sep 16, 2012
    Posts:
    13
    SWEET! Can't wait to try 3.0
    Thanks for the continuos updates.
     
    Cogent likes this.
  50. nubii

    nubii

    Joined:
    Dec 4, 2014
    Posts:
    2
    Hello i got a problem, with the towers i have scaled them up using Scale factor, but the trigger point which is used to click on the object is not scaled, so there is only a small place which triggers the tower. Where can i edit that?
     
unityunity