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.

TopDownShooter-ToolKit

Discussion in 'Assets and Asset Store' started by Song_Tan, Dec 14, 2015.

  1. gamezuv

    gamezuv

    Joined:
    Nov 6, 2013
    Posts:
    82
    Thanks for the info. I will be buying the package soon. Will you be able to help me with this custom hex ui ?
     
  2. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,947
    While I can give you pointer how to work with the existing code when build the new UI, but I'm afraid building the full UI itself is outside the scope of the framework. So please forgive me if my support for the framework doesn't cover that. Beside that is a relatively big task that could easily require hours or days to complete. Please understand that is something I can't help with any compensation.

    We could however discuss the possibility of a paid custom job if you want. Please email me if you are interested in that arrangement.
     
  3. gamezuv

    gamezuv

    Joined:
    Nov 6, 2013
    Posts:
    82
    No problem. All I will need are pointers if I get stuck to guide me and I will be doing all the work.
     
  4. gamingtc

    gamingtc

    Joined:
    Nov 22, 2016
    Posts:
    21
    Do you think it is possible to modify your asset to change the theme to fantasy setting? For example, a mage casts spell, an archer shoots arrow?
     
  5. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,947
    Of course. The asset is just mostly a coding framework. It's designed for you to swap the example asset (the tanks, the projectile, etc.) with anything you want. That means you can use whatever theme you want as long as the mechanic are supported. You don't even need do any modification to the code.
     
  6. gamingtc

    gamingtc

    Joined:
    Nov 22, 2016
    Posts:
    21
    Great! One more question, how is the asset's level management? Is it one scene one level or one scene holding all level object prefabs? I prefer one scene. If not, is it easy to modify it to handle level with one scene?
     
  7. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,947
    The framework is designed for 1 scene for each level. It's still possible to use just 1 scene and then instatiate the a prefab of a full whole level. To do that you will need to make sure some of the static variable are reset properly. It shouldn't be too difficult but it can be a tedious process to get everything right.
     
  8. PeterP-123

    PeterP-123

    Joined:
    Feb 9, 2016
    Posts:
    7
    Hi, can you upload complete demo (all what is in the package) as a .apk file please?
    I'd like to test before purchase.

    Thanks.
     
  9. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,947
  10. gamingtc

    gamingtc

    Joined:
    Nov 22, 2016
    Posts:
    21
    Please send it to me as well. If possible, please send your other packages' apk demos, including Tower Defense, Strategy. Thanks in advance.
     
  11. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,947
  12. ll2178ll

    ll2178ll

    Joined:
    Jan 22, 2015
    Posts:
    1
    Please, me too. I want to play your asset on my mobile. I will buy after playing. ll2178@hanmail.net
     
  13. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,947
  14. shamsfk

    shamsfk

    Joined:
    Nov 21, 2014
    Posts:
    307
    Hi! I have a little trouble. I can't make tanks move using navmesh agent ai. They move very strange like strafing. I need them to avoid obstacles and each other while pursuing player. But they seems to just move as if they were humanoids no matter how I tweak an agent. Am I doing something wrong here?

    I modified TDSTK in a lot ways now, one of them is a height introduction, so terrains, and stuff is used, and there is no known to me (and practical) way to navigate them without navmesh. That is why I'm desperate to make tanks and other vehicles use it.
     
    Last edited: Feb 19, 2017
  15. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,947
    Sorry for the slow respond. I've been traveling for the past 2 days.

    I think I understand the problem. The default code has no avoidance what-so-ever. The unit simply aim at the target and move towards it. So if you are still using that code, your unit will probably just look at the player all the time regardless of where the moving direction. What you ditch the default code, specifically the MoveToPoint() function in UnitAI.cs and replace it with code that use nav-mesh agent exclusively.

    Hope this help.
     
    Last edited: Mar 2, 2017
  16. vertigostudios

    vertigostudios

    Joined:
    Oct 1, 2012
    Posts:
    101
    Hi Songtan, could you please send me a pc webplayer demo of the Arena
     
  17. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,947
    Just sent you the link. :)
     
  18. weavermount

    weavermount

    Joined:
    Aug 19, 2014
    Posts:
    2
    After creating a "Simple Scene" from the TDS-SK menu, I'm having trouble increasing the area the player is allowed to move in. In my UI it's a dark blue rectangle. If I delete "Player_WeaponOnly" object it disappears, but I can't find any object or property that controls it. Any idea where to look?
     
  19. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,947
    If you open the PlayerUnitEditor window, there should be a small expandable setting 'Enable Limit' under 'Movement & Control'. Expand the option will show you a set of value which define the moveable area of the unit. You can also disable the option altogether to remove the constraint.

    Please note that if you only want to edit the player unit in the scene, make sure you have the unit selected in Hierarchy tab. Otherwise you will be editing the prefab, which may or may not be applicable to the unit in the scene.

    Hope this help.
     
  20. spaceJASE

    spaceJASE

    Joined:
    Jul 29, 2014
    Posts:
    5
    Hello songtan!
    I am wondering if you can share/send me the snippet of code you set up for the previous commenter where the player shoots only in direction they are moving. (move & shoot tied together) I am curious how you set that up.

    Also, I am attempting to restrict the turret shoot rotation/angle to 8 directions and *think* I need to access the "AimTurretDPad" in UnitPlayer.cs to get the Vector2 coming in from TDSTouchInput.cs - But I wanted to make sure I'm heading in the right direction... (artist working on code here) Or maybe you know a better/easier way?

    Thanks!
     
  21. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,947
    If I remember correctly. What I've done is simply add a line of code to restrict the turret transform to the parent when the 'ShootAtTravelDirection' option is turn on. If you want, I can send you the whole script. I've got it working, just haven't update it to AssetStore yet. Please send me an email.

    That's one way to do it. You will need to somehow convert the Vector2 input to an 8 direction format. An easier way that allow you to skip the calculation is to manually create 8 button that each pass a different input value.
     
  22. spaceJASE

    spaceJASE

    Joined:
    Jul 29, 2014
    Posts:
    5
    Ah OK, thanks! I'll give it a shot or wait 'til you update.
    I figured out how to get movement & shooting restricted to 8 directions - so I'm content now. :)
    (I round "dir" and "dirHV" to either 1, 0, or -1 and it works!)
    Cheers!
     
  23. Kurando

    Kurando

    Joined:
    Aug 14, 2013
    Posts:
    5
    I opened the arena demo in Unity, but the perk menu is empty. A ContentRect has some NaN values.
    The "skill tree" is only visible, if you switch to the scene from another scene.

    When playing that scene directly, it's empty. So I made a new scene scene and added just a script with:
    Code (CSharp):
    1. void Start () {
    2.     SceneManager.LoadScene ("DemoArena");
    3. }
    With this workaround the skill tree is visible. Is there a reason for this behaviour? Or is it a bug?

    Thanks!

    EDIT: Whenever I open the scene in Unity, it's immediately marked as dirty and the skill tree is not visible. Maybe the UI scaling or something else in this direction is not working correctly.
     

    Attached Files:

    Last edited: May 7, 2017
  24. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,947
    Sorry for the slow respond. I've been away for the past few days.

    Regarding your issue, there seems to be a bug with Unity5.6 regarding ScrollRectView which cause the value of the ContentRect to goes NaN. Please refer to this - https://forum.unity3d.com/threads/h...causing-nan-values-on-content-portion.463951

    You can fixed that by changing the movement type on the scroll view to either Elastic or Unrestricted.
     
  25. Choke-Billy

    Choke-Billy

    Joined:
    May 15, 2017
    Posts:
    1
    I have a problem using the "Alt-Area" in a WaveBased Unitspawn. It seems like the alternative zone is ignored and the subwaves always start at the point "spawn area" of the parent waveobject.

    (The element subWave Area is always zero in the code)
     

    Attached Files:

  26. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,947
    Thanks for pointing this out. I've found some bug in the code. Please send me an email so I can send you a fix. Alternatively you can wait for an update, which probably will take some time.
     
  27. gamingtc

    gamingtc

    Joined:
    Nov 22, 2016
    Posts:
    21
    Can you post the update here first?

    I have 2 questions regarding adding new mobile features. I hope someone can guide me the correct way.
    - How to add touch and drag on screen to move player. It means disabling the joystick. Does hiding the joystick enough?
    - How to implement auto shooting? I added a new script to make the player auto-shoot, but the script doesn't work after player dies once.

    Code (CSharp):
    1. public UnitPlayer player;
    2.  
    3.     // Use this for initialization
    4.     void Start () {
    5.         player = GameControl.GetPlayer();
    6.     }
    7.    
    8.     // Update is called once per frame
    9.     void Update () {
    10.         //reinstate player to avoid player getting destroyed each life
    11.         if(player==null){
    12.             player=GameControl.GetPlayer();
    13.             if(player==null) return;
    14.         }
    15.     }
    16.  
    17.     void FixedUpdate()
    18.     {      
    19.         player.FireWeapon();
    20.     }
     
  28. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,947
    The fix involves several files and I hope you understand I can't possibly post the source file of the framework on a open forum. Beside, it's been two weeks since I fixed the error. I can't quite remember the details so the best thing to do would be include all the script files. All the more reasons why I can't simply post the update here.

    So the touch and drag, does it work like a joystick except it's for the whole screen? Or is it something else? Eiether way, removing the existing joystick will not be enough.

    As for you own auto shooting script. I don't see why it doesn't work. In fact I tried it out on the default new scene and it works just fine. My guess is something else in the scene you are working on broke it.
     
  29. gamingtc

    gamingtc

    Joined:
    Nov 22, 2016
    Posts:
    21
    I understand about the source code.

    Yes, it replaces the joystick. When you on screen you start moving your finger to move the player around.

    It works for me, too. But after the player die once, this script is not called again. I guess there are null object somewhere. I will test again by re-importing the whole kit first.

    I test all in Mobile Vertical Shooter scene.
     
  30. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,947
    A touch and drag control scheme is more or less similar to a joystick input. Except there's no fixed anchor point. With joystick, you detect the finger position with respect to the center of the joystick (the anchor point). Since you have no fixed anchor point for a touch and drag, you create one everytime the finger first touch the screen. That initial touch down position will be used as the anchor point. Once that is established, the rest of the code is similar.

    You haven't attach the auto-shooting script on the player object have you? If you did, it will get destroy along with the player object.
     
  31. gamingtc

    gamingtc

    Joined:
    Nov 22, 2016
    Posts:
    21
    I attached it to the player object. But isn't it re-initialized again when the player object is initialized after dying?
     
  32. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,947
    Not really. The game object itself will get destroyed and a new instance of player game object will be created. Unless you are attaching it to the player prefab itself (which mean it will be recreated again when the prefab is spawned), you script will get destroyed in the process.
     
  33. gamingtc

    gamingtc

    Joined:
    Nov 22, 2016
    Posts:
    21
    I attached the script to Prefab (made changes to gameobject then override prefab) but the same error still occurs. perhaps it is due to all null object? See the log in the 2nd image.

    http://imgur.com/a/rtHIH
     
  34. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,947
    I doubt that. By the way your screen shot doesn't show much. You have to select the 'NullReferenceException' message to show more info about where they originate from.
     
  35. gamingtc

    gamingtc

    Joined:
    Nov 22, 2016
    Posts:
    21
    I figured out the issue. When All Weapon is enabled in Player Unit edit, the autoshooting script will fail.

    I planned to make a space shooter using only 1 scene. The level is endless and it will increase after player defeat all waves in a scene. I see that all waves are built-in. How should I modify to make something like this;
    - Level 1: number of wave: 1, enemy type: 2, enemy HP: 1
    - Level 2: number of wave: 3, enemy type: 2, enemy HP: 2
    - Level 3: number of wave: 3, enemy type: 2, enemy HP: 3
    - ...
    - Level 10: number of wave: 1, enemy type: 5, enemy HP: 3, boss: 1
    - ...

    My though is to grab Spawner object and modify according to current level player is in. Can you show me how to achieve this? I only need basic guidance. Thanks.
     
  36. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,947
    You can check the procedural spawning algorithm that is already in place. Look for GenerateWave() in UnitSpawner.cs. The algorithm sets the value for each spawn parameter based on which wave it's in. You can modify and extend that to include all the variable you need.

    Unfortunately I'm currently out of office so I don't have access to all details. Please give that a go, I'll answer your questions if you have more when I'm back this weekend.
     
  37. gamingtc

    gamingtc

    Joined:
    Nov 22, 2016
    Posts:
    21
    Thanks for yout quick response. I will try figuring out the rest first.
     
  38. gamingtc

    gamingtc

    Joined:
    Nov 22, 2016
    Posts:
    21
    Objective doesn't work on your demo scene of Mobile Side Scroller. I tried all settings but none works.



    Can you check?
     
  39. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,947
    Yes, Thanks for letting me know. There's a small setting error. The ObjectiveTracker hasn't been assigned to the GameControl.

    TDSTK_Objective_Assignment.png
    Hope this help.
     
  40. gamingtc

    gamingtc

    Joined:
    Nov 22, 2016
    Posts:
    21
    I already assigned GameObject before. It didn't work.
     
  41. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,947
    It worked on my end. You must have missed something then. Can you try again? It's not just assigning any game-object. It's assigning the ObjectiveTracker component to the Objective slot in the GameControl component. Only then whatever setting you have in ObjectiveTracker will work.
     
  42. gamingtc

    gamingtc

    Joined:
    Nov 22, 2016
    Posts:
    21
    It works now, strangely. I haven't done anything, just updated to 5.6.3p1 today and it worked. Thanks for your help.
     
  43. Bud-Leiser

    Bud-Leiser

    Joined:
    Aug 21, 2013
    Posts:
    93
    I've been away awhile, glad to see you are still making awesome kits.

    1. When importing your kit Unity said some API were outdated, I clicked update them but I have no idea if this will cause any bugs since this is the first time ive used this kit.
    2. Checkboxes are inverted. Checked is disabled, unchecked is enabled. See attached. Screen Shot 2017-10-19 at 10.57.18 PM.png
     
  44. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,947
    Thankyou.

    The warning messages are harmless. Keep in mind the framework is written for Unity5.0 and up so the code has to support the older version. Rest assure they should work just fine for newer version of Unity. If you have problem with that, just let me know. I'll get it fixed.

    Thanks for letting me know about the check box. I'll get that fixed.
     
  45. Sr-Liermann

    Sr-Liermann

    Joined:
    Jan 7, 2015
    Posts:
    67
    Hello, I have some problems with your kit.
    With custom models, when driving the tank for the map, and turn it for righ or left, the turrent got be wrong.
    See my attached screen.
    On the screen you will can see a "shadow" that was the original location of turrent.
     

    Attached Files:

  46. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,947
    Looks like your turret mesh has been anchored on the wrong pivot. You can try create a empty dummy transform, assigned that as the turret-object. Make sure that object is positioned at the pivot point of your turret mesh then set your turret mesh as the child object. You can refer to the default prefab (Player_Gauntlet for example), see which transform has been assigned as the turret-object and how it rotates.

    If you are still struggling, you can email your prefab to me if you don't mind. I'll fix it up for you. However you will have to wait a bit.
     
  47. Sr-Liermann

    Sr-Liermann

    Joined:
    Jan 7, 2015
    Posts:
    67
    Thankyou for the fast reply, but the problem Isnt with "Aim Turrent" It was exact how you said, the problem was on driving and change direction from veichle, I solved this by comment this line //if(turretObj!=null) turretObj.parent=null;
    on UnitPlayer.cs line 391.

    I would like to improve the movement system, cause this dont have a "reverse march" they only rotate the body 180 dregrees.

    But thankyou! maybe if you can help with a start point I will apreciate.
     
    Last edited: Nov 2, 2017
  48. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,947
    You mean you want to modify the movement system to something like a driving mechanic where you steer the player unit instead of having it move directly to the the input direction? In that case I don't see how current mechanic can be modified to what you want. You will have to replace it entirely. The code for the player unit's movement is in UnitPlayer.cs, Move() (line363). The function parameter direction is taken directly from player input. direction.x is the value from up/down arror. direction.y is the value from left/right arrorw. You will need to remove the existing code (line368 to 387) and replace it with your own code.
     
    Last edited: Nov 2, 2017
  49. Sr-Liermann

    Sr-Liermann

    Joined:
    Jan 7, 2015
    Posts:
    67
    Nice, Thanks! =)
     
    Last edited: Nov 9, 2017
  50. Sr-Liermann

    Sr-Liermann

    Joined:
    Jan 7, 2015
    Posts:
    67
    Hello, How are you?

    I was replaced with realistic physics for tanks the movement system with sucess in the project.
    I removed the lines that you mentioned and it worked.

    But I'm having problems when I move the mouse, some line that I can not identify in UnitPlayer.cs rotates the tank body when I move the mouse to the right or left and this I would like to eliminate.

    Could you tell me which line is responsible for rotating the tank body when we move the mouse to the right or left?
     
    Last edited: Nov 9, 2017