Search Unity

TowerDefense ToolKit 4

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

  1. thomas4d

    thomas4d

    Joined:
    Sep 5, 2013
    Posts:
    56
    thanks working now

    one more thing where do i find the setting or infomation on "support flexible placement of building platform with auto size adjustment to fit gridSize" feature

    currently My towers are appearing Not centred about 25% lower Left instead of object centre mixing in the centre of the grid.

    where do i check or find the settings for this ?

    Thanks
     
  2. thomas4d

    thomas4d

    Joined:
    Sep 5, 2013
    Posts:
    56
    now i have a crash like i did with the Tower manager when I add creeps ??

    I follow the same method as adding a Tower but when I get to Creep the creep editor Panel freezes ?

    please help

     
    Last edited: Oct 17, 2013
  3. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Sorry for the slow respond again, I'm once again traveling. But at least this time I have internet access from time to time and I'll be back to my usual place by Saturday.

    The flexible placement and auto-size adjust is for the build platform, not for the tower. Flexible placement means you can put a platform anywhere using typical unity 3D positional adjustment method. Auto size means it will scale the platform to fit the gridSize specified. Your tower is not centered because you havent position it according to the rootObject (the empty object with the UnitTower.cs attached on it where you place your model as it's child object). Make sure your model center is match to the origin of it's rootObject (at 0, 0, 0). Please refer to the tower video again. I've made some quite important point.


    I'm afraid there's some bug I've yet to fixed. I'll try to do that asap. The problem is that you will need to add HP overlay to the creep prefab. I would suggest you to try follow the creep video if you cant wait for the fix. The video shows you how to duplicate an existing creep and replace the mesh. Once you have create a new prefab following that, you can safely add it to CreepManager.


    Yes there is. If you look at the endless mode example, both of them allow you to use abilities anywhere on the map. What you need to do is add an invisible collider on the horizontal place and assign it with terrain collider layer.
     
  4. thomas4d

    thomas4d

    Joined:
    Sep 5, 2013
    Posts:
    56
    Yes That done it works now Joy =)

    WOW i just read this . your a pretty negative dude aren't you ? I followed the instructions Found 2 bugs and there being fixed ?

    Clearly your statement and attitude say's alot more about YOU as a person, then my knowledge of Unity.
     
    Last edited: Oct 18, 2013
  5. Tsurugi

    Tsurugi

    Joined:
    Sep 21, 2012
    Posts:
    97
    Hi songtan
    sometimes the creep don't die immediatly. Sometimes they run on for 7 tiles or more before the explode. I have no idea why

    In the targeting section of the tower, you can't select the same option twice. For example, if I selected 'Toughest' on my Blade tower, and then 'Toughest'
    on my MG, My MG won't change to toughest unless I click on something else first.

    I recall that your missle tower's missle is slower than the MG tower's bullet. So if you know how to adjust the speed of shots(speed of the projectile), it'll give us more control over the game.
     
  6. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Well, I've never have any issue like this so It's hard tell why either until I get to thinker it with it a bit. I'll need more info about this. Is this happen on one specific type of creep only or it happen on all kind of creeps? Can it be replicate consistently or it seems to be random? Is it always 7 tiles or more?

    Thanks for letting me know about this. I've worked on it and fix the problem. That will be in the next update.

    You can adjust the speed in the shootObject prefab it self.
     
  7. eridani

    eridani

    Joined:
    Aug 30, 2012
    Posts:
    655
    Hi Song I ran into an error when I tried to block as much of the creeps' path as possible using Blocks. It looks like the creeps were trying to find their way through when the error happened:

    $error.jpg

    $errorBig.jpg

    $map.jpg
     
  8. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Can you consistently replicate the bug? Does the bug breaks the game? I've tried the exact same thing and cant seems to replicate the bug. From the error I dont think it's a game breaking bug. If the bug doesnt break the game and it only happen once in a while. I would suggest you to ignore it. I'll try to fix it when I encounter it.
     
  9. eridani

    eridani

    Joined:
    Aug 30, 2012
    Posts:
    655
    No I can't consistently replicate it, although it did break the game when it happened. Maybe you could just tell me where to put an "if index out of range" check in the code so it doesn't break the game when it happens?

    Anyways thank you Song and I am extremely impressed with this package. How did you learn to code all this?
     
  10. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    I think a simple "if index out of range" check wouldnt stop the game from breaking. It's a bit more complicated than that. But I suppose we can try it. There's a slight miss-match with your script and mine so I can only guess which line causes the error. If it's this

    if(MoveToPoint(subPath[subWPCounter])){

    try change it to this:

    if(MoveToPoint(subPath[Mathf.Min(subPath.Count-1, subWPCounter)])){


    By the way I learnt to code by myself, through endless trial and error. The package you have got is a result of 2 years of iterative development.
     
  11. eridani

    eridani

    Joined:
    Aug 30, 2012
    Posts:
    655
    Thanks, I will try that to see if it helps. Also, I have another question about a bug I encountered that I attempted to fix. Sometimes when building a tower, the indicator is Red when it should be Green. I noticed this happens when I move the indicator from a valid build location to an invalid build location (off the build platform and into the lake, for example - see picture) and then bring it back onto the valid build location:

    $offBlock.jpg

    $redOnBlock.jpg

    I looked in the file called UnitTower.cs around line 623 to try to fix the problem. I added the line of code "lastPosDnD = Vector3.zero;" to line 658 as follows, which seems to fix the problem. But I wanted to get your idea on this issue because I am not the best programmer:

    $code.jpg

    $greenOnBlock.jpg

    Also, I am curious about line 646, because you check for the condition "!flag" ... however, aren't you already checking that "flag" is true on line 631, so that flag will always be true on line 646? Maybe I don't understand enough.

    Anyway, please let me know if you know a better way to fix this issue. Thank you so much Song!
     
  12. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    I noticed the bug myself and have fixed it. Just like how you did. It is the only thing I can think of. But then I'm not the best coder either. :)

    You are absolutely right about the flag checking in line640 and line646. It's a redundant check. You can remove it and just leave it with buildEnableDnD.
     
  13. eridani

    eridani

    Joined:
    Aug 30, 2012
    Posts:
    655
    Thanks Song, now I have a question about projectiles...it seems like all projectiles curve as they track their targets right? This looks great for missiles, but sometimes it looks a bit strange for laser beams and cannon bullets, which are "supposed to" fly straight.

    If I wanted to make a projectile that has no target and just flies straight and doesn't curve at all, is there a way for the engine to handle that? I was looking at the code and there seems to be a ShootObjectType called "FPS" that seems to address the issue somewhat, but it doesn't look finished. Do you think the best way to proceed is for me to modify the FPS ShootObjectType to get what I want?

    Also, I would have to code my own hit detection, since my projectile won't have a target that it's tracking. Either I could loop through all active enemies and see if my projectile distance is less that 0.25 to any of them (your current hit detection model), or I could shoot out a raycast in front of each projectile to see if it collides with a creep. Which do you think is faster? Thanks!

    And Song you are a fanastic coder! I think for sure most programmers couldn't build a whole complete system like this from scratch (which is why I bought it :)
     
  14. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    You can set it so the projectile travel in a straight, rather than a curved trajectory. Just set the MaxAngle on the prefab to zero. There is one default towers (pulse-laser tower) that shoots in straight line, see for yourself. Or you can read about the configuration of the shootObject in the documentation. Between the documentation and all the example shootObject used by the example towers. I'm sure you will find what those variables are and how to get the shootObject to work the way you want it.

    The FPS system is something I played on. Like you said, it's not complete. It's meant for first person control tower, nothing to do with how the shootObject travel and hit the target.

    For hit detection. There are two ways to do it depends on your implementation. You can use the default physic system, trigger and rigidbody so to speak. It will handle the collision for you. Of course, you can use spherecast or raycast from the projectile to detect any hit. I wouldnt under any circumstance loop through all the creeps and calculate the distance though. Unless you are pretty sure that you never have more than a handfull of creep in the scene. Do I really do this in my code? Probably I wanst thinking back there or that was meant for something else.

    By the way, thanks for your compliment. I still dont think I'm anywhere near fantastic. Still learning as I go. But thanks anyway. :)
     
  15. eridani

    eridani

    Joined:
    Aug 30, 2012
    Posts:
    655
    No, you definitely don't loop through all the creeps. The way you coded it, each projectile has a target, so it only has to check the distance one time -- there's no loop. But for me, I was thinking of looping through all the creeps because my projectile wouldn't have a target, so it would have to check all the creeps to see if it hit one. I didn't know how expensive raycasts are, but maybe they would be better.

    Speaking of raycasts and physics, I notice that the creeps have a collider but no rigidbody. I'm still new to Unity, but I just read yesterday that moving a collider with transform.translate() or transform.position causes a large performance hit. Reference this thread:

    http://forum.unity3d.com/threads/159434-What-exactly-is-considered-quot-moving-static-colliders-quot

    If I add a rigidbody to each creep and set it to isKinematic (and then use rigidbody.MovePosition() and rigidbody.MoveRotation() to move the creep), do you think there will be any performance increase on mobile? Right not I'm getting about 50 fps on my Galaxy Note 2, which is completely fine. I was just wondering if you did any sort of performance testing regarding moving colliders. Thanks!
     
  16. eridani

    eridani

    Joined:
    Aug 30, 2012
    Posts:
    655
    Also, I just want to clarify MaxAngle is set to zero already on the PulseLaser. But when a PulseLaser object is fired at a target creep, and then it's flying toward the target, and the creep moves, the PulseLaser object will move in the air (effectively "curving" in flight) to follow the creep so that it always hits the creep dead center. It's a subtle effect, but you can see it happen if you watch carefully, especially with fast-moving targets. I think you coded things so that a projectile will always move toward the target whenever the target moves, so that a projectile will keep tracking the target and never miss it.

    I'm trying to create a projectile that flies straight toward a creep, but if the creep moves out of the way, the projectile will keep flying straight and miss the creep completely. Of course, this means I would have to fire the projectile with some sort of lead aim if I want it to hit a moving target. And the projectile would be allowed to hit any creep on the battlefield, not just the one it was trying to hit. I think I can still use something similar to the FPS tower functionality, because it doesn't require a projectile to have a target.
     
  17. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Very sorry for the slow respond. I missed the notification in my mailbox. >.<

    I actually done a few test of my own. The current setup is the fastest in term of performance from my own observation. But unless you are having more than a hundreds of unit in scene at once. it doesnt really matter.

    The MaxAngle is only set for elevation/rotation in x-axis. It doesnt stop the shootObject from adjust it course in y-axis in order to hit the target. This slight adjustment, which you can observe in very fast moving creep, is unfortunately a necessity for the implmentation of the targeting mechanism require by the game. Basically what happen is each projectile is assign a target and it will go for it until it hits.

    Unless you have an extremely fast moving projectile, this will be very difficult to pull off. The tower would need to aim ahead of the creep, taking acount of the creep movement direction, speed, as well as the projectile speed. That require some sort of complex algorithm and it's doesnt give much room to open modification. There's a chance that in certain combination of setting and path, the projectile will miss the target most, if not all the time. It probably make sense for AI in FPS so the player can evade the shot. But in a TD game when you have no control of the aiming, it could be very frustrating for the player. That's the reason why I dont support this mechanism.
     
  18. thomas4d

    thomas4d

    Joined:
    Sep 5, 2013
    Posts:
    56
    I'm getting error

    Assets/TDTK/Scripts/C#/UI/UInGUI.cs(882,25): error CS0246: The type or namespace name `UISlicedSprite' could not be found. Are you missing a using directive or an assembly reference?

    I have FULL Ngui install the PDF say's
    but how do i do that ? 44 pages of this thread Maybe a FAQ on your site would save time since this forum does not have good searching
     
  19. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    My aplologies, I wrote that with the assumption that the reader would be quite proficient with the component and hierarchy system of Unity. "UINGUI/Camera/Anchor/Panel/TowerPanel/TargetControlPriority/TargetPriorityList/" is actually the object hierarchy in the scene of the gameObject which is missing the component UISplicedSprite. You can find that manually or click on the warning message in the log. Clicking the warning message will highlight the object in hierarchy tab automatically. When you have the said object selected, you will see a missing component slot in the Inspector. Simply drag the script from NGUI folder UISlicedSprite into the slot should fix the issue.

    But what you are having is not a missing component, you are actually missing the file UISlicedSprite.cs itself. That is the file is not in the project at all. Are you installing the latest NGUI? Fyi, the default NGUI menu doesnt quite support the latest NGUI (version 3+) yet due to an issue with the font. You can only update NGUI up to v2.7.
     
  20. thomas4d

    thomas4d

    Joined:
    Sep 5, 2013
    Posts:
    56
    THANKS ! OK all cool got it working again Great Support dude :D

    Just wish i could search for the anwers alittle easier,. before i have to ask you directly every time :wink:
     
  21. StCrystal

    StCrystal

    Joined:
    Sep 25, 2012
    Posts:
    2
    I usually get this error and tower stop attacking creeps:

    NullReferenceException: Object reference not set to an instance of an object
    UnitTower.GenAttackInfo (.Unit unit) (at Assets/TDTK/Scripts/C#/UnitTower.cs:1431)
    UnitTower+<TurretRoutine>c__Iterator5F.MoveNext () (at Assets/TDTK/Scripts/C#/UnitTower.cs:1086)

    What object is missing? And how can I fix it?
     
  22. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Does the error happen consistently? Does it happen with the default towers? I'm not sure if you have modify the script or anything, but from what I can tell from my own script, it's very unlikely for the error to happen there. If anything, it should have happen else where, before, not on the line the error log is showing. So I cant quite figure out what is wrong just yet. Can you show me line1431 of your UnitTower.cs?
     
  23. CaffeinConverter

    CaffeinConverter

    Joined:
    Jul 10, 2012
    Posts:
    12
    Hi Songtan,

    Your TDTK looks great.

    Quick question before deciding to buy it: I have great assets for TD game (towers etc) but these assets are 2.5D I mean really they are series of .pngs and contain a 3D (lighted) pic of the tower. The serie of a specific tower is a sequence of the tower animation.

    My question: Can this asset used in your TDTK or it supports only 3D assets? If yes, how big effort (code rewrite etc) to use these assete? If it is a big work, what is the recommended: Redo the assets in 3D to fit completely to TDTK or modify TDTK to use theese assets?

    Thx for the answers in advance.
     
  24. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Thanks for the interest. :)

    By default, TDTK only support 3D assets. I imagine getting it to work with 2D asset will be no small task. But then if you get a 3rd party toolkit to handle the sprite animation, the work load will be reduced by a significant amount. The trick is to fix the camera angle and get the sprites to look right from that angle. So if the animation is handled, all that is required is to figure out the direction and action of each unit and set the sprite accordingly. (ie if the tower is aiming towards right, if the creep is moving donwwards, etc.)

    Regarding to change of asset or modification of code, it's very hard for me to recommend without any project details on hand. I mean if you have hundreds or even more assets surely it's easier to modify the code. Or if you want the game to look perfect, the logical thing would be to modify the code as well. But if you just want to get a prototype running or recreating the asset is relatively easy for you, then modifying the code could mean more work.

    Hope this help.
     
  25. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Looks very very good. Looking forward to see the full playable level.
     
  26. gridside

    gridside

    Joined:
    Jul 26, 2013
    Posts:
    97
    Song, i'm glad you like it. Planing to share little game play video following days.
     
  27. Zbigniew Wiadro

    Zbigniew Wiadro

    Joined:
    Aug 20, 2013
    Posts:
    6
    Hello Song!

    1. I create a new project with TDTK#2 package.
    2. I open an unmodified ExampleLinearSinglePath scene of TDTK#2 in my project.
    3. I change build mode to Drag'n'Drop in UI object -> click PLAY -> click on one of available towers.
    4. [BUG?]: I get many "building cancelled" popups.
    The problem is only when the selected Unity build platform is Android. Everything is okay on PC Mac Standalone.
    The problem appears on both Unity 4 and 3.5.7 versions.

    How could I fix this? Is it repairable?
     
    Last edited: Nov 19, 2013
  28. Dottim

    Dottim

    Joined:
    Nov 8, 2013
    Posts:
    34
    hi, i'm new to unity and you have made a great toolkit and i'm having a lot of fun learning about unity creating my first td game, but I have a question:

    is it possible to set resource turrets to a different layer than normal turrets? I want to create extra interaction for my normal turrets (by using raycast on the turret layer) but I don't want to do this extra interaction with resource turrets (or support turrets) but since they are on the same layer they automatically get the same interaction when I right click them :/ .. so if it would be possible to just change it so weapon turrets are on their own layer my problems would be solved :)

    thanks in advance, I hope you have an idea on how to help me ..
     
  29. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Right, you will need to add an additional layer in layerManager and expose it in LayerEditor so you can edit it in Inspector. Then in UnitTower.cs you can let the tower assign the right layer according to the tower type. Anyway, I've done a little fix for you. Can you please give me your email so I can mail it to you?
     
  30. Brensdumb

    Brensdumb

    Joined:
    Mar 13, 2013
    Posts:
    11
    I have one small question,
    If you are using the maze based level, not a linear based level, is there anyway you can make the towers use more than one build space. I don't know if there is, but if there is may you please help me? Thank you
     
  31. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    It's not supported by default, as I thought it would be tricky to actually make it feasible enough with the current code. There's no way to customize it if you want the tower to have a certain footprint. The best the current code can do is set it so if the tower occupy only 1 tile or expand the 1 tile with all its adjacent tile. So it's like 1, 9, 27 and so on. As you can see, not very useful.

    You can see how it's done. There's a hidden variable named footprint in UnitTower.cs that do the trick. You can make it public and see what it does. You can look for how it's used if you do a search in UnitTower.cs and BuildManager.cs.
     
  32. Brensdumb

    Brensdumb

    Joined:
    Mar 13, 2013
    Posts:
    11
    Okay, thank you very much for your help.
     
  33. Zbigniew Wiadro

    Zbigniew Wiadro

    Joined:
    Aug 20, 2013
    Posts:
    6
    I would like to get rid of build platforms and place towers anywhere.
    Is it easy to achieve in TDTK#2.2.4 ?
    Could you please give any guidances ?
    Thanks in advance!
     
  34. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    It's not difficult, but there are certainly a lot of details to take care of. First you wil need a build function in BuildManager.cs that doesnt use platform. I've done that:

    Code (csharp):
    1.     //for dragNdrop build without using platform
    2.     public static string DragNDropBuiltNoPlatform(UnitTower tower){
    3.         Vector3 buildPos=tower.thisT.position;
    4.        
    5.         int ID=0;
    6.         for(int i=0; i<buildManager.availableTowers.Length; i++){
    7.             if(buildManager.availableTowers[i].prefabID==tower.prefabID){
    8.                 ID=i;
    9.                 break;
    10.             }
    11.         }
    12.        
    13.         BuildManager.ClearSampleTower();
    14.        
    15.         tower=buildManager.availableTowers[ID];
    16.        
    17.         int[] cost=tower.GetCost();
    18.         if(GameControl.HaveSufficientResource(cost)){
    19.             GameControl.SpendResource(cost);
    20.            
    21.             GameObject towerObj=(GameObject)Instantiate(tower.thisObj, buildPos, Quaternion.identity);
    22.             UnitTower towerCom=towerObj.GetComponent<UnitTower>();
    23.             towerCom.InitTower(towerCount+=1);
    24.             return "";
    25.         }
    26.        
    27.         return "Insufficient Resource";
    28.     }

    Then in UnitTower.cs, start with CheckDragNDrop(). Instead of calling BuildManager.CheckBuildPoint to check if the tower can be build. You can simply return true and skip all that code. Or you can check if there's any other condition that needs to be full filled before return true, other object, etc. Finally, in DragNDropBuilt(), call the function mentioned above instead of BuildManager.DragNDropBuilt();

    Hope this help.
     
  35. spyketherobot

    spyketherobot

    Joined:
    Sep 25, 2012
    Posts:
    15
    hello songtan
    one small question,
    there is a way to have more resources in the tower resource list but the turret spends only one?
    even if you need more
    example
    tower cost = 100 coins + 1 start
    resources spent = 100 coins

    regards
    spk
     
  36. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    I dont quite understand what do you mean by tower resource list? Is it something visible on the interface? Can you lease clarify?
     
  37. spyketherobot

    spyketherobot

    Joined:
    Sep 25, 2012
    Posts:
    15
    in Towereditor you can set the tower cost, by default is Resource and StarPoint .

    I need the turret spend only resources , but also requires Starpoints.

    sorry for my bad english :p
     
  38. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    You can configure the resource type that will be show up in your game in ResouceEditor. All the resource type you have in the ResourceEditor will show up in TowerEditor. If your tower doesnt require a specific type of resource, say StarPoint, just put the cost as 0 for StarPoint like all the default example towers. Then you will have StarPoint in your game, but you wont need it to build towers.
     
  39. spyketherobot

    spyketherobot

    Joined:
    Sep 25, 2012
    Posts:
    15
    hi songtan thanks for the quick reply and your patience

    my tower to be built needs 300 coins and 1 starpoint, I wish that building the tower would not subtract the star point.
    so i can build more tower with only 1starpoint.
     
  40. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    I see. Here's what you can do. Add this in line849 of your BuildManager.cs, right after "GameControl.SpendResource(cost);"

    GameControl.GainResource(1, cost[1]);

    It should look ike this:

    Code (csharp):
    1.         int[] cost=tower.GetCost();
    2.         if(GameControl.HaveSufficientResource(cost)){
    3.             GameControl.SpendResource(cost);
    4.             GameControl.GainResource(1, cost[1]);  //this is the added code
    5.  
    Basically it adds back however many StarPoints that is spent on building the tower. Be warned that this is a hack, It only works if you use current setting and it applies to all towers. If you change the resource type in ResouceEditor you will need to change the code to match or you will likely run into some issue.
     
  41. spyketherobot

    spyketherobot

    Joined:
    Sep 25, 2012
    Posts:
    15
    thanks songtan
    it works but it is possible to spend only resources instead of add starpoint once spent it ?

    i have multiple resource type in my project.
     
  42. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Very well, try this. Remove the new line, change the code to this:

    Code (csharp):
    1.             int[] cost=tower.GetCost();
    2.             if(GameControl.HaveSufficientResource(cost)){
    3.                 GameControl.GainResource(-cost[0]);
    4.  
     
  43. spyketherobot

    spyketherobot

    Joined:
    Sep 25, 2012
    Posts:
    15
    yo song
    at the end we manage to solve the problem working on the array cost
    i add this to buildManager and unitTower to remove only the needed resource .

    Code (csharp):
    1.     int[] retc = new int[10];    
    2.             retc[0] = cost[0];    
    3.             retc[8] = cost[8];  
    4.             GameControl.SpendResource(retc);
    5.  
    regards
    spk
     
  44. Tsurugi

    Tsurugi

    Joined:
    Sep 21, 2012
    Posts:
    97
    Songtan when I use the X3 or the fast forward function, for some reason the creeps death is delayed and sometimes can even cause health point if they don't time in time....
     
  45. Shigidy

    Shigidy

    Joined:
    Dec 14, 2011
    Posts:
    441
    Hey songtan, is there anyway you could add a new tower that would slow down the enemies. Like a pulse tower, but it doesn't attack it's only job is to slow down the enemies.
     
  46. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    This is a tricky one. From the code, the creep stops moving as soon as it's dead so it defninitely not the code's fault. Thing is when fast-forward is used, you are basically increase the time slice. If your game pace is relatively slow and with no performance issue, it should not be a problem. However if the machine is struggling to run the game already, forcing the game to go faster will cause a lot of anomaly. Imagine the game is running at maximum capacity of 20fps and is forced to double the processing it's doing. So either the game will slow down to 10fps, or a lot of processing will be skipped to maintain a fps of 20. It's the later in this case, so sometime the hit registration will be delayed, target that should have been detected goes undetected and so on. The same goes if you have a relatively fast pace game at default and then sped it up. What I would suggest is to check your hardware capabilities as well as re-evaluate your game pace. Fast-forward may not always be a good idea.

    Fyi, you can do that already. Just use AOE tower and enable slow effect only. It will slow all enemies within range without damaging them. The default AOE tower does that, expect it damage enemies at the same time. You can do the same with a turret tower as well to directly slow a single unit, just put the damage as zero.
     
  47. spyketherobot

    spyketherobot

    Joined:
    Sep 25, 2012
    Posts:
    15
    hello Songtan.
    thanks for your help ;)

    There is a way to have several updates path for the turrets?

    I need to split the update into three different branches, each one with different resources, but always starting from the same tower.

    example

    Tower 1 -----> update 1 ---> 2 ----> 3
    | |
    | |
    | V
    | Update 1 ---> 2 ---> 3
    |
    V
    * Update 1 ---> 2 ---> 3


    regards
    spk
     
  48. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Indeed there are ways. It's not supported by default, but I've added some code there that should be able to be used as the base. I never make it work tho. Basically instead of having a single upgradeStat array (type of TowerStat) for a tower, there are are multiple upgradeStat. Each array is basically an upgrade path. They can have different stats. You can look in UnitTower.cs, look for upgradeStat1 and upgradeStat2 and see how they are used.

    The tricky bit, and the reason why this didnt make it to release, is that you need the UI to support the feature. So a level1 tower needs 3 upgrade buttons. Then the tooltip to show user which upgrade path does what. I just cant find an elegant way to add this to the existing, already cluttered UI. Therefore it's dropped.
     
  49. UltraTM

    UltraTM

    Joined:
    Dec 8, 2013
    Posts:
    221
    Hello,

    can someone please help with upgrading the free version of ngui to the full version?

    Thank you
     
  50. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    The first thing you should know is that the NGUI free is entirely compatible with current version of NGUI. It's only compatible to NGUI 2.7 or below. For that reason, the UI the TDTK wouldnt work using the latest version of NGUI. So first make sure you have the correct version.

    So to update, first you will need to delete the NGUI_Free folder in TDTK. Then import the NGUI full. There might be a few missing dependencies that you need to manually assigned. That has already been explained in the pdf document "Release note" within the package.