Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

TurnBased-Toolkit (TBTK)

Discussion in 'Assets and Asset Store' started by songtan, Aug 11, 2013.

  1. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    Thanks! That does in deed solve it. So this will not be an issue in the next update?
     
  2. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,623
    No, it won't be. You can consider that fixed. :)
     
    drewradley likes this.
  3. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    Oh, hey, I see you addressed this issue earlier. Guess I should dig back through the previous posts to catch up on any other issues.
     
  4. DonJaket

    DonJaket

    Joined:
    Oct 14, 2013
    Posts:
    10
    Hi songtan,

    This pack looks like what I need for a project that I have in mind.
    Could you please send me the documentation so I can have a look before making the purchase?
    My email is donjaket@gmail.com

    Thanks in advance
     
  5. cbell77

    cbell77

    Joined:
    Aug 25, 2013
    Posts:
    28
    I am running into another issue with the in game sfx/music sliders they do not appear to be hooked to anything
     
  6. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,623
    @DonJaket, Sent, many hours ago. :)

    @cbell77, Found the reason. Not sure how this happened but I have accidentally commented out a few line of codes in UIPausMenu.cs, specifically in OnMusicVolumeSlider() and OnSFXVolumeSlider(). Just enable all the code in those two function should fix the issue.
     
  7. cbell77

    cbell77

    Joined:
    Aug 25, 2013
    Posts:
    28
    Found a rather large bug with the perk editor menu for some reason when I started deleting the old perks the window froze up bad I had to click a bunch of different option to finally get it to close but every time I open it it freezes again. The console keeps repeating argument is out of range.

    Edit: re imported just the perkDB prefab works for now wont try to remove the existing ones until its fixed
     
    Last edited: Jul 28, 2015
  8. cbell77

    cbell77

    Joined:
    Aug 25, 2013
    Posts:
    28
    Quick question is there a way to create a unit ability that will counter attack even if counter attack is disabled under game controller?
     
  9. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    Do you have an guess when the next update will be ready? I've got my new project to the point where it's time to really start editing the code and want to have the most up-to-date version I can before doing that. I'd rather wait a few days if there is a chance for an update. Thanks!
     
  10. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    And I just found a bug that when you kill a unit while their information is on the screen, it stays on the screen and there seems to be no way to close it.
     
  11. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,623
    Sorry guys for the slow respond. I missed the notification again.

    @cbell77, have you modify the perkDB prefab in anyway without using the PerkEditor? That is a very error prone way to edit the perks. If the console shows error message during the freezing that can only means that there's something wrong the the perk information the system is trying to read. Which is of course all stored in perkDB prefab.

    As for the counter attack, I take it by game controller you mean GameControl component? The answer is no, the setting of counter attack GameControl acts has the global on/off switch for counter attack of individual unit. You will have to create additional counter attack parameter for that ability that bypass GameControl setting.

    @drewradley, I should be able to do the next update pretty soon. Hopefully within a day or two, after I fixed the bug about unit information.
     
  12. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    Thanks!
     
  13. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,623
    Alright, the latest update is now live on AssetStore!
     
  14. cbell77

    cbell77

    Joined:
    Aug 25, 2013
    Posts:
    28
    I have a question about the last update did you include a fix for the cover icon not displaying next to units health/ap bar when in cover? I have modified some of the code and only imported your UI scripts but did not see a fix for it.

    Also wanted to say thanks for the great kit My game is now on Greenlight at http://steamcommunity.com/sharedfiles/filedetails/?id=493417623.
     
  15. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,623
    Yes, I've included the fix. Basically I added a function, OnUnitSelected() in UIOverlay.cs as a delegate to Unit.onUnitSelectedE. You may need to assign the two full-covered and half-covered sprites to UIObject/MainCanvas/Overlay in case the UI prefab in your scene has lost its prefab connection.

    Congratulation on your game btw. I hope it done well. :)
     
  16. cbell77

    cbell77

    Joined:
    Aug 25, 2013
    Posts:
    28
    I think there is still and issue in there can you send me the uioverlay.cs script just in case its on my end. I made sure the two shield sprites are selected in the overlay inspector. Also I see the that icon cover object is still intact but can not get it to pop up. The shields due pop up during the movement phase when I select a covered position but once I move my unit there the one next to the healthbar is not displayed.
     
  17. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,623
    Sent.

    Just to clarify, those icon are there to show if a potential target is in cover. They are not to indicate if your own unit is in cover. In other word, they should only appear on hostile unit, never on your own unit.
     
  18. cbell77

    cbell77

    Joined:
    Aug 25, 2013
    Posts:
    28
    ah I see for some reason I thought it was for both
     
  19. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,623
    No, the 'in cover' status of each unit is different with respect to different attacker. A unit might be 'in cover' for attackers from one direction but vulnerable from attackers from other direction. Hence the icon display the cover status of potential target to the selected unit.
     
  20. DonJaket

    DonJaket

    Joined:
    Oct 14, 2013
    Posts:
    10
    @songtan Great kit you have here. I'm really happy with what I've seen so far.
    One thing that I need for my game is to add idle animations for units in cover.

    I see this was already mentioned in a previous post, where you said:

    "To check for cover, you can call occupiedTile.GotCover() from the UnitTB instance."

    But I can't seem to call this function.
    I noticed there is a GetCoverRating on Tile.cs, but when I call it with a unit in cover, the result is 0.
    Could you point me in the right direction? How can I know if a unit is in cover?
     
  21. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,623
    Thanks for your compliment. :)

    Not sure where you read that from. I cant seem to find the function GotCover(). Based on the name UnitTB, I guess it's from the version1.x.

    Like I said in the post above your post. You can't tell if a unit is in cover from it's own as the cover are directional. The best way to know if a unit is in cover is calling function CoverSystem.GetCoverType(Tile attackingTile, Tile targetTile). The function will return the type of cover the unit is in.

    But I suppose in your case, you can check coverList of the tile instance, which is a list of Cover class instance. Each instance of the Cover contain the type and the direction of the cover. If the coverList contains nothing, then the tile provides no cover. You can check for all the cover system related definition of class and enum in TBTK_Class.cs, starting from line 144. I hope this is not too confusing.

    p/s: GetCoverRating is used specifically by AI-algorithm to determine if a tile provide enough cover. I don't think it will be any use for you.
     
  22. DonJaket

    DonJaket

    Joined:
    Oct 14, 2013
    Posts:
    10
  23. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    Does this kit include the ability to select a single unit by a tap or mouse-click, and also the ability to drag-select multiple units? And is UI using OnGUI or new 4.6+ uGUI?
     
  24. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,623
    Yes, you select individual unit by mouse-clicking (on pc) or tapping (on touch device) on them. In fact that's the only way to select a unit manually.

    You cannot select multiple units simultaneously. It doesn't make sense to do that anyway due to the mechanic.

    The UI is using uGUI.
     
  25. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    How can one click on a fast moving object? If it is small and fast it is very hard to do. That is another reason every RTS has drag-select.
     
  26. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,623
    I think there has been a confusion here. Are you referring to TowerDefense-ToolKit (TDTK) or TurnBased-ToolKit (TBTK)? This thread is for TBTK. It's turn-based, not RTS by any mean.

    However if you are referring to TDTK, I'm afraid that is not a RTS either, it's tower-defense. It doesn't support selecting target for tower manually and you can't select the creep. So there's really no need for selecting multiple units.

    Believe me, if I'm to make a RTS kit, drag-select multiple units would be one of the first thing I work on. :)
     
  27. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    Ha! Your are right! I am being stupid the last few days. Sorry for confusing you.
     
  28. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,623
    No worries. The blame is on me for the naming scheme I chose.
     
  29. Pedro-Oliveira

    Pedro-Oliveira

    Joined:
    Aug 1, 2013
    Posts:
    25
    How you guys dealt with the tooltip UnitInfoPanel visibility on a mobile device? I mean, no matter where i put the tooltip window my fingers will block it at least partially.Also is a uncorfortable keep holding your finger to make the information appear.

    I had the idea to make a "help/look" mode that after you touch a button, when you touch a unit the Info window would appear on the screen until you close it.But before doing it I figured out that would be better to ask if there is any better way to deal with the above problem.

    Also if it is a good idea, any help about which scripts i should start looking to do it is welcome.
     
  30. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,623
    Tooltip on mobile device is generally a tricky subject. A typical solution is have a extra button to bring up any additional information that would have been shown in a tooltip. For instance, a unit info button for player selected unit. Or when a unit is tapped on, a menu pops up giving the option to just view the unit info or attack.

    But depends on the situation, yours could be a good idea. You can start by looking into GridManager.OnTile(), which is called whenever a tile is touched/clicked on. From there you can check if you are in "help" mode, bring up the information window and terminate the rest of the function.
     
  31. Smazzolus

    Smazzolus

    Joined:
    Sep 21, 2014
    Posts:
    32
    Hi, I'm new! your tbtk is great! I've some questions..
    I have a unit composed of several models and I would like in the game each model occupy a hex. Currently the entire unit occupies only one hex.
    I have the same problem with units that use larger models of a hexagon and select these is complicated because I have to click the only hex occupied and in the case of large models is difficult to find.
    How can I fix?
    Thanks
     
  32. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,623
    Thanks for you purchase and compliment.

    Unfortunately the framework is designed in such a way that a unit only occupy one hex. You can't have units that occupy multiple tiles. Not without some heavy modification anyway to the existing framework anyway. The only easy hack available for this would be the unit doesn't move.

    As for the over-sized unit. The selection is entirely based on the grid. Means you click on the hex the unit occupied to select the unit rather than the unit itself. So as long as the camera angle is not too low and the unit itself has no collider component that would block the grid detection, selecting a unit, even an over-sized one shouldn't be a problem. If anything I think this is more of design issue that you can work around. You can either reduce the size of the unit, or use a on grid cursor indicator that would not be obscured by the unit itself. This is all of course you don't break the rule to try to have the unit occupy several hex.
     
  33. Pedro-Oliveira

    Pedro-Oliveira

    Joined:
    Aug 1, 2013
    Posts:
    25
    @songtan I found a better way to solve the tooltip problem without creating an extra button, I just need to make the unit being deselected[ClearSelectedUnit()] after clicking on an empty hex(outside move range) or outside the grid.The only problem is that I can't find which line of code handle clicks/touches to see if the player clicked on a tile or outside the grid.
    Can you help me? Thx in advance.

    Ps: I solved the problem of the finger blocking the screen, making the tooltip window not closing after you remove it.
     
  34. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,623
    I don't think there's such function readily available. But you can add following function to GridManager. This should allow you to check if the player has click on a walkable tile.
    Code (csharp):
    1.  
    2.     //return true if player has click on a walkable tile, false if otherwise
    3.      public static bool CursorOnWalkable(Vector3 cursorPosition){
    4.        LayerMask mask=1<<LayerManager.GetLayerTile();
    5.        Ray ray = Camera.main.ScreenPointToRay(cursorPosition);
    6.        RaycastHit hit;
    7.        if(Physics.Raycast(ray, out hit, Mathf.Infinity, mask)){
    8.          Tile tile=GetTileOnPos(hit.point);
    9.          if(tile!=null && instance.walkableTileList.Contains(tile)) return true;
    10.        }
    11.        return false;
    12.      }
    13.  
     
  35. srdjanvranjes9

    srdjanvranjes9

    Joined:
    Aug 19, 2015
    Posts:
    1
    Would it be possible to make different types of terrain (tile) like forest, sand, grass (normal), hill etc. that would limit the movement of a unit, and also elevation for example: ocean, sea for warships, submarines, ground terrain (forest, grass, hill...) for ground units or air (not visible) for helicopters and aircraft. Similar to Daisenryaku and Advance Wars series.
     
  36. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,623
    It's possible, but unfortunately not by default. You will need to modify the existing framework.
     
  37. Razzoriel

    Razzoriel

    Joined:
    Jan 12, 2015
    Posts:
    3
    Hi, Songtan. I've purchased your asset, and would like to know how to make the rules go for isometric tiles.
     
  38. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,623
    Thankyou. Can you elaborate what exactly do you mean by isometric tiles? I thought it's just a matter of arrange the camera to the angle you wanted.
     
  39. Razzoriel

    Razzoriel

    Joined:
    Jan 12, 2015
    Posts:
    3
  40. Smazzolus

    Smazzolus

    Joined:
    Sep 21, 2014
    Posts:
    32
    The melee and hybrid units are not more implemented?
     
  41. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,623
    @Razzoriel, I see. There isn't a straight-forward answer to this. The problem is the framework is not written with 2D tiles implementation in mind. You can still in theory get it to work by using some special arrangement between the camera angle and the tile/unit prefab. It's down to how you project isometric sprite and map to the grid in 3D space. It will take some trial and error and possibly some modification to know what works best for you. If you dont mind, you can send me some of the sprite asset so I can try to setup some example. However there's no promise that I will be able to do it.

    @Smazzolus, the range and melee have been consolidate into one single attack type to simplified the system. Melee is now the same as range attack, only that they uses invisible shootObject.
     
  42. Smazzolus

    Smazzolus

    Joined:
    Sep 21, 2014
    Posts:
    32
    Ok. But if i want to make an hybrid unit?
     
  43. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,623
    hm... with separate stats and all? I'm afraid in that case some extension is required. I'll see if I can do that when I have time. However you will have to wait a bit.
     
  44. Smazzolus

    Smazzolus

    Joined:
    Sep 21, 2014
    Posts:
    32
    not a problem. Thanks! Another thing, the Damage armour table looks like working reversed!
     
  45. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,623
    Thanks for letting me know, I'll check.
     
  46. Smazzolus

    Smazzolus

    Joined:
    Sep 21, 2014
    Posts:
    32
    ok! thanks for you attention
     
  47. Razzoriel

    Razzoriel

    Joined:
    Jan 12, 2015
    Posts:
    3
    Ok, thanks man. How would I send you, through PM the download links?
     
  48. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,623
    That would be fine.Or email. Anyway that works really.
     
  49. Smazzolus

    Smazzolus

    Joined:
    Sep 21, 2014
    Posts:
    32
    It would be very handy to have in the unit ability editor also the fields of hit chance and the damage Armor damage table system!
     
  50. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,623
    Very well. I'll see what I can do.
     
unityunity