Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

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,256
    Hi FlyingRobot,

    thanks for contacting me here. Everything can be swapped out with little to no effort, there are 3 setup widgets (for towers, enemies and projectiles) which should make this transition very easy. The height of a tower is only important when controlling it, so the camera view does not intersect them. Since all my towers have the same height, I added a "height value" for this case. Simply change this value in the inspector and the camera will be in the right height when in self-control mode. Other than that, the height of a tower does not matter.

    Regards,
    B.
     
  2. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,256
    There's a bug in the current version 1.0.1, where the wave manager does not save new values while in editor mode.

    To fix this, please remove the if-query found in WaveEditor.cs, line 36:

    Code (csharp):
    1. if (!waveScript)
    2. {
    3.    ...
    4. }
    I'll submit a hotfix later today to address this issue (version 1.0.2).
    edit: Fixed a bug in GridEditor.cs regarding grid generation and automatic renaming of new grids too.

    Also, the major update 1.1 is coming along nicely and should be out early next week.
     
    Last edited: Sep 4, 2012
  3. EskemaGames

    EskemaGames

    Joined:
    Jun 23, 2010
    Posts:
    319
    Will we receive an email with the new download link?, as this asset was bought outside the assets store I don't know how that works
     
  4. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,256
    Hi Eskema,

    simply use the same link in our email which you received at the time of purchase, it always points to the current version. If you haven't got an email or lost it, please email us at info@rebound-games.com

    Side note - 1.0.2 isn't online yet, I'll inform you here.
     
  5. EskemaGames

    EskemaGames

    Joined:
    Jun 23, 2010
    Posts:
    319
    I will wait until 1.1, I'm not in a hurry :)
     
  6. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,256
    Version 1.02 is available on the stores. This update fixes bugs in the editor and tower scripts, filling the gap between version 1.1.
    I'm sorry for any inconvenience or deep anger these bugs may have caused.

    Upgrade notice:
    If you want to keep your changes to the scene, prefabs, etc. just open a new scene, delete the old scripts modified in this update and then only import the corresponding new scripts.

    Asset Store users: Re-download the package from the Asset Store.
    Direct purchasers: Re-download the package from the email you received at the time of purchase.

    Thanks!


    Version 1.02 - Release notes:

    Fixes Changes
    • WaveEditor.cs: now always saves its values when being edited by the user
    • GridEditor.cs: renames new grids according to current amount of grids
    • TowerBase.cs: multiple projectiles are correctly lined up at the same height when fired by players
    • RangeTrigger.cs: skips adding dead enemies to floating towers, which resulted in towers sometimes shooting respawned enemies out of range
     
  7. pinchmass

    pinchmass

    Joined:
    Jul 2, 2012
    Posts:
    156
    any exciting info on 1.1 you want to reveal ?
     
  8. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,256
    I just throw in this image and leave the rest up to your imagination... for now :)
    It's called the "advanced scene" and serves as sample for new features.

     
  9. uni7y

    uni7y

    Joined:
    Jul 23, 2012
    Posts:
    287
    this is looking very cool!!!
     
  10. pinchmass

    pinchmass

    Joined:
    Jul 2, 2012
    Posts:
    156
    mmmm 200 hams
     
  11. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,256
    Hello all,

    I'm proud to officially announce version 1.1 of our tower defense starter kit.

    Version 1.1 - Release notes:

    Fixes Changes
    • GameInfo.cs: 'Start Wave' button was shown when the game was lost, fixed.
    • WaveEditor.cs: wave properties such as wave amount do now support undo as well.
    • TowerBase.cs: separated method for automatic and self-instantiated projectiles into two overloading methods.
    • SV.cs: variable 'showTooltip' renamed to 'showUpgrade'.
    • SV.cs, MainMenu.cs: point to readme if layers are missing.
    • ResetTrail.cs: new script attached to particles with trail renderes for trying to avoid artifacts when reusing them
      via the PoolManager. Works better than before, however this still seems like a unity bug.
    • Project: obsolete (Unity-)GUI removed, no GUI() calls anymore.
    • GUILogic.cs: major overhaul for independence. Now only serves as base for your own GUI implementation.
      New methods such as CheckIfGridIsFree(), GetUpgradePrice(), ...
    • GUILogic.cs: new method DisplayError(string text) displays a text on the screen to inform the player,
      e.g. when it's not possible to buy a tower without resources.
    • GUIImpl.cs: new: Implements those new methods of GUILogic.cs with customized behavior.
    • GUIImpl.cs: even without resources, the tooltip menu gets shown if a player wants to buy a tower.
    • GUIImpl.cs: click anywhere in the game to hide the tooltip and upgrade menu.
    • TowerManager.cs: added a list of 'TowerBase' scripts for tooltip access without tower instantiation.
    • SelfControl.cs: moved all GUI related reloading texture code into GUIImpl.cs (see DrawReload()).
    • SelfControl.cs: changed parameters for method Initialize() to not depend on a GUILogic.cs reference.
    • ProgressMap.cs: draws the progress of enemies on their path via NGUI. UnityGUI related code removed.
      Stores a list of active 'ProgressMapObject' instances. Uses the PoolManager.
    • iMove.cs: all progress map related code moved into an inner class 'ProgMapProps'.
    • Project: there might be some clean-ups regarding references in other scripts as well.
    • Documentation: updated with links to changes.

    Features
    • WaveEditor.cs: new: 'Insert Wave' button between waves.
    • ProgressMapObject.cs: new script to modify properties of objects which use the progress map.
      It's now possible to set up objects with different icons on the progress map using prefabs.
    • GameHandler.cs: resources can be defined as an array, allowing multiple resources in the game.
      Properties.cs (pointsToEarn) and Upgrade.cs (cost) changed accordingly.
    • GUIImpl.cs: In self-control mode, reloading is represented by a new slider instead of a circular reloading texture. The circular texture has been moved to the advanced example scene.
    • Example scenes: 'Advanced' scene added:
      - Adv_GUIImpl.cs demonstrates a transition from medieval to a science fiction themed GUI.
      - showcases multiple resources.
      - healthbar for player's game health
      - a path indicator (PathIndicator.cs) makes use of iMove to indicate parts of the whole path.
      - added two sample tower models, one projectile model (rocket), grids, three particle effects
      (PortalLinesFx, GoalRingFX, UpgradeFX) and a few more. See the folder 'Prefabs' next to the scene.


    Whew... still have to update the documentation and finish it up, stay tuned for upgrade notices.
    It shouldn't take that long - in the meantime, try the new example scene :)



    Best regards,
    Baroni
     
    Last edited: Sep 12, 2012
  12. taku

    taku

    Joined:
    Jun 5, 2012
    Posts:
    24
    Wow, loads of fixes and new features too. :)
    I tried to download the v.1.1 update from the e-junkie link I got in my e-mail but I still got the v.1.0.2
    I can wait till the docs are updated, no problem here.
    Thanks for the update:D
     
  13. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,256
    I haven't uploaded the new version yet, I'll submit it to the Asset Store by the end of the day and await their response in case something got messed up. Thanks for your patience :)
     
  14. taku

    taku

    Joined:
    Jun 5, 2012
    Posts:
    24
    Right.
    I should have read properly the last part of your post. :)
     
  15. uni7y

    uni7y

    Joined:
    Jul 23, 2012
    Posts:
    287
    I also did not read the last lines! We are to exited I think :)
     
  16. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,256
    Version 1.1 is available on the stores now.

    In short, this update concentrates on a complete overhaul of the GUI, which was seperated in 2 scripts. GUILogic contains basic GUI mechanics, while GUIImpl is a customized implementation built on top of GUILogic. Besides of that, Unity's OnGUI() calls are left behind, as this update now completely uses NGUI. There are a few more eye candy things such as health bars, reload bars and a rework of the Progress Map integrated. Not to mention the new 'advanced' example scene!

    Upgrade notice:
    Please do note that some features required backwards compatibility breaking changes. For example multiple resources will clear your tower prices and enemy points. Make sure to backup your existing project if you've made any changes, so you don't have to remember or write these values down. I've modified some of the prefabs (mostly towers + enemies) and scenes as well. I'm sorry for the additional effort (10-30 minutes) on your side after upgrading.

    Asset Store users: Re-download the package from the Asset Store.
    Direct purchasers: Re-download the package from the email you received at the time of purchase.

    ---
    Not all of the requested features made it into this release, but I haven't forgotten you. The next update will concentrate on tower mechanics, namely different tower models per upgrade level, power ups and such things. I'm still waiting for a more feature complete Unity NavObstacle solution to incorporate pathfinding and offensive enemies...

    I guess that's all for now, have fun!

    Best regards,
    Baroni
     
  17. retox

    retox

    Joined:
    Sep 12, 2012
    Posts:
    29
    Can't wait to get running with the update. However...


    Assets/NGUI/Scripts/Tweening/TweenFOV.cs(24,33): error CS0115: `TweenFOV.OnUpdate(float, bool)' is marked as an override but no suitable method found to override

    Any ideas would be greatly appreciated.

    I love this kit. It's been a pleasure using it. Great job!! :cool:

    **Updated

    http://www.tasharen.com/forum/index.php?topic=1353.0
     
    Last edited: Sep 12, 2012
  18. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,256
    Thanks for your kind words! It's great to see that our user base has grown by another happy customer.
    (Please write a short review in the Asset Store if you've bought it there :) )
    Thanks for the Hud Text installation note too!
     
    Last edited: Sep 12, 2012
  19. retox

    retox

    Joined:
    Sep 12, 2012
    Posts:
    29
    No problem and a review is up. ^_^
     
  20. retox

    retox

    Joined:
    Sep 12, 2012
    Posts:
    29
    I've struggled with a few issues when integrating NGUI Pro and deleting NGUI Free from the project due to script issues. However, if you follow the above link it solves the issue. Its not a 3DTD issue, the fact Rebound Games included NGUI is fantastic, its just a case of installing the 3DTD and NGUI packages in the right order. Also, if you run into issues later, just backup and run through the process again before panicking (checking the fuse fix).

    One thing I've experienced with V1.1 is that when all towers are placed and fully upgraded, its not possible to sell them. Has anyone else come across this?

    Really looking forwards to the next update for towers. I also agree with someones earlier post suggestion relating to enemies being able to attack towers, this would require a health system of course, but Rome wasn't built in a day.

    Well done Rebound Games for a quality development. ^_^
     
  21. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,256
    Thanks for the nice review :) I sent you a private message about it, could you please also give your review an appropriate rating (stars)? Much appreciated.

    For a new submission to the Unity Asset Store, I actually delete NGUI Free and import the full version to build a webplayer, then I delete it again and submit the package with NGUI Free. So I go through this process several times. The important step is to open a new scene before deleting something (as stated in the NGUI readme) and then import the other version. This way, all script connections stay intact. I don't know much about extensions to NGUI like HUDText, though.

    Could you explain or email me a more detailed description on how to reproduce this issue? I've tested it a few minutes ago with the desktop and advanced scene but everything worked fine.

    Well, assaulting enemies will indeed take some time. There is a lot to think about before coding, maybe I'll even start a discussion here at a given time.

    :D
     
  22. Progeny

    Progeny

    Joined:
    Sep 17, 2012
    Posts:
    32
    Hi, I've just purchased this package and it's wonderful!

    I'm experienced in iOS Developing but completely new to Unity 3D. I'm trying to replace the joystick control with a touch to move the terrain (or the camera?) but I don't understand what object should be associated with the user's finger touch... Could you give me help how to achieve this?
     
  23. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,256
    Hi Progeny,

    thanks for buying the kit!

    First, you would want to disable (or delete) the "Joystick" gameobject completely, which is located at "UI Root (2D)" > "Camera" > "Panel_Info" in the hierarchy. Without this gameobject and the "UIJoystick" component, you can't move the camera at all. The terrain should not move, since the simplest way is to move the player's viewport. Now, how you move the camera is up to you. Basically you create a new script and attach it to the camera.

    There are a few hints on touch inputs in the documentation: link

    If you want to move the camera by dragging around the screen, make a google search for "unity touch drag camera". If you got the basics implemented, just make sure that the camera won't move when controlling a tower ( if (!SV.control) ).

    Hope that gets you started,

    Regards,
    B.

    edit: maybe I've overcomplicated it a bit - if you duplicate the UIJoystick script, get rid of its target variable (that stands for the joystick thumb) and attach it to the camera, it could have the same effect. Either way, some modifications are needed...
     
    Last edited: Sep 17, 2012
  24. Progeny

    Progeny

    Joined:
    Sep 17, 2012
    Posts:
    32
    Thank you very much, I'll try it!
     
  25. Progeny

    Progeny

    Joined:
    Sep 17, 2012
    Posts:
    32
    Hi, I followed your instructions and I've created a new script, then I've attached it to the main camera. I'm trying to implement the same CheckBounds from UIJoystick but I'm having some trouble, when I reach the map's limit, I'm unable to get back with the touch dragging.

    May I have some suggestion? Please! :)

    Code (csharp):
    1. public class CameraScript : MonoBehaviour
    2. {
    3.     public float speed = 15.0f;
    4.     public Vector2 position;
    5.  
    6.     // Use this for initialization
    7.  
    8.     void Start ()
    9.     {
    10.  
    11.     }
    12.    
    13.  
    14.     // Update is called once per frame 
    15.     void LateUpdate ()
    16.     {
    17.         // Only if there are touches
    18.         if (Input.touches.Length > 0)
    19.         {
    20.             // Only work with the first touch
    21.             // and only if the touch moved since last update
    22.             if (Input.touches[0].phase == TouchPhase.Moved)
    23.             {
    24.                 if (!SV.control)
    25.                 {
    26.                     float x = -1 * Input.touches[0].deltaPosition.x * speed * Time.deltaTime;
    27.                     float y = -1 * Input.touches[0].deltaPosition.y * speed * Time.deltaTime;
    28.  
    29.                     if (CheckBounds())
    30.                     {
    31.                         transform.Translate(new Vector3(x, 0, y));
    32.                         position.x = x;
    33.                         position.y = y;
    34.                     }
    35.                 }
    36.             }
    37.         }
    38.     }
    39.    
    40.     //this method casts a ray against world limit mask with length of 5 units and returns a boolean,
    41.     //which indicates whether movement is possible in that direction
    42.     //on hit: world limit reached - return false, no hit: free space - return true
    43.     private bool CheckBounds()
    44.     {
    45.         Vector3 forw = transform.forward * this.position.y;
    46.         Vector3 side = transform.right * this.position.x;
    47.  
    48.         if (Physics.Raycast(transform.position, forw, 5, SV.worldMask))
    49.         {
    50.             return false;
    51.         }
    52.         else if (Physics.Raycast(transform.position, side, 5, SV.worldMask))
    53.             return false;
    54.  
    55.         return true;
    56.     }
    57.    
    58. }
     
  26. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,256
    Hi there,

    take that part out of the if-query:

    Code (csharp):
    1. position.x = x;
    2. position.y = y;
    so your code looks like this:

    Code (csharp):
    1.  
    2.                 if (!SV.control)
    3.                 {
    4.  
    5.                     position.x = -1 * Input.touches[0].deltaPosition.x * speed * Time.deltaTime;
    6.                     position.y = -1 * Input.touches[0].deltaPosition.y * speed * Time.deltaTime;
    7.  
    8.                     if (CheckBounds())
    9.                     {
    10.                         transform.Translate(new Vector3(position.x, 0, position.y));
    11.                     }
    12.                 }
    13.  
    The reason behind this quick fix is that the Vector2 variable "position" needs current input values, because CheckBounds() checks against them. With local variables x and y, CheckBounds() only knows the last input positions (which could be in the middle of an invisible wall). I tested your code, maybe you also want to manipulate the cameras world position when dragging up/down, as this code resulted in zooming forwards/backwards.
     
  27. Progeny

    Progeny

    Joined:
    Sep 17, 2012
    Posts:
    32
    wow, it seems to be a black magic! yeah, I'll try to fix the zooming issue! thank you very much for your help!
     
  28. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,256
    transform.Translate has a space parameter, maybe that could solve it.

    Unity Docs link

    You're welcome, good luck :)
     
  29. Progeny

    Progeny

    Joined:
    Sep 17, 2012
    Posts:
    32
    Hi, I've upgraded to Unity 3.5.6 and I'm getting this error in EndMenu.cs, I didn't change anything!


    NullReferenceException: Object reference not set to an instance of an object
    EndMenu.ConstructScene () (at Assets/3D Tower Defense Starter Kit/Scripts/GUI/EndMenu.cs:83)
    EndMenu+<Start>c__IteratorA.MoveNext () (at Assets/3D Tower Defense Starter Kit/Scripts/GUI/EndMenu.cs:33)

    The UILabel object is attached to the UILabel stats in EndMenu.cs
     
  30. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,256
    Hi,

    have you played the game before opening the GameOver scene? If you just open this scene without playing the game, EndMenu.cs can't find any information for displaying game stats. Nothing to worry about, but I should print a more helpful message next time. If you actually play the game and reach the GameOver scene, no errors should occur.
     
  31. Progeny

    Progeny

    Joined:
    Sep 17, 2012
    Posts:
    32
    You are right! Thanks
     
  32. Netzeus

    Netzeus

    Joined:
    Oct 12, 2012
    Posts:
    5
    Hi Great TD project very happy with my purchase worth every $ : )

    Good documentation and script, easy too use and easy to add new waves, tower and ennemies...

    Suggestion ( scoring system, ennemy shooting back at tower or end point, possibility to upgrade tower damage, radius etc... individually, bonus tower)

    Con: Will have to spend more money and buy NGUI :(

    Thanks.
     
  33. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,256
    Hi Netzeus,

    thank you!

    It's already possible to specify how a tower should upgrade its individual parts in the upgrade script, could you please explain further?

    Also a short description for a scoring system would help. Assaulting enemies still take some time since Unitys new obstacle avoidance is pretty much useless.

    Please feel free to leave a review on the Asset Store regarding pro's and con's!

    Regards,
    Baroni
     
  34. Netzeus

    Netzeus

    Joined:
    Oct 12, 2012
    Posts:
    5
    Scoring system: like highscore at the end of wave or level like (ennemy kill x ressource left)/percentage = bonus score ...
    Upgrade button: the player can choose to upgrade only let say radius or damage (would need more than one upgrade button)

    Overall very good projects good work having lots of fun with it :)

    Thanks...
     
  35. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,256
    I suggest you take a look at the 'GameOver' scene, where I implemented a final highscore based on the values of 'GameHandler.cs'. It should contain nearly all variables you need for a custom highscore. :)

    The current upgrade script isn't really made for multiple buttons and only one property - without modifications - that would result in breaking changes... but it's a good idea, I'll keep that in mind if I find a way! Let me know if you need help in rewriting the upgrade script.
     
  36. xraller

    xraller

    Joined:
    Aug 29, 2009
    Posts:
    15
    Any thoughts on how we could incorporate in game purchases to this kit? For example specialized towers or 'money'
     
  37. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,256
    The easiest way would be a main menu, where the store is located. There you could sell one-time items like a new level (in the level selection screen to choose from), or to get rid of any banner ads. This kind of addition does require a minimal amount of changes to existing code.

    Selling towers, more effective projectiles or money on the other side changes the gameplay itself. Your best bet would be to create a new script that checks for in game purchases, connected with the GUI implementation. This way, either the in game purchases script or the GUI could unlock / enable new buttons (e.g. for new towers) during the game.

    Regarding money: to not force players to purchase resources (for buying towers), you could store their money on the device (keyword 'PlayerPrefs') and let them earn money each round, but not enough to win the level in one go. If they really want to succeed in this level but they don't want to play it a few times, they can purchase money for buying an armada of towers. In this case, GameHandler.cs is a good starting point.
     
  38. Penguin_Tamer

    Penguin_Tamer

    Joined:
    Nov 2, 2012
    Posts:
    4
    Hey, looking at getting the starter kit, but have a few questions first:

    Is it fairly straight-forward to add more ways for towers to attack? Say I wanted to add a tower that affects all enemies in cone in front of the tower (like a flamethrower), or a tower who's attack hits all enemies around the tower within its radius, is the base AI setup so I could create more attack modes?

    Is there a built in UI design that's required for the game? I'm looking at using a system where the user clicks the place they want to build a tower, a radial menu pops up, and then they select the tower from there to be built. Basically, is it feasible to have a completely different UI than what's presented in the demos?

    In general, is the code accessible to be modified to fit a specific game style?

    Thanks for the work, and for continuing to respond to this thread.
     
  39. Progeny

    Progeny

    Joined:
    Sep 17, 2012
    Posts:
    32
    Hi, what about to set different price for every tower in the game?
    Some indications in order to achieve this?

    Thanks!
     
  40. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,256
    Hi Penguin_Tamer,

    thank you for your interest in our kit. Sure, I'm happy to answer them.

    Each attack mode is based on a few parameters, you can easily create new attack modes by changing these arguments or programmatically extend them. The detailed documentation and comments in every line of the scripts should help you with that. A tower that acts like a flamethrower is achievable - only a matter of field of view. It's nearly the same with a tower which should attack all enemies within its radius, this one would not have a field of view restriction, therefore automatically attacks all enemies around it. Playing with other variables as well gives you a set of different attack modes.

    A copy of NGUI is required, but not limited to the implemented design. The last update separated the GUI structure (containing all base methods) and the GUI implementation (your design that calls base methods), so it should be easy to extend or even rebuild the whole design in a different way. Just call the base methods you need and build your own GUI on top of that. For a radial menu you only have to re-arrange the tower buttons. The grid system already gives you information whether a grid was selected, if the selected grid is free and stuff like that. Definitely possible if you're familiar with NGUI and some C#, but I can help you too.

    As I mentioned, the full source code is provided and every line is documented. We already switched the art and GUI to showcase major adjustments - compare the medieval and space demo, they're almost independent. You can change every aspect of the kit, thus it's called a "starter kit", but this time obviously it includes all art, music, mobile controls and more. :)
     
  41. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,256
    Hi Progeny,

    the initial price of towers is set in their upgrade script, in the first slot of the 'cost' array. Changing these values will result in a different price, while further slots mean upgrade prices. Each tower prefab should hold an upgrade script.
     
  42. Progeny

    Progeny

    Joined:
    Sep 17, 2012
    Posts:
    32
    Hi Baroni. Thank you very much.

    I'm troubling with the scenes creation... I load the "Level_Mobile", File -> Save scene as... and I type "LevelN" where N is an integer.
    Now I edit the grass on the terrain and these changes are reflecting on the terrain of all the scenes I've created in this way. It's an Unity 3D bug (I'm using the version 3.5.6 for OS X) or it's my fault?
    Which is the best way to create a new scene without taking care of cameras and too many scripts?
     
  43. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,256
    It's not a Unity bug, but it's a Unity thing. The terrain is shared between all scenes. If you select the "Terrain" gameobject you can see the "Terrain Collider" component attached to it, which holds a "Terrain Data" named "TerrainMobile". That's the actual terrain object. Try duplicating this terrain object, rename it to something like "TerrainN" and assign it to this slot. Now you should have an independent terrain object for this scene.

    Your "save as..." strategy should be fine.

    Edit: Actually duplicating it doesn't work :) Try creating a new terrain by selecting "Terrain > Create Terrain" from the menu instead.

    Edit2: Duplicating does work, but make sure to drag drop the newly created terrain into the scene. Then remove the old terrain from the scene.
     
    Last edited: Nov 3, 2012
  44. Progeny

    Progeny

    Joined:
    Sep 17, 2012
    Posts:
    32
    Hi, this isn't too much clear :( can you explain step by step?
     
  45. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,256
    Sure, I'm sorry.

    1. select the "Terrain" gameobject in your mobile scene.
    2. In its "Terrain Collider" script, you'll see the actual terrain object it uses. Select that object.
    3. The terrain object gets highlighted in your project panel. Duplicate it by pressing CTRL + D. This will result in a copy, named "Terrain Mobile 1".
    4. Drag drop the new terrain into the scene.
    5. Delete the old terrain including its obstacles, or unparent and reposition them.

    Image for step 1-3
    Image for step 4-5

    Does this make sense?
     
  46. Progeny

    Progeny

    Joined:
    Sep 17, 2012
    Posts:
    32
    Yeah, I was unable to duplicate TerrainMobile before, because I searched in the menu that appears doing right-click on TerrainMobile. I didn't know that cool shortcut CMD+D :D thank you!!! It's now working like a charm!
     
  47. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,256
    You're welcome :)

    Don't forget to set up Terrain tags, layers, etc. (see chapter 3 in the documentation).
     
  48. Progeny

    Progeny

    Joined:
    Sep 17, 2012
    Posts:
    32
    Hi Baroni,

    in the Upgrade.cs I've tried to set values to cost array in this way:

    Code (csharp):
    1. public class UpgOptions
    2. {
    3.     //price each upgrade should cost
    4.     public float[] cost = {25.0f, 50.0f, 100.0f, 125.0f, 150.0f, 200.0f};
    5.     //attackable radius
    6.     public float radius = 5;
    7.     //projectile damage to deal to enemies
    8.     public float damage = 1;
    9.     //delay between two shots/projectiles
    10.     public float shootDelay = 3;
    11.     //possible enemy target count
    12.     public int targetCount = 1;
    13. }
    but I cannot achieve any change in tower's price or upgrade cost... :eek:
    What I'm missing? :roll:
     
  49. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,256
    Hey Progeny,

    don't modify the script, edit the values in the prefab here:



    In this image, you're looking for "price value" of the first level (element 0). That's the amount of resources a user should pay for placing the tower. Please see page 33 in the documention.
     
  50. Penguin_Tamer

    Penguin_Tamer

    Joined:
    Nov 2, 2012
    Posts:
    4
    So I'm trying to test out some towers, and am having issues with the Tower Manager prefab. I add a tower to the Tower Manager, and set its prefab as one of the sample towers for simplicity, and all looks fine. But when I run the game the tower name and prefab lists are cleared and emptied out, so I can't do anything with the towers. I've stepped through and debugged the issue but can't find anywhere that the lists would get emptied, but that's what's happening. Any clue as to what it might be? The example scenes work fine, so it must be something I did, or did not do, that's causing this.