Search Unity

3D Tower Defense Starter Kit

Discussion in 'Assets and Asset Store' started by Baroni, Mar 30, 2012.

  1. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    Ooh.. yeah I see.

    HOTween could use partial paths, which iterates over waypoints so you could count them. However my implementation, TweenMove.cs, does not use partial paths. Before rewriting the movement script, I suggest you try to set the tween.timeScale of the main object, upon death, equal to the speed of the new enemies (for matching path duration) and then use fullElapsed.
     
  2. Zozo2099

    Zozo2099

    Joined:
    Jul 15, 2012
    Posts:
    478
    Does it work with Unity 4? thanks
     
  3. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    Hi Zozo,

    yes the kit works with Unity4. You should hurry though, I already submitted a package description update with the regular price, as our december sale ended today.
     
  4. bb2012

    bb2012

    Joined:
    Jan 2, 2013
    Posts:
    5
    I'm a Asia Graphic design department student.I'm not sure how much cost.US / UK dollars?
    I have a Project IDEA.
    I want to build a TD game (mobile) apps.
    I have watch your Kit but This is not my Strengths.

    Examples
    Melo's Magic: Castle Defense
    http://www.youtube.com/watch?v=jX6Yg-AaOYo

    Features
    I will provide the images and 3D MODEL.
    Divided into two large forces - android IOS PHONE system connection and fight.

    The two forces are only two Leavel.
    Last hurdle before the completion of the first hurdle is locked
    Both sides sent soldiers,
    More soldiers arrived enemy positions,
    The other will lose.

    The skill tree.
    You can choose the difficulty.
    Can modify the volume settings.

    Please don't only PM.
    I hope you can use Gmail / skype / facebook contact me.
    adalee2018@gmail.com
     
  5. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    @bb2012
    email sent.
     
  6. Hoskins355

    Hoskins355

    Joined:
    Jan 3, 2013
    Posts:
    142
    I have created a Level_Desktop2.unity scene but how do I link to it from the Level_Desktop scene?
     
  7. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    Hi Hoskins,

    the GameHandler component has a field named "Next Scene". Enter the name of your next scene there, it will open it once the current level is completed.
     
  8. Hoskins355

    Hoskins355

    Joined:
    Jan 3, 2013
    Posts:
    142
    thanks. I was also wondering how you make a new TerrainDesktop.asset file?
     
  9. bullardo

    bullardo

    Joined:
    Jan 5, 2013
    Posts:
    46
    I just purchased and I have a small issue when I try and load the Level_desktop scene.

    Mesh.vertices is too large. A mesh may not have more than 65000 vertices proceeded by errors in MeshCombineUtility script. I am using Unity 3.5.6. Can you let me know if there is something I am missing?

    Thanks
     
  10. bullardo

    bullardo

    Joined:
    Jan 5, 2013
    Posts:
    46
    It doesn't seem to be an issue but im wondering if I need to break any of the objects up
     
  11. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
  12. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    Hi bullardo,

    thank you for your purchase.

    I can't see those errors popping up in my project, but a few people already reported this weird behavior. So I'll remove the MeshCombine script and submit a new package over the next days. In the meantime, you can ignore the errors or delete the file too.
     
  13. Hoskins355

    Hoskins355

    Joined:
    Jan 3, 2013
    Posts:
    142
    When I drag and drop my new terrain into the scene it shows below my current terrain. I can delete the original terrain but how do i merge everything onto the new terrain so that it is not floating in the air?
     
  14. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    Erm.. the terrain is a normal gameobject in your scene, you can locate it and use Unity's built-in handles to move it around. Regarding "merge everything onto the new terrain", make sure you only delete the original terrain from the scene, not its children objects (unparent them).
     
  15. Hoskins355

    Hoskins355

    Joined:
    Jan 3, 2013
    Posts:
    142
    I did a save as on the Level_Desktop scene and savded it Level 1 Level 2 ect, Then I did the same for the TerrainDesktop named them level 1 Level 2 Ect. I also changed the Terrain Data field under Terrain Collider for each level so level 1 uses level 1 terrain, Then I saved everything, but My problem is when I edit one terrain all levels are updated. Any ideas?
     
  16. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
  17. Hoskins355

    Hoskins355

    Joined:
    Jan 3, 2013
    Posts:
    142
    Two questions 1st Have made a map scene so that after level one it goes to the map then it takes you to level 2. My question is there a way to make the map scene start automatically. So that you don't have to hit the start button.

    2nd I wanted to make the towers look different when upgraded. I can edit the towers but how do i edit the script use a different image every time it is upgraded.
     
  18. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    Check "Auto Start" in the Wave Manager component.

    I'll work on that one in the near future too (no ETA yet). They way it should work is to add a new gameobject array to the Upgrade script. On each upgrade, you use the current level of the tower to instantiate a new tower at the same position and remove the old one. Or, only remove the children of the old tower and replace them with the new ones. I'm not sure how to optimally approach it yet.
     
  19. Hoskins355

    Hoskins355

    Joined:
    Jan 3, 2013
    Posts:
    142
    Now when I play the towers only shoot for first wave then stop shooting the enemies and I can not click on them to upgrade or enter first person mode I have checked it seems to be happening in all scenes any suggestions?
     
  20. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    I guess you're not using NGUI's free version, but one of the (paid) newer versions? Currently there's a problem in relation to NGUI which resets all layers to 'Default', so collisions etc. doesn't work anymore. Must have to do something with recent changes to NGUI, since older versions still work fine (e.g. NGUI 2.1.4). We're investigating this issue and are trying to resolve it very soon. It's nothing on your end, sorry.
     
  21. Hoskins355

    Hoskins355

    Joined:
    Jan 3, 2013
    Posts:
    142
    Yea just upgraded NGUI to the paid version. How do you import an older version of NGUI since I guess it gave me the most current
     
  22. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    I can't give you a hint on that, please refer to the NGUI forums.
     
  23. Hoskins355

    Hoskins355

    Joined:
    Jan 3, 2013
    Posts:
    142
    NGUI says"NGUI doesn't reset layers for you, but it will unify them. Ie: if your panel is on the Default layer, but everything underneath the panel was on say, GUI layer, then NGUI will assign the panel's layer to everything underneath. Likewise, when changing the layer, you need to change it on the UIPanel rather than on individual widgets." but still no luck getting version 2.1.4 I even paid the $95 you think they would provide older versions by request
     
  24. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    Thanks for the additional information, the layer resetting thing is still something I have to figure out before releasing a fix for this. NGUI's author normally responds within few hours, I think it's worth trying to request an older version.
     
  25. Hoskins355

    Hoskins355

    Joined:
    Jan 3, 2013
    Posts:
    142
    I did ask for a older version he said he doesn't have any and I should use the most current version.
     
  26. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    Sorry to hear that. You can still work with the free version until I found an effective solution...
     
  27. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    Just submitted version 1.2c to the Asset Store team, it took quite a while to find out what was changed in NGUI 2.1.6+. NGUI's UIPanel class had two new methods at the end, which reverted all layers of all gameobjects in the whole scene to default, if a widget wasn't parented to a panel (that's the case for elements of the ProgressMap). Once I put a Debug.Log in there, Unity freezes for a good amount of time. I got around it by attaching the ProgressMap pool directly to its starting point, parented to a panel. No more collision errors or towers stop shooting. If you use one of the newer and paid versions of NGUI, please make sure to update.

    1.2c isn't online yet, but will be in a few days.
     
  28. Hoskins355

    Hoskins355

    Joined:
    Jan 3, 2013
    Posts:
    142
    Upgraded to version 1.2c but now my levels give me a error of "KeyNotFoundException: The given key was not present in the dictionary.
    System.Collections.Generic.Dictionary`2[System.String,Pool].get_Item (System.String key) (at /Applications/buildAgent/work/3df08680c6f85295/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:150)
    ProgressMap.AddToMap (UnityEngine.GameObject mapObjectPrefab, Int32 objID) (at Assets/3D Tower Defense Starter Kit/Scripts/GUI/ProgressMap.cs:40)
    TweenMove+<OnSpawn>c__IteratorB.MoveNext () (at Assets/3D Tower Defense Starter Kit/Scripts/Enemy/TweenMove.cs:92)"
     
  29. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    As line 40 of ProgressMap.cs implies, please check if the ProgressMap Pool is named "PM_StartingPoint" in your scene. The name was changed from "StartingPoint" to "PM_StartingPoint" in the last update to indicate that this object has something to do with the Pool Manager.
     
  30. Hoskins355

    Hoskins355

    Joined:
    Jan 3, 2013
    Posts:
    142
    Thanks that fixed it, but one more question I am working on a menu and in addition to the start button I wanted levels button and help button. I know how to make the buttons in NGUI and add a loadlevel script, but some of levels take a while to load and there is no loading indicator I like how you did it with your start button, but i am unsure how to edit the MainMenu.cs do I just copy these lines "//start button to start the actual game
    public GameObject startButton;
    //main level name to load
    public int sceneIndex;
    //loading progress on webplayer builds,
    //displays how long it takes to stream the game scene
    public UILabel progressText;"

    then just change startButton to LevelButton
    and public int sceneIndex to sceneLevelmenu

    Thanks again for all of your help
     
  31. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    Only copying the variables and editing their names wouldn't help you that much. Whenever the "Start" button gets clicked, it calls the method LoadButton(). LoadButton() disables the button and displays the progress value, but also invokes LoadGame() to refresh the progress value. LoadGame() checks for the level loading progress of the int value "sceneIndex", so finally you should either copy and modify all of these methods or implement a more universal solution, which can be used for every scene.
     
  32. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    You've actually posted the whole MainMenu script, please remove the code or I have to contact an administrator. Let us continue with private messages, I'll get back to you soon (it's weekend).
     
  33. bubbalovesponge

    bubbalovesponge

    Joined:
    Nov 8, 2012
    Posts:
    69
    Love your work. Purchased and very pleased. Only one comment. Please get rid of using NGUI. I Hate that thing, never did like it at all. Your product is awesome and to get frustrated with that NGUI is very frustrating.
    I deleted the whole NGUI and simply coded a better menu system.
     
    Last edited: Jan 29, 2013
  34. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    Currently NGUI is the only way out of a performance-heavy, feature less solution built-in. Especially for mobile devices. We have a base of roughly 200 customers now, removing a functionality the kit depends on isn't that easy.
     
  35. Lioncirth

    Lioncirth

    Joined:
    Apr 7, 2009
    Posts:
    111
    I am fairly new to Unity (Currently going through UnityCookie) I am hoping to buy this kit Friday - it looks excellent and I would'nt mind working on a mobile tower defence game :)
     
  36. Lioncirth

    Lioncirth

    Joined:
    Apr 7, 2009
    Posts:
    111
    I wanted to give a little review of this kit.

    Now a bit about me;

    I am fairly new to scripting, I know a bit about the interface and have done 1 or 2 tutorials (not much)

    I know nothing about scripting except for what var is and how if statements work lol

    This kit at first can seem a little overwhelming as there is so much there but the documentation that has come with it is amazing. It breaks everything down and tells you exactly how things work etc.

    If you are looking to create a Tower Defense game then this kit is excellent! - I am looking forward to getting something together :)
     
  37. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    Thank you very much for sharing your review. Nice to meet you :)

    And good luck on your mobile project!
     
  38. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    Announcing Version 1.3 (live on the stores) - Release notes:

    Fixes Changes
    • GUIImpl.cs: when placing new towers onto grids, their turret rotation is now fitting the grid rotation, allowing them to face the path
    • Properties.cs: added randomized walk animation offset on spawn
    • updated Unity4 script files “Unity4_Files.zip” accordingly
    Features
    • WaveManager.cs: added options to specify the start delay and delay between enemies as minimum and maximum values (this adds a bit randomness to the game)
    • Properties.cs: success animation slot added, which allows the playback of an animation when the enemy reached the end of the path. In this version, there is a new animation called "Escape" and the enemies will sink into the ground instead of dying at the end of the path
    • GUILogic.cs, mobile desktop scene: when pressing ESC during the game, there will be a new slider for manipulating the sound volume
    • Upgrade.cs: possibility to swap out the tower model per upgrade level. So when upgrading a tower, you can illustrate the change with a new model. You can use different tower options and even different projectiles per upgrade level. As an example: in the medieval scenes, the arrow tower (brown roof) will transform into a multi-shot tower (red roof) when upgraded 5 times. See page 34 of the documentation for setup information

    Please note that the wave settings widget will lose its values (breaking changes), I would suggest making a backup before upgrading.
     
  39. gevarre

    gevarre

    Joined:
    Jan 19, 2009
    Posts:
    132
    Sweet. You really are awesome!
     
  40. kurotatsu

    kurotatsu

    Joined:
    May 10, 2012
    Posts:
    588
    I'd really like to see a couple video tutorials making a level from scratch. That being said the toolkit is very well documented, I'm just saying some of us are visual learners and it opens the possibility of more sale.

    Just a thought.

    Enjoying the kit and thanks for making it.
     
  41. Lioncirth

    Lioncirth

    Joined:
    Apr 7, 2009
    Posts:
    111
    @Kurotatsu

    I dont know if Baroni has any plans on doing this, I have been using it for a little while (still learning ALOT) and have been toying with the idea of doing a couple for him.

    If he wants them and if I can pluck up the courage to get on mic hehe
     
  42. kurotatsu

    kurotatsu

    Joined:
    May 10, 2012
    Posts:
    588
    I say go ahead and make some as other have made tutorials before without problem. Plus it shows how interested those that purchase it are.
     
  43. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    Video tutorials would be very cool indeed, problem is that I can't commit to a series of videos while keeping them up to date. Doing video tutorials is one thing, editing and uploading another one. After a few versions they could be obsolete due to major changes in the kit, so I would have to redo them. That's a time consuming task, time I likely want to invest in new features.

    Lioncirth, if you're about to do some tutorials, even if they approach only specific aspects, I would highly appreciate your efforts! Please tell me if I can help you with something when doing these. :)
     
  44. kurotatsu

    kurotatsu

    Joined:
    May 10, 2012
    Posts:
    588
    Alright, that's how we get the ball rolling. Teamwork.lol

    Well done.

     
  45. gevarre

    gevarre

    Joined:
    Jan 19, 2009
    Posts:
    132
    Okay, I re-imported 1.3 into my project (after making a backup), re-overwrote the project settings files as before, and re-overwrote the Unity 4 files as before.

    Now if I load one of my previously made levels and go to Window>TD Starter Kit> Wave Settings, I just get an empty window with the following error:

    Code (csharp):
    1. ArgumentOutOfRangeException: Argument is out of range.
    2. Parameter name: index
    3. System.Collections.Generic.List`1[System.Single].get_Item (Int32 index) (at /Applications/buildAgent/work/3df08680c6f85295/mcs/class/corlib/System.Collections.Generic/List.cs:633)
    4. WaveEditor.OnGUI () (at Assets/3D Tower Defense Starter Kit/Scripts/Editor/WaveEditor.cs:165)
    5. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Applications/buildAgent/work/3df08680c6f85295/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
    Note that this only happens with levels I've created. It works fine if I load one of your examples. Any idea what might be broken? I don't mind having to fix or rebuild certain assets to work with the new functionality, but I'd hate to have to start the entire project over from scratch.

    One thing I'm not understanding, which may or may not be a clue, is when using the Wave Setting window to set up the waves, where is that info stored? My uneducated guess would be that it's trying to access a pre-existing file containing that data, which is out-of-date and doesn't contain the new variables. If I knew where that was stored, my thought was that I could delete it to see if that clears things up. The only thing I see is a reference in the WaveEditor.cs script to "waveScript", but I don't know what that is.
     
  46. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    You're right, obviously the Wave Settings widget does indeed try to load old values, which are not fitting to the new layout and variables. I totally forgot to describe that step when I updated my scenes. You don't have to start all over again though.

    Now there are two options to fix that:

    1. Is the Wave Settings window completely empty? Isn't there a "X" button to remove the first wave? If you see the button, press it until all waves were removed.

    2. In case there is no button to remove the waves, open up WaveManager.cs and comment out line 17:

    Code (csharp):
    1.  
    2. //store wave properties, this is a list of an own class (see below)
    3. //[HideInInspector]
    4. public List<WaveOptions> options = new List<WaveOptions>();
    5.  
    The list of WaveOptions will then show up in the inspector of the script. All the wave information (enemies, delay, paths etc.) is stored in this list named "options". At this point you can manually set the size of the list to 0.

    The Wave Settings widget should now be empty, not throwing an error anymore and you can reenter the wave information.
     
  47. gevarre

    gevarre

    Joined:
    Jan 19, 2009
    Posts:
    132
    Sorry, that didn't fix it. Even with the line commented out and a fresh restart, all I get is this:
    $WaveSettingsError.jpg

    If you click on what looks like that tiny window just below the label, you can move the window around. If you manage to right-click on just the right spot below the label, you have the option of closing the window or adding a standard Unity tab (Scene, Game, Inspector, etc), but that's it. clicking on the widgets on the right side of the window bar (Close, Minimize, etc) don't even work.
     
  48. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    Did you set the size of the "Options" list in the inspector of the Wave Manager gameobject to zero?

    The Wave Settings widget should be empty (only showing the "Add wave" button) after that.
     
  49. gevarre

    gevarre

    Joined:
    Jan 19, 2009
    Posts:
    132
    Yep. That fixed it :)

    The options for the Wave Manager in the inspector don't actually show up until that line is commented out, so I hadn't thought to look at it again. Once that's set to 0 and the scene is saved, I can go back and uncomment out that line and it all works fine.

    Thanks!
     
  50. galent

    galent

    Joined:
    Jan 7, 2008
    Posts:
    1,078
    Hi,

    I'm having an issue with the PoolManager.Props dictionary. The RangeTrigger script is trying to access the PoolManager.Props[colGO.name].health and not finding the instance. I've looked around and can't see where the Props dictionary is actually populated, but before I go changing the code I thought I'd ask and see if I'm missing something. Is there some setup step I'm missing or is this a missing line of code?

    Cheers,

    Galen