A Unity ID allows you to buy and/or subscribe to Unity products and services, shop in the Asset Store and participate
in the Unity community.
Discussion in 'Assets and Asset Store' started by songtan, Apr 18, 2012.
It should vary=(
unit - A
unit - B
unit - C
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:
EditorGUI.LabelField(new Rect(startX, startY+spaceY, 200, height), "SpawnUnit: ");
tower.upgradeStat[i].SpawnUnit=(GameObject)EditorGUI.ObjectField(new Rect(startX+lW-30, startY+=spaceY, 100, height-2), tower.upgradeStat[i].SpawnUnit, typeof(GameObject), false);
EditorGUI.LabelField(new Rect(startX, startY+spaceY, 200, height), "Spawn CD: ");
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.
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.
Sent you an email respond.
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!
Definitely, I plan to do that as soon as uGUI is out.
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?
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.
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!
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.
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.
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.
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
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.
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.
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.
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.
xmlDoc.Save(Application.dataPath + "/TDTK/TDTK (Base)/Resources/PrefabList/Perk.txt")
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.
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.
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.
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?
@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?
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.
There are two classes in TDTK that keeps conflicting every time the project is updated:
Do you mind changing the name of them? They are too common.
how can i change to Touch Input for Android Devices?
Does TDTK require pro?
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?
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.
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:
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!
Noted, thanks for letting me know. I'll check to be sure.
I've put up a webplayer demo for TDTK3 beta. Feel free to check it out. Any feedback or comments are appreciated.
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.
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.
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)?
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.
agh please release beta version. u4.6 won't be released soon.
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.
awesome, I will purchase it today and send you email
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
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.
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
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):
the variable dotTick is not used in this loop (it's only used for non-stackable DOTs) and should simply be tick
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:
the 2nd line shouldn't reset clone.modifier1, it should set clone.modifier2
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.
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.
Woot, it's official! TDTK v3.0 is finally here!
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!
No, I should be thanking you for your support!
SWEET! Can't wait to try 3.0
Thanks for the continuos updates.
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?