Search Unity

TurnBased-Toolkit (TBTK)

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

  1. JessieK

    JessieK

    Joined:
    Feb 4, 2014
    Posts:
    148
    Hey I have owned this kit for a while and its awesome.
    Quick question though, is there a way to either include this in the next update or for me to set up, a way to if you unlock a certain perk in the tech tree that it unlocks a new unit you can add to the party in the campaign mode?
     
  2. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Yes, there's a global flanking bonus modifier that applies to all unit and each unit has it's own modifier on top of that. What you can do is disable the global modifier (by setting it to 0) and just use the individual modifier.

    Absolutely. The only problem as far as I can see is that generating the whole grid may cause a slight dip in framerate as it involve instantiating lots of tile prefab.

    I could add that but I dont really see the point. The thing is unless you are using the default example mini campaign a it's, it wont work. And honestly, I dont expect anyone to use the default example as it's. See the starting unit selection in the campaign mode is assign in Campaign. Which is meant to be an example, not really a base component of TBTK. To do what you suggest, the code would need to access that directly. In other word, the code would need to acess user's custom campaign code. Which is simply not possible. I would recommend you to do your own customization to the perk's code. You can create a new type for the perk, and execute the your own custom code for the new type in PerkManager._PurchasePerk()
     
    Last edited: Dec 5, 2014
  3. JessieK

    JessieK

    Joined:
    Feb 4, 2014
    Posts:
    148
    It's just I wanted to use that sort of system in my game, the buying perks to unlock more perks as you go, I could lift it from the example now and put it in to my game, but I wanted to know if I could add "perk = get a new unit" in, or better yet if you get this perk, change a unit to be a new prefab. Stuff like that.
     
  4. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    To clarify, unlocking a new unit using perk is not supported. So is changing unit prefab. But you can always modify the code to add the functionality. For what you need, it's not really that difficult, assume you are can read the existing code and understand it. Of course, I could point you in the right direction if you are struggling.
     
  5. JessieK

    JessieK

    Joined:
    Feb 4, 2014
    Posts:
    148
    Hey new question, I am trying to use the "spawn unit" effect you can give abilities to spawn a new unit, the unit works fine if I spawn it in normally, but if I use the ability with "spawn unit" it just throws down the model but it is not acting like a unit

    I get this error:

    NullReferenceException: Object reference not set to an instance of an object
    TBTK.Unit.SetNewTile (TBTK.Tile targetTile) (at Assets/TBTK/Scripts/Unit.cs:566)
    TBTK.AbilityManagerUnit+<_ApplyAbilityEffect>c__Iterator6.MoveNext () (at Assets/TBTK/Scripts/AbilityManagerUnit.cs:163)
    UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
    TBTK.AbilityManagerUnit:ApplyAbilityEffect(Unit, Tile, UnitAbility) (at Assets/TBTK/Scripts/AbilityManagerUnit.cs:101)
    TBTK.Unit:AbilityShootObjectHit(Int32) (at Assets/TBTK/Scripts/Unit.cs:560)
    TBTK.Unit:AbilityTargetSelected(Tile) (at Assets/TBTK/Scripts/Unit.cs:551)
    TBTK.GridManager:TargetModeCallBack(Tile) (at Assets/TBTK/Scripts/GridManager.cs:485)
    TBTK.GridManager:targetModeTargetSelected(Tile) (at Assets/TBTK/Scripts/GridManager.cs:480)
    TBTK.GridManager:_OnTileCursorDown(Tile) (at Assets/TBTK/Scripts/GridManager.cs:323)
    TBTK.GridManager:Update() (at Assets/TBTK/Scripts/GridManager.cs:293)

    I have tried my other working units too and they all get this error if I try to spawn them with this ability. I am not sure what I am doing wrong could I get a hand?
    Here is how the ability in question is set up: http://i.imgur.com/HBVL3Mj.png
    I have also set the debuff to 0 and gotten rid of any effects on the spell and this is still the case.
     
  6. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Very sorry for the slow respond. I'm currently away from home and thus doesn't have access to reliable internet connection. I'm hereby apologise in advance for any slow respond. Normal service will be resume by this weekend.

    What you are experiencing is probably a bug. I'll try to look into it as soon as I can. Very sorry for the inconvenience.
     
  7. spuentesp

    spuentesp

    Joined:
    Jun 18, 2014
    Posts:
    3
    Hello:

    i just bought your asset and is awesome. i do have som questions, though.

    im doing a game wich, essentialy, uses stats (strenght, stamina, quickness,etc) to calculate attack, defense, dodge values from those base stats. as far as i've seen, there is a file called TBTK_Class_UnitStat where i thought i could add these stats to the units. However, i'm not sure wich files i should edit to see these new stats in the editor, and to modify the attack and defense mechanics to calculate values from these stats.

    if you could point me into the files i need to edit, it would be great. Thanks!
     
  8. eridani

    eridani

    Joined:
    Aug 30, 2012
    Posts:
    655
    You have an X-com based example... is it possible to easily modify this asset to make an actual X-com style game with humanoids running around and shooting rifles and pistols? How difficult would that be? Thank you
     
  9. JessieK

    JessieK

    Joined:
    Feb 4, 2014
    Posts:
    148
    I own the kit and you can easily set up animation to your human models to make them run and shoot just like in an xcom game just use each model that has the different weapon and set them up as different "units" and you could have each weapon more or less likely to hit the target.
     
    Last edited: Dec 10, 2014
    eridani likes this.
  10. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    @spuentesp, The script you need to look into is actually TBTK_Class_AttackInstance.cs. There, in the function Process() and CalculateChance(), you will see all the logic calculation of an attack. Which stat is used for what and how it's used and so on. From there on, you can look further into Unit.cs, into each individual stats retrieval function (ie. GetDamageMin(), GetCritChance()), where each stats of the unit is retrieved from. And so on so forth. Be warned though It can gets a bit tricky when you start getting into how the perks modify each of the stats. :)


    @eridani, It's a very subjective question you are asking. How close to X-Com style you are referring to? Exact clone, that would require a lot of work. But just mechanically similar, then it's relatively easy. The tricky bit is always is visual and asthethic. In X-Com, the soldier will lean on the cover, face the appropriate direction and peek out and shoot, the bullet trails will missed if the shot missed. All that has to be coded to a very specific model and animations set, which is of course, not supported by default in TBTK. But if you just want the soldier to stand and face the right direction and fire, then you dont even need to do any modification. you can put in humanoid model and custom animation with relative ease. Of course there are some technical difficulties as well if you are going for an exact clone. For instance, in X-Com, there are multi-level grid, stacking on top of each other which is not supported by TBTK. I imagine it won't be a straight-forward modification to do.

    Honestly, what you see in the demo scene (the one trying to emulate X-Com gameplay) is as close as you are going to get. Obviously there are small tweaks that you can still do, but for the most part you will need to modify the base code for anything extra. I will say that imo the code are fairly well structured and fairly well commented in the key areas. If you are comfortable with coding, you should have a pretty good idea of what you are getting into. If not, then chance are it's going to be a long ride. hope that answer your question.


    @JessieK, thanks a lot for your input and vote of confidence! :)
     
  11. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    @JessieK, I found the root to the error you are experiencing with the unit-ability for spawning a new unit. I'll reupload a fixed version shortly, after I've done with some other tweaks and bug fixes. But for now you can replace line 566 of Unit.cs to if(tile!=null) tile.unit=null; to fix the error.
     
  12. eridani

    eridani

    Joined:
    Aug 30, 2012
    Posts:
    655
    This was basically my question. Thank you very much!
     
  13. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    Hi songtan, I think I found another few bugs in the earlier version I'm used. In AnimationTB, I think you have an unnecessary -1 on the random.range() and as such, you are never playing the full animations in the array:

    For example, in the following:

    publicbool PlayHit(){
    if(hitAniBody!=null&& hitAniClip!=null&& hitAniClip.Length>0){
    hitAnimation.CrossFade(hitAniClip[Random.Range(0, hitAniClip.Length-1)].name);
    returntrue;
    }
    returnfalse;
    }

    You don't need the Length-1 ... but instead should just be .Length. That's because Random(x,y) never returns y but always y - 1. You may have fixed this or totally reworked this script in the later versions ... I'm just letting you know in case this is still the case.
     
    Thoreandon and drewradley like this.
  14. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Again you are right. I wont be upload the earlier version again, but I'll make the correction anyway for anyone who are interested in keep using it. Thanks for letting me know.
     
  15. spuentesp

    spuentesp

    Joined:
    Jun 18, 2014
    Posts:
    3
    Thank you, @songtan . I'll look into it. Just for clarifying: creating the fields will NOT show them automatically in the unit inspector, right? if so, i suppose i'll have to edit it manually. (i'm interested in doing this for a friend, who is testing balance stuff but he doesn't know a thing about programming)

    Your work is great man, thanks!
     
  16. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    No problem ... if it's only in the old version, I wouldn't worry about it.

    Regarding animations, does the new version use Mechanim?
     
  17. JessieK

    JessieK

    Joined:
    Feb 4, 2014
    Posts:
    148
    Awesome! Thanks very much I will do this when I get home later.
    Tested it runs fine now thanks!

    Also a new question, why can I not have the health and AP value as different numbers? they change together.
    Plus is there something wrong with the grid editor right now? I am adding in obstacles running the game and they vanish, there are no errors being displayed the grins just...not changing for some reason.
    (I should add I am using a hex grid not a square one.)
    Okay...New edit, turns out the AP might not be setting right at all, it appears that changing the AP in the editor doesn't change the units AP at all, I have moves that cost 30 AP and a max AP of 100 with a regen of 100 and that unit can never use they move.
     
    Last edited: Dec 12, 2014
  18. Crival

    Crival

    Joined:
    Sep 3, 2014
    Posts:
    21
    Hi songtan!

    I have a question with your TBTK v1.7... It seems that the Win Point Reward isn't working...
    I wanted to set my battle with an objective where the player can win the battle instantly when he killed the Boss...
     
  19. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    @spuentesp, if you are refering to the UnitEditor, no. In term of Inspector, if the script component doesnt have a custom editor, any public field will show up in the Inspector. Most of the component in TBTK has a custom editor but Unit being one of the few exceptions. To make any field shows up in the custom editor, you will have to edit the editor script.

    @Rajmahal, yes mecanim is supported in the new TBTK2.

    @JessieK, the HP and AP setting is a bug. I'll fix that. The disappearing obstacles are probably due to you having the GenerateGridOnStart flag checked on GameControl.

    @Crival, About the winPointReward, I've just tried it on my end. Seems fine. Can you show me your code just to be sure. Specifically I need to look at the whole function BattleEnded() of GameControlTB.cs. Now to the other issue, to let the player win as soon as he kill the boss. First you need to set a condition where boss unit can be identified. For instance, create a boolean flag on the UnitTB.cs itself. You can then check for that condition in Unit.cs, in function Destroyed(), which is called when the unit is destroyed. Once you can confirm that the boss unit is killed, you can simply call GameControlTB.BattleEnded(), passing the player's FactionID.
     
  20. Crival

    Crival

    Joined:
    Sep 3, 2014
    Posts:
    21
    @songtan: eeeerrrr.... I don't see any Unit.cs file in your asset although I found the Destroyed() function in UnitTB.cs...

    Heres your code on BattleEnded() function:

    public static void BattleEnded(int vicFactionID){
    battleEnded=true;

    if(instance.playerFactionID.Contains(vicFactionID)){
    //if(vicFactionID==GetPlayerFactionID()){
    GainPoint(instance.winPointReward);

    //if using persistent data, save the point gain in this level
    if(instance.loadMode==_LoadMode.UsePersistantData){
    //instance.pointGain+=instance.winPointReward;

    GlobalStatsTB.GainPlayerPoint(instance.pointGain);
    }
    }

    if(onBattleEndE!=null) onBattleEndE(vicFactionID);
    }
     
    Last edited: Dec 13, 2014
  21. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    Is there an option for using either legacy or mechanism characters or does it have to be one or the other?
     
  22. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    @Crival, Sorry, I did meant UnitTB.cs, not Unit.cs. The code seems fine. I cant see any reason why it doesn't work. Can you let me know your game setting. What data mode are you using? In what way it doesnt work?

    @Rajmahal, it's strictly mecanim in TBTK2. But it can still play legacy animation clip.
     
  23. spuentesp

    spuentesp

    Joined:
    Jun 18, 2014
    Posts:
    3
    @songtan That's what i was talking about: the unit editor. Thanks!

    Another question! -sorry-.

    I'm doing a simultaneous turn resolution -that is, both players issue orders, and when both turns end, the actions are executed. the player only focus on movement, the shooting part is automatic depending on the "battle stance" given by the player and the enemies in range.-. i know i have to edit the turnControl.cs (in fact im rewriting it as a different file). I do have an idea, based on my knowledge of the java programming language: Edit the methods that control the unit actions -move, attack, etc-, so they return an object that is stored in a list. when every turn ends, the lists are executed.

    Thing is, the only place where i see the turn assignment, is the FactionControl.cs. Wich scripts control the actions? -that is, attack, move, etc-.

    Final question: ¿is there any sort of documentation (besides the code comments) that i can read?

    BTW, the unit editor thing worked great. Thank you so much!
     
  24. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    The code that controls the unit's action are in Unit.cs. Look for Attack() and Move(). Unfortunately there are no other form of documentation apart from the commenting within the script itself. I suppose you can read the pdf documentation as well. That should give you some idea about what component does what.
     
  25. Windfeld1980

    Windfeld1980

    Joined:
    Apr 28, 2013
    Posts:
    5
    Hey Songtan!

    Great work - I even noticed the diagonal thing got added! Great work, thanks!

    Quick question ... and if the answer is super obvious, I'll delete this question :p

    Q: I've not really used that much mecanim before, but I've (imported) a mecanim rig, tested the anims through the animator controller ... but it seems the animations are not playing when added to the unit editor. I've tried my limited knowledge of most possible combination without any luck ...

    Is there something magical that I might have overlooked?

    Cheers, and great work again!
    D

    PS: None of the tutorial units have animations, which removes any comparison. (The bird-mech could have some wing flapping, if you wanted a comparison unit for people who wanted to use mecanim).
     
  26. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    I'm aware that none of the prefab unit has any animation. My apologies for lack of examples. I'll try to remedy that in the future. On UnitEditor, it's pretty easy to setup the animation, simply select the child object which contain the animator component and then assign the relevant animation. But before that, there's a step that you need to do, that is assign "UnitAnimator" (located in 'TBTK/Animation/UnitAnimator') as the controller for the Animator component of the unit.

    As for why, the UnitAnimator controller respond to specific parameters to play each animation. These parameters are the exact parameters used by UnitAnimation.cs to trigger the animation. Without these combination, none of the trigger sent by UnitAnimation would work so the animations will not be played.

    Hope this make sense.
     
  27. Regalado

    Regalado

    Joined:
    Dec 14, 2014
    Posts:
    3
    Hi! I have a error with your asset and I don't understand what it means since I'm new to C#...

    Here's the error:

    Assets/TBTK/TBTK (Base)/Scripts/C#/Rotate.cs(4,14): error CS0101: The namespace `global::' already contains a definition for `Rotate'


    Hope you can help me... THanks!
     
  28. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Sounds like you have 2 scripts name Rotate in your project. You will need to rename or remove one of them. Did you import TBTK to a project with existing files or you have import some other package on top of TBTK?
     
  29. Regalado

    Regalado

    Joined:
    Dec 14, 2014
    Posts:
    3

    Got it! It seems there's another Scripts folder outside of TBTK(Base) folder... Awesome work! Keep it up!
     
  30. Regalado

    Regalado

    Joined:
    Dec 14, 2014
    Posts:
    3
    By the way songtan... Does your asset also works with the Free Version of Unity 3d?
     
  31. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Of course. I'm using the free version myself.
     
  32. Windfeld1980

    Windfeld1980

    Joined:
    Apr 28, 2013
    Posts:
    5
    Yup, I was missing the UnitAnimator ... thanks! :)
     
  33. Rajmahal

    Rajmahal

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

    I'm running into an issue when testing my game on iOS devices. For some reason, I'm finding that on some levels, the input to the player's characters aren't being recognized. I noticed in if statement on GameControlTB:

    #if UNITY_IPHONE || UNITY_ANDROID || UNITY_WP8
    if(Input.touchCount==1){
    Touch touch=Input.touches[0];
    //if(touch.phase == TouchPhase.Ended){
    if(touch.phase == TouchPhase.Began){
    if(!IsCursorOnUI(Input.mousePosition)){
    ....

    I can't tell where touch.phase is set to TouchPhase.Began. Doing a search for those words doesn't show anything. Can you let me know where touch.phase is set to TouchPhase.Began?
     
  34. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    Actually I figured out where touch.phase is set. However, I'm not sure how to debug the issue I'm facing on iOS. For some reason, levels will load and it just won't recognize the touch input on the player characters. The GUI touch inputs will work fine but not the player character touch inputs. I'm going to connect my debugger and run in debug to see if I can get some clarity on what's causing it. Has anyone had this issue on iOS devices in their version? I'm not sure if it's something I've done or if it's in the original code. :(
     
  35. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    It works fine when I tested the touch input code on my Android device some time ago. It should works the same way on iOS device as far as I can tell. Have you change the code in anyway? At any rate, I'm afraid you will have to run a line by line debug to find out what exactly went wrong.

    I've noticed one bug, instead of if(!IsCursorOnUI(Input.mousePosition)){ it should have been if(!IsCursorOnUI(touch.position)){ but I doubt that is the problem why the input are not recognized.
     
  36. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    Thanks ... I'll try that change. It works fine on my Android devices ... seems to only occur on iOS devices. :confused:
     
  37. shubhank008

    shubhank008

    Joined:
    Apr 3, 2014
    Posts:
    107
    Is it possible to use this toolkit for a 2D game ?
    I am trying to create a grid-turn based 2D game, much like this in term of battles
     
  38. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    It's possible. However by default you are pretty much restricted to a top down view. If you want a isometric camera angle using 2D asset, you will need to add some customization of your own to handle the sprite animation.
     
  39. Rajmahal

    Rajmahal

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

    I'm just starting to play around with perks. I'd always ignored them up until now. Quick question for you ... I noticed that there is a variable that determines whether or not the PerkManager is destroyed on load or not. What's the rationale for this? Why would you want the Perkmanager to persist from turn to turn? I'm thinking I'll just store a certain number of points for the player in a playerpref and then they can use those each battle on perks if they want to or not. Is that basically how Perks are meant to be used?
     
  40. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    The perk system can operate in 2 ways. The first one is a self contained system within a single scene. All progress is lost upon the next scene. In this mode, the PerkManager instance acts like any other component, it's destroyed when another scene is loaded.

    The alternative mode, the progress will persists across the difference scene. In this mode, the first PerkManager instance loaded in the game will not be destoyed. Any subsequent PerkManager instance in any other loaded scene will be destroyed.

    Finally, a PerkManager instance has to exist in any given TBTK scene. The way it works is it stored all the perk unlocked and the associated modifiers. These modifiers will be retieved and used in calculation in runtime. This way you can unlock perks in the middle of the game. And unit added to the game later on will still gets the modifier from the perks if there's any.

    For your application, you can use the first mode where the progress does not persists. Just check the "Single Level Only" flag in the PerkManager. You can modify the perk currency directly as the points for perks.
     
  41. DonSonz

    DonSonz

    Joined:
    Aug 19, 2013
    Posts:
    16
    hi songtan

    Are there improvements on the gridsize in version 2.0?
    If there is, how big can the gridsize be now?

    I do really struggle with the gridsize in version 1.6.
     
  42. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    You will be pleased to know that the limitation on the size of the grid has been improved by quite a margin. I've tested something like 100x100 without any issue on my end. However I do recommend you to excercise caution when pushing the boundary. :)
     
  43. JessieK

    JessieK

    Joined:
    Feb 4, 2014
    Posts:
    148
    Sorry to post once more, but you said you can play legacy animation clips but I cannot for the life of me get any to work, I set up my unit for animation attached all the animations I wanted and it just won't play, the unit is jut stuck there, some models I can just change them to generic and set them up from there but most have the animations broken down so I cannot use them. Am I doing something wrong or are all of the models I have just no longer supported?

    This is how the animations are set up:

    http://i.imgur.com/LgHgUrV.png

    This is how the unit is set up:

    http://i.imgur.com/otSrwAn.png

    No errors.
     
    Last edited: Dec 21, 2014
  44. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    I'm not sure if you are using Animation or Animator component on the AnimationObject. Although support legacy animation is supported, you will have to use the animator component of the mecanim system to get it to work with the scripts. Simply add an animator component to the AnimationObject, and assign "UnitAnimator" (located in 'TBTK/Animation/UnitAnimator') as the controller for the Animator component of the unit.

    Hope this helps.
     
  45. JessieK

    JessieK

    Joined:
    Feb 4, 2014
    Posts:
    148
    I have done that (I am using animation for the animation objects)
    Shown here: http://i.imgur.com/jvpPgb1.png

    Should I be setting these all to generic and putting the avatars in accordingly? Because it's still not working.
     
  46. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    What is the Animation Type in your import Settings. For my test model, I tried both legacy and mecanim, they both work. Try set yours to mecanim. And I would remove the Animation component now that you have the Animator component on the prefab.

    Honestly, it's very tricky trying to make sense of the setting your are using from the image. If you dont mind, please send me the model (without texture). I'll try to make it work and let you know the setting to use.
     
  47. JessieK

    JessieK

    Joined:
    Feb 4, 2014
    Posts:
    148
    Setting them to generic and assigning the avatar seems to have done the trick its just a long process, it was also set to legacy, its now set to generic.
    Thanks for the help by the way!
     
  48. JessieK

    JessieK

    Joined:
    Feb 4, 2014
    Posts:
    148
    Sorry to double post and keep asking questions, but how would I go about setting a unique animation to an ability?
    Also it appears that the "get hit" animation doesn't work for any model I use, even if I use an animation I know works any reason for this?
    One last thing, does anyone know how I would go about keeping the UnitInfoPanel on screen and off in the corner just when I select a unit, like in games such as Civ 5? If anyone could point me in the right direction of how to do this I would be very grateful
     
    Last edited: Dec 23, 2014
  49. Thoreandon

    Thoreandon

    Joined:
    Aug 21, 2014
    Posts:
    37
    Hi Songtan, i have a question aout GridManager.IsInLOS.
    I simply put a Full Wallobstacle between player and enemy units. If i call the function, it returns true, even if it recognizes the wall in between and block1 is set to false. block2 and block3 are true.
    Why is this ?
    For me, it is not in LOS if there is a wall in between.
    It seems to me that this function also checks tiles left and right of the walltile and if its not blocked too, its in the LOS.
     
    Last edited: Dec 22, 2014
  50. Thoreandon

    Thoreandon

    Joined:
    Aug 21, 2014
    Posts:
    37
    One more:
    When Unit A has a ranged weapon and an enemy unit is behind a wall, i can still shoot at it ?!?