Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

TowerDefense ToolKit 4

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

  1. darknside

    darknside

    Joined:
    May 4, 2021
    Posts:
    92
    upload_2023-3-6_23-53-24.png upload_2023-3-6_23-53-43.png

    I'm a little confused.
     
  2. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,963
    It's very simple. First, enable the MeshRenderer component so you can see it.

    In the default, scene, this is how it looks like:
    upload_2023-3-6_22-4-54.png
    The white plane is the terrain. Since camera look downward, the plane will appear on the camera. So the raycast can detects it.

    When you set the camera angle to 0, 0, 0. This is how it looks like:
    upload_2023-3-6_22-3-24.png
    As you can see in the preview, the terrain is barely visible on the camera. And since you set the projection to orthographic, it won't be visible at all. What you need to do is rotate the terrain so it faces the camera.
     

    Attached Files:

    darknside likes this.
  3. darknside

    darknside

    Joined:
    May 4, 2021
    Posts:
    92
    upload_2023-3-7_12-35-55.png

    Hi, how can you see that the camera sees the mesh render and it's not like you have in the plane
     
  4. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,963
    I'm not sure if I understand your question. Can you rephrase it?
     
    darknside likes this.
  5. darknside

    darknside

    Joined:
    May 4, 2021
    Posts:
    92
    As you can see the mesh render is displayed correctly in the camera
     
  6. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,963
    In that case, check your object. For the terrain to be detectable by the raycast, it needs a collider and the layer has to be set to 31. You can refer to the 'Terrain' object in the default scene.
     
    darknside likes this.
  7. darknside

    darknside

    Joined:
    May 4, 2021
    Posts:
    92
    I don't understand a little what values you are talking about, please show me in the screenshots, if it's not difficult for you, thank you
     
  8. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,963
  9. darknside

    darknside

    Joined:
    May 4, 2021
    Posts:
    92
  10. darknside

    darknside

    Joined:
    May 4, 2021
    Posts:
    92
    upload_2023-3-23_2-28-30.png

    Hi, can I clear the database somehow? or what happened to her?
     
  11. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,963
    Make sure the TowerList in your Tower_DB is in order. That you have a Tower_DB in Resources folder. There's a list on it and there's no empty element.

    upload_2023-3-23_12-16-21.png
     
    darknside likes this.
  12. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,963
  13. toddkc

    toddkc

    Joined:
    Nov 20, 2016
    Posts:
    207
  14. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,963
    Just fyi, while I code almost all of the game, the multiplayer net code is someone else department entirely. It's a blackbox to me as far as I'm concern. So I'm still very much clueless when it comes to multiplayer networking. Sorry to disappoint.
     
    toddkc likes this.
  15. toddkc

    toddkc

    Joined:
    Nov 20, 2016
    Posts:
    207
    My post was joking, not disappointed at all. Looking forward to playing Axon! I'm sure it'll be great.
     
  16. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,963
    Thank! I'm mostly just disappointed at myself for not having the will power to learn it.
     
    toddkc likes this.
  17. toddkc

    toddkc

    Joined:
    Nov 20, 2016
    Posts:
    207
    I mean...you indirectly taught me C#, so I refuse to believe you couldn't learn it if you wanted to. Unity has lots of great tools for multiplayer: Photon PUN and Fusion, Mirror, FishNet, and many more.
     
  18. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,963
    I know what you mean. It's just something I'm not that interested in.
     
  19. toddkc

    toddkc

    Joined:
    Nov 20, 2016
    Posts:
    207
    Nothin wrong with that. Do what you love.
     
  20. darknside

    darknside

    Joined:
    May 4, 2021
    Posts:
    92
    I still haven't figured out in your asset why I have the parts and so on on half of the screen, but not on the other
    and so I congratulate you on the game
     
  21. darknside

    darknside

    Joined:
    May 4, 2021
    Posts:
    92
    Why don't my French fries come out on the 4th wave? how to do it?
    I need to make the first 4 waves of sugar come out, after the 4th wave sugar came out and immediately after it potatoes came out

    upload_2023-4-11_17-21-17.png
     
  22. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,963
    That's not how this wave generator works. While you have enable french-fries after wave 4, there's only a small chancee that it will spawn. And that chance is diminishing every wave. The problem is your Odds value. The spawn chance of each unit is 100x(odd value/sum of odd value of all the enabled units). So in your case, french-fries spawn chance in first wave is 6/(20+6), second wave - 6/(35+6), third wave 6/(50+6), and so on.

    And I'm not sure you want Sugar to keep spawning after wave-4, but there's no way to make sure french-fries get spawned for certain in wave-4 without disabling Sugar after that.
     
    darknside likes this.
  23. darknside

    darknside

    Joined:
    May 4, 2021
    Posts:
    92
    I want to make waves similar to TD Bloons 6

    On the second wave, red balls come out there and immediately after them blue ones come out and it's all in one wave, on the 3rd wave other enemies are already coming out. can I set it up like this?
     
  24. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,963
    Well what you need to understand that the procedural wave generator uses randomization. So while what you want is possible, there's always going to be some chance involved and you end up getting something else.

    If you want a specific enemies to show up in specific waves, you will have to manually configure the wave composition.
     
    darknside likes this.
  25. darknside

    darknside

    Joined:
    May 4, 2021
    Posts:
    92
    "manually adjust the composition of the waves" - and how to manually adjust? should I write the code myself?
     
  26. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,963
    No. I mean don't use procedural wave generation and use the default editor. You can manually set up what to spawn and when.

    upload_2023-4-12_12-10-16.png
     
    darknside likes this.
  27. darknside

    darknside

    Joined:
    May 4, 2021
    Posts:
    92
    Thanks, cool technology, is it possible to somehow configure them not to follow each other, but someone below, someone in the center, someone above the path?
     
  28. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,963
    You can try play with the dynamic offset value on the path. That will scramble the creep placement for a bit. However by default it's only randomize the position in x and z axis. For your camera angle, you might need to change the code a bit so it works on y-axis as well. You can do that in UnitCreep.cs, Init().
     
    darknside likes this.
  29. darknside

    darknside

    Joined:
    May 4, 2021
    Posts:
    92
    thank you, is it possible to disable the autostart of waves somehow?
     
  30. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,963
    The wave only auto starts if you enable the 'Start On Timer' option on SpawnEditor. If you have it disabled and the game still auto starts, then I'm not sure what happen. You must have done custom modification that causes that.
     
    darknside likes this.
  31. darknside

    darknside

    Joined:
    May 4, 2021
    Posts:
    92
    upload_2023-4-19_0-6-33.png

    I haven't changed the code here, the first wave starts if I press start, the rest turn on themselves, how do I turn it off?
     
  32. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,963
    Change the SpawnCDType to None. I suggest you use the SpawnEditorWindow. You can hover over the option and a tooltip will explain what each option do.

    upload_2023-4-18_23-21-3.png
     
    darknside and Proto-G like this.
  33. darknside

    darknside

    Joined:
    May 4, 2021
    Posts:
    92
    Thank you, but is it possible to make it so that when you kill one enemy, others appear from it?
     
  34. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,963
    Yes. There's a 'SpawnOnDestroyed' option for the creep prefab on the SpawnEditor.
     
    darknside likes this.
  35. danosono

    danosono

    Joined:
    Jan 22, 2019
    Posts:
    45
    Hello Song_Tan!
    I am looking for SpawnManager.OnWaveStart or something.
    I want to start game music when the wave starts.

    I may also want to play some ambiance sounds when there is no wave currently active.

    Thanks!
     
  36. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,963
    You are looking for SpawnManager.SpawnNextWave() for when the wave starts.

    For when a wave end, it's somewhere in SpawnManager.CreepDestroyed(). Look for the debug for wave cleared. You cant miss it.
     
  37. darknside

    darknside

    Joined:
    May 4, 2021
    Posts:
    92
    does your cassette have a reward for winning a level? or do I need to write myself?
     
  38. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,963
    Unfortunately no. The closest thing you have with the default, unmodified framework is the perk point. Anything other than that, you will have to write it yourself.
     
    darknside likes this.
  39. darknside

    darknside

    Joined:
    May 4, 2021
    Posts:
    92
    upload_2023-5-4_1-30-27.png

    Is that what you mean? and where can I configure them to be given at the end of the round, I want to tie the pumping progress in the main menu and buy everything
     
  40. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,963
    Check the RscGainOnWin and PerkRscGainOnWin settings on GameControl. Those are the resource given to the player if they win. If you enable persistent perk progress, then the player can use the resource they gain on winning to unlock more perk.
     
    darknside likes this.
  41. darknside

    darknside

    Joined:
    May 4, 2021
    Posts:
    92
    Hi, can you tell me if your tower and unit editor works on ScriptableObject? I just want to do something similar only for weapons and armor in my other game where should I google to do something similar?
     
  42. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,963
    There's nothing special about the Tower and Creep Editor in TDTK. It's just standard Unity Editor Window. Just search for "unity custom editor window".
     
    darknside likes this.
  43. darknside

    darknside

    Joined:
    May 4, 2021
    Posts:
    92
    and where can I find these scripts and how does it save data?
     
  44. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,963
    You missunderstood. What I meant is they are written using standard scripting API for custom editor window. They are custom scripts written from scratch to edit the items in TDTK. If you want to save your own custom data, you will to write your own custom editor script yourself.
     
  45. danosono

    danosono

    Joined:
    Jan 22, 2019
    Posts:
    45
    Good morning!

    In the TDTK AudioManager, I have separate audio files for Build Start / Build Complete and Upgrade Start / Upgrade Complete but, when a tower is upgraded, the build sounds are played rather than the upgrade sounds.

    upload_2023-5-9_7-50-53.png


    Upgrading as below:


    My versions:


    Any idea why this is happening?

    Thanks!
     
  46. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,963
    It's a bug when you upgrade from one tower prefab to another. I've send you a fix. Please check your inbox.
     
  47. danosono

    danosono

    Joined:
    Jan 22, 2019
    Posts:
    45
    I am subscribing to onLifeChangedE to play an FX with sound when a creep reaches the destination.
    This is working but I wondered if it will also fire if the player gains a life or another situation.
    Is this the right way to go about it?


    private void OnEnable()
    {
    TDTK.TDTK.onLifeChangedE += LifeLost;
    }


    Thanks!
     
  48. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,963
    Yes. But the FX will play anytime the value of life changes, not just when a creep reaches the destination.
     
  49. danosono

    danosono

    Joined:
    Jan 22, 2019
    Posts:
    45
    Just wishlist'ed Axon TD: Uprising!
    Looks a mazing!
     
    thefreik likes this.
  50. danosono

    danosono

    Joined:
    Jan 22, 2019
    Posts:
    45
    What is the way to make the bullet do damage to creeps in its range rather than the tower? Like a rocket would do area damage upon exploding on a creep and do damage to surrounding creeps.

    Anything to do with Damage Type on the Tower Editor?
    upload_2023-5-13_9-49-47.png

    Thanks!