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
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

TurnBased-Toolkit (TBTK)

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

  1. MaestroGames

    MaestroGames

    Joined:
    Jul 5, 2012
    Posts:
    16
    Thanks that did the trick.
     
  2. ponasoft

    ponasoft

    Joined:
    Oct 6, 2013
    Posts:
    42
    Is it possible to make leader board and user register to be able to play in different devices? is there any solution we can use to save progress when a player uninstalls he game or switches the device with current save system? wold you provide any link that i can learn current save system.
     
  3. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,960
    Anything is possible. Question is how. :) Honestly I know nothing about the back-end support (server and data storage) required to run a online leaderboard (if that is what you referring to). I only know how such thing can be accomplish from client side.

    You will need cloud saving for that. And I'm afraid that is another thing I'm not familiar with.

    There's no real save system to speak of unless you are referring to the perk system and the demo campaign. For that I'm using Unity very own PlayerPref. See this link.
     
  4. Rob-161

    Rob-161

    Joined:
    Dec 1, 2016
    Posts:
    20
    Hi there,
    I know this post was made quite a while ago, but was curious if ended up working out a way to create your 'cleave' style attack?
     
  5. Rob-161

    Rob-161

    Joined:
    Dec 1, 2016
    Posts:
    20
    That is exactly what I am trying to do too! Have you had any luck?
     
  6. al_dude

    al_dude

    Joined:
    Jan 6, 2017
    Posts:
    14
    @songtan

    I know it's out of scope of what this framework is supposed to do, so I am not asking you to implement this, but do you think it is possible to add conversation during mid fight in text? Like after certain turn # or approaching certain unit.

    I am guessing it'd need a scene specific C# code?
     
  7. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,960
    Of course it's possible. You can create a system that monitor the turn counter (it's a variable in TurnControl) as the game goes on. And when the counter hit a specific value, you trigger the conversation. It doesn't need to be scene specific. Just a generic code that you can use in every scene.
     
    al_dude likes this.
  8. al_dude

    al_dude

    Joined:
    Jan 6, 2017
    Posts:
    14
    Thanks for the quick reply.

    Wow, thanks. Sounds a lot easier than I thought. Loving the framework so far.

    P.S. Where is turn control?
     
  9. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,960
    I mean the script TurnControl.cs. It doesn't matter anyway. You don't need to access it at all. All you need is this line of code to get the turn count, TurnControl.GetTurnCounter();
     
    al_dude likes this.
  10. al_dude

    al_dude

    Joined:
    Jan 6, 2017
    Posts:
    14
    Hello, I'd like to ask how obstacle manager can be accessed. I can't seem to find it.
     
  11. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,960
    There's no obstacle manager. You simply assign the obstacle prefab you want to use in GridManager.
     
    al_dude likes this.
  12. al_dude

    al_dude

    Joined:
    Jan 6, 2017
    Posts:
    14
    Thanks. I figured it out now.

    And now... my next question. I've added a custom obstacle. It has a collider and has its layer assigned to obstacle layer. It's been added via grid manager and has been placed on a map.
    So far so good.

    Now it does not show the yellow clover mark when I hover my mouse over the obstacle. What am I missing?
     
  13. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,960
    Yellow clover mark? You mean the shield shaped icon that indicates cover? To enable that you will have to enable the cover system for the scene. You can do that in GameControl.
     
  14. al_dude

    al_dude

    Joined:
    Jan 6, 2017
    Posts:
    14
    Hello, yes, the indicator.
    It's enabled. I know that since a wall I placed next to it shows the indicator. The custom obstacle isn't showing the indicator. Could its shape effect it? The custom obstacle is an asteroid.
     
  15. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,960
    The shape or mesh makes no difference. My guess is you didn't assign the obstacle with the appropriate layer. It's 26 or 27 by default depends on what type of cover you want the obstacle to provide. Please refer to the default prefab or documentation.
     
  16. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    Hi Songtan,

    I actually have the same issue where a 3d object that is part of the obstacle obscures the full shield or half shield cover icon in my version. Are you saying that there is code that makes sure the cover icon is always shown above any 3d model that is part of the obstacle or background that might otherwise obscure it? If so, can you let me where in the current version so I can incorporate that code / design in my old version?
     
  17. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,960
    I'm afraid there's none. What we are talking about is specific layer assign to obstacle/wall object so that they can be recognized by the system as cover. The layer also act as an identifier what type of cover (full/half) they provide to adjacent unit.

    To make sure the cover icon is always visible, you will have to use a dedicated camera to render them (by setting the camera to render only cover icon and make sure the draw order is above the default camera). The other alternative would be to use algorithm of some sort to make sure they are not obscured.
     
  18. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    Yep ... understood. I ended up doing that shortly after I asked the question. Works great.
     
  19. al_dude

    al_dude

    Joined:
    Jan 6, 2017
    Posts:
    14
    I am running into a somewhat rare case where AI doesn't end the turn.

    It seems to occur when an AI unit is trapped. It wants to move but it can't and it doesn't end the turn. Have you ever run into a case like this?

    Another cause of this occurrence appears to be lack of AP. When an AI unit runs out of AP and still wants to move but it can't doesn't end the turn.

    This doesn't happen always but does happen from time to time, leaving the game stuck.
     
  20. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,960
    I've recently bump into this and I believe I've got it fixed. But the fix hasn't make it to the asset store yet. If you want please send me an email so I can send you the fix in advance.
     
  21. al_dude

    al_dude

    Joined:
    Jan 6, 2017
    Posts:
    14
    PM sent.
     
  22. al_dude

    al_dude

    Joined:
    Jan 6, 2017
    Posts:
    14
    I haven't run into the bug so far.
    So, looking good.
     
  23. Ankaman

    Ankaman

    Joined:
    Feb 14, 2014
    Posts:
    37
    Someone tried to use unet for multiplayer ?
     
  24. ponasoft

    ponasoft

    Joined:
    Oct 6, 2013
    Posts:
    42
    i am using playfab right now and i will use photon as soon as a make proper demo.
     
  25. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,960
    Just a quick a notice that I'll be going away for a few days and I'm not sure if I'll have internet access. So apologies in advance if I'm a bit slow in responding to your post.
     
  26. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    wahyuway and Kybernesis like this.
  27. michalides

    michalides

    Joined:
    Jan 9, 2017
    Posts:
    15
    Hi,
    I want to ask if this asset is good for game like European war?And is any AI included in this asset?
    Thank You for response :)
     
  28. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,960
    You mean the European war series on Android? I have to say I'm not familiar with the game. What I know is based on the video and the image I see. So with that in mind, my answer is yes or no. TBTK is designed and focus on the battle. While you are covered for that, it wont help at all for anything other than that. And yes AI is included but keep in mind that it's a very basic AI that doesn't use ability.
     
  29. FeedorFeed

    FeedorFeed

    Joined:
    Jan 9, 2014
    Posts:
    35
    How easy would it be to integrate UNET into this toolset?
    How easy is it to add functionality to this toolset?
     
  30. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,960
    I can't comment on the integration of UNET as I'm don't know much about it.

    As for additional function, it varies on a case to case basis depending on what you want to add and how familiar you are with coding and other subject matter. Structure wise, in my opinion and from the feedback I gathered, it's flexible enough for you to modify/add additional function and feature to the framework. But of course that's only true if you have sufficient understanding of coding.
     
  31. michalides

    michalides

    Joined:
    Jan 9, 2017
    Posts:
    15
    Hi,
    Please maximum scale of grid? ?x? hexagons
    Thank You
     
  32. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,960
    There is no hard limit for the grid size. It's only limited by your target platform's hardware capabilities. For a reference on pc, assuming that you are using the 'master' collider type for the grid, 100x100 is highest I ever go for.
     
  33. ponasoft

    ponasoft

    Joined:
    Oct 6, 2013
    Posts:
    42
  34. budicreed

    budicreed

    Joined:
    Dec 10, 2016
    Posts:
    8
    how to fix this ?
     

    Attached Files:

    • 111.jpg
      111.jpg
      File size:
      399.8 KB
      Views:
      707
  35. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,960
    I don't have a solution readily available unfortunately and I don't have access to my work station right now to find out. For the time being, you can simply just delete both the script CombineMesh.cs and CombineMeshUtility.cs, or try to fix the code on the script by referring to this link - http://answers.unity3d.com/questions/943354/how-to-fix-compiler-error-1.html

    Can I know what version of Unity you are using? I'll check it out myself when I have access to my work station next week.
     
  36. budicreed

    budicreed

    Joined:
    Dec 10, 2016
    Posts:
    8
    Im using Unity Personal 5.4.4f1
     
  37. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,960
    @budicreed, I finally have a chance to look at the problem. Turns out the error has been fixed some time ago. Are you using the latest version of TBTK? If you are, you can simply delete the script CombineMeshUtility.cs.
     
  38. x_ming_x

    x_ming_x

    Joined:
    Jan 1, 2013
    Posts:
    46
    Hi Songtan , Ive been working with your kit for a while and im really happy with it but ive recently hit a strange obstacle, im implementing ragdoll physics and have a rig that works perfectly as a prefab but when i spawn it as a unit and apply the same force code the unit will not move any way but vertically, so they stay on the spot / tile, is the unit being held in position somewhere in the tbtk code ?
    many thanks for a great kit
     
  39. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,960
    There's no code that locked the unit in the tile as far as I can remember. The code only placed the unit to the tile at the start of the game and when the unit is moving. Even then it doesn't use or interact with any physics component so your rag-doll would have been keep moving after the position change. From your description it sounds like it could be the constraint on rigidbody component of your ragdoll is been set to restrict movement in x and z axis. It should be quite easy to find out if that's the case by looking at the inspector.
     
  40. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,960

    Attached Files:

    wahyuway and Kybernesis like this.
  41. ponasoft

    ponasoft

    Joined:
    Oct 6, 2013
    Posts:
    42
    its wonderful work and voted for greenlight. looking forward to test it to learn how can we extend this kit for better games.
     
  42. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,960
    Thank you!
     
  43. Wintera

    Wintera

    Joined:
    Mar 15, 2017
    Posts:
    1
    Really loving the look of this tool kit. Noticed that a lot of uses for this have included basic character animation rather than vehicle animations is this something which is supported out the box? if not speaking from the point of a unity familiar games artist how much leg work was required to get character animations working within this package?

    I realise thats a rather vague request but it would help manage my expectations before purchase. Apologies if this has already be answered in the thread. Many thanks in advance.
     
  44. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,960
    No worries, I'm more than happy to answer your question. There is support for unit animation that should work universally for both vehicle or character. You merely need to set it up. There are example prefab and documentation within the package that should give you sufficient information to do that. I can even send you a step by step video if you are still struggling. The only reason why there isn't one shown in the demo is that I don't really have animated character model that fits the purpose. Hope that answer your question.
     
  45. NZNumnum

    NZNumnum

    Joined:
    Mar 18, 2017
    Posts:
    4
    Just downloaded this a few days ago, and i'm loving it!

    Just a couple of quick questions, and my apologies if they have already been answered, but i couldn't find them in this forum post.

    1. Is there a shoot type or a way in the editor to make an ability shoot from above target enemies heads? Like a falling meteor.

    2. When having an AOE ability targeting multiple enemies, is there a way to shoot the "ShootObject" at each enemy, instead of just the 1 "ShootObject" being shot?

    No worries if these don't exist in the editor, i'm happy to tweak the code myself. Pointing to an area in the code where to make these changes would be helpful ;)

    Thanks.
     
  46. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,960
    I'm afraid the answer for both your question is no. However, here's what you can do.

    1. You can use an effect shoot-object with your own custom script on it. In your own script, you can create any visual effect you want, like fire a meteor from above the target. Just make sure you have long enough delay on your effect shoot-object for the visual effect sequence to play out.

    2. You will need to modify AbilityShootRoutine() in Unit.cs. That is where the code execute the 'fire shoot-object sequence'. You can check if the ability has aoe and fire a shoot object to each of the target instead of the one in the center. You will probably need to add a boolean in UnitAbility class to indicate if an ability with aoe should fire to just the intended target tile or all the target unit. You can do that in TBTK_Class_Ability.cs.

    Hope this help.
     
    NZNumnum likes this.
  47. NZNumnum

    NZNumnum

    Joined:
    Mar 18, 2017
    Posts:
    4
    Awesome,

    Thank you very much for the help :)
     
  48. Pedro-Oliveira

    Pedro-Oliveira

    Joined:
    Aug 1, 2013
    Posts:
    25
    Hello again Song. I need help with the following: I want to change the Obstacles so they aren't always visible with fog of war turned on. Make them behave like the walls do in terms of visibility.
    Any advice is welcome.
     
  49. NZNumnum

    NZNumnum

    Joined:
    Mar 18, 2017
    Posts:
    4
    Is anyone else getting the following error spammed in the console, even in a fresh project with just TBTK imported?

    "IsFinite (m_CachedRange.first) && IsFinite (m_CachedRange.second)"
     
  50. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,960
    @Pedro-Oliveira, Sorry for the slow respond. For some reason I never got the notification for your post. Anyway, I think the walls are always visible too when it comes to fog-of-war. To change that, you will first need to adjust the CullingMask on the main camera so that they are not visible. That means you will have to create another new layers for invisible walls and obstacle and add them to the mask. Then you have to assign those layer to the walls and obstacle when they are in fog-of-war. Unfortunately when updating fog-of-war, obstacle and walls are not taken into account, only unit. So you will need to add that too. Finally, when it comes to line-casting for the cover system, you will have to take account of the new invisible layer for the wall and obstacle otherwise they won't be registered. In short, a great deal of work. You will find all the relevant code in Unit.cs (search of keyword 'fog') and TBTK_Class_FogOfWar.cs.

    @NZNumnum, it's probably something to do with some of the imported asset. Unfortunately I can't for the life of me figure out what exactly is it about. However it seems to be harmless so you can safely ignore them. Just a bit of annoyance. Sorry for that.