Announcement

Collapse
No announcement yet.

[SUPPORT] Advanced Turn Based Tile Toolkit

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • replied
    Hi Monokkel,

    Thank you for that explanation it was very clear and through some more testing I'm now trying to figure out where to properly place these IsValid nodes as I've place them at the points in the ability itself when its calling for a grid unit reference.

    Leave a comment:


  • replied
    Thanks that worked perfectly!

    Is there a place that a unit / tile can store how many turns its been alive? I've had a look and I can't seem to find anything. I'd like to be able to destroy units / runtime added tiles after a set number of turns. I've made a status condition that works for Units but not for tiles. Also a I mentioned previously this Activate on turn start seems to be the faction turn start, is there a way that it can run on the individual units turn start?

    thanks in advance

    Leave a comment:


  • replied
    Originally posted by SSL_Dev View Post
    Hi I'm having trouble spawning units at runtime.
    I've searched through the support thread and tried implementing the different fixes but I've had no luck so far.

    I have an ability that uses Spawn Actor to create a Adv_Heavy unit at the correct grid tile, the constructor seems to work and it gets placed in the turn order / initiative. When it comes around to their turn the Unit doesn't have any abilities and cannot move or act. I've checked the starting abilities and it has Sprint, Laser, Grenade etc in the array. I am also unable to end the turn once it becomes their turn.

    --

    Also I noticed that Status Effects can have run at turn end / start, is there anyway of having them activate on the start / end of a units turn, not at faction turn?

    Thanks in advance.
    Hey, I've looked into this now. Seems like a combination of two issues. The first is that SetupUnitAfterAssignedOwner needs to be called during HandleUnitSpawning, like so:



    The second issue is a bit more tricky, though. The issue is that UnrealEngine requires a delay of one tick (possibly more in multiplayer) to access a freshly spawned actor. This causes issues where the toolkit spawns new abilities during runtime, but fails to add them to the appropriate arrays, since the references do not yet exist. This makes spawning units during runtime for units with fresh, unused ability classes not work properly. I will try to find a proper fix for this in the next update. Until then, here is a hack that works well:

    In BP_PlayerController_ATBTT create an array of BP_AbilityBase classes. In its default values include all abilities that can possibly be used in your game. At BeginPlay for the player controller loop through this array and call GetAbilityOrAddIfMissing for each of them. This will make all these abilities available when newly spawned units are looking for them:

    Leave a comment:


  • replied
    Originally posted by AntonPil View Post
    Hi, Knutt,
    Firslty, seems like a super cool pack you've created and a good proper support thread
    Okay, super newbie question here.
    I just started out with this and are following your tutorial "UE4 - ATBTT - The Action System - 3/3"
    Everything works as expected up till 15 min, the animation part or the teleporting just isn't happening, not even the one where the unit is clipping with the tile.

    From my own debugging I'd guess it's somewhat related to Queue Action, since if the Queue Type is set to "Immediate", the pawn actually does teleport, but before starting to move.
    I've now spent +3 hours on a 15 min tutorial and are feeling really stupid, is there any chance you could help me out and tell me what's up?

    Click image for larger version Name:	Tile.png Views:	0 Size:	153.6 KB ID:	1707513
    Ok, I've looked into this in depth now. This is caused as a consequent of my refactoring, so you did everything correctly. It is the tutorial that is outdated. The reason for what you're seeing is that the Move action is now queued after SimulateMove, while before it was queued before. As a result, if you queue the teleport action during simulate move it will be animated first, followed by the animated movement. If you have not completed the entire tutorial and added explosions, delays etc. it will seemingly not happen at all, since the unit is moved during a single tick and then immediately moved back to where it is at the start of the move animation (which is the next queued action).

    So in newer versions you will have to do things a bit differently. I have since added more options to the QueueAction macro. Instead of a boolean checkbox for immediate or not, you can now select Queued, Immediate or Interrupt. The first two are the same as with immediate checked and unchecked before. The third one enables you to add a new action to an ongoing queue that is currently being animated. This can be utilized in the teleportation example.

    You can use the following code in BP_Teleporter to achieve the same effect as the tutorial using an action set to interrupt. In this teleporter we bind a new event. This time to the animate version of the dispatcher run at the end of a unit's movement. Then, when the unit has actually moved to the teleporter during animation we queue a teleport action set to interrupt, which should animate immediately after the move animation is done.

    You can see a similar setup in the spike traps in Maps/Experimental/InterruptAction. If you have a game where you expect a lot of interrupted actions I recommend looking at the SplitAnimations map in the same folder, which includes a unit that splits its movement into multiple actions, making it much easier to insert actions when units enter particular tiles. The example map includes a teleporter and a ladder.

    Leave a comment:


  • replied
    Terribly sorry for the late reply, everyone. Had some sudden things in my life that took precedent, but it is back to normal now.

    Originally posted by AntonPil View Post
    Hi, Knutt,
    Firslty, seems like a super cool pack you've created and a good proper support thread
    Okay, super newbie question here.
    I just started out with this and are following your tutorial "UE4 - ATBTT - The Action System - 3/3"
    Everything works as expected up till 15 min, the animation part or the teleporting just isn't happening, not even the one where the unit is clipping with the tile.

    From my own debugging I'd guess it's somewhat related to Queue Action, since if the Queue Type is set to "Immediate", the pawn actually does teleport, but before starting to move.
    I've now spent +3 hours on a 15 min tutorial and are feeling really stupid, is there any chance you could help me out and tell me what's up?

    Click image for larger version Name:	Tile.png Views:	0 Size:	153.6 KB ID:	1707513
    Hi Anton, I cannot immediately see what is wrong here. I will have to test it out myself and see. Will try to do so tonight. I have made some changes to parts of the action system since that video, so it might not be you who are doing something wrong, but rather a difference between versions.

    Originally posted by EagleEyeGamma View Post
    Hey Monokkel,

    So i change the damage variable and made a another copy just to make sure it wasn't the blueprint itself and even though damage is calculating the enemy is still there. Does this have to do with the grid reference?
    Could be the reference to the unit which is returning false. You can test this by dragging an isValid node out from the unit and printing it at each point where it is accesed and see if it ever returns false during play. That should help to narrow it down. Were my previous explanations for how and when units are removed from the grid clear to you?

    Originally posted by SSL_Dev View Post
    Hi I'm having trouble spawning units at runtime.
    I've searched through the support thread and tried implementing the different fixes but I've had no luck so far.

    I have an ability that uses Spawn Actor to create a Adv_Heavy unit at the correct grid tile, the constructor seems to work and it gets placed in the turn order / initiative. When it comes around to their turn the Unit doesn't have any abilities and cannot move or act. I've checked the starting abilities and it has Sprint, Laser, Grenade etc in the array. I am also unable to end the turn once it becomes their turn.

    --

    Also I noticed that Status Effects can have run at turn end / start, is there anyway of having them activate on the start / end of a units turn, not at faction turn?

    Thanks in advance.
    Hey SSL_Dev, seems like spawning advanced units at runtime has become a bit more involved following a refactoring. Seems I forgot to test this. I will try to find a solution tonight. The first step should be calling SetupUnitAfterAssignedOwner in the HandleUnitSpawning function in BP_Unit. This works as long as the unit only has abilities that already exist on units that were placed in the viewport beforehand.

    Leave a comment:


  • replied
    Hi I'm having trouble spawning units at runtime.
    I've searched through the support thread and tried implementing the different fixes but I've had no luck so far.

    I have an ability that uses Spawn Actor to create a Adv_Heavy unit at the correct grid tile, the constructor seems to work and it gets placed in the turn order / initiative. When it comes around to their turn the Unit doesn't have any abilities and cannot move or act. I've checked the starting abilities and it has Sprint, Laser, Grenade etc in the array. I am also unable to end the turn once it becomes their turn.

    --

    Also I noticed that Status Effects can have run at turn end / start, is there anyway of having them activate on the start / end of a units turn, not at faction turn?

    Thanks in advance.

    Leave a comment:


  • replied
    Hey Monokkel,

    So i change the damage variable and made a another copy just to make sure it wasn't the blueprint itself and even though damage is calculating the enemy is still there. Does this have to do with the grid reference?

    Leave a comment:


  • replied
    Hi, Knutt,
    Firslty, seems like a super cool pack you've created and a good proper support thread
    Okay, super newbie question here.
    I just started out with this and are following your tutorial "UE4 - ATBTT - The Action System - 3/3"
    Everything works as expected up till 15 min, the animation part or the teleporting just isn't happening, not even the one where the unit is clipping with the tile.

    From my own debugging I'd guess it's somewhat related to Queue Action, since if the Queue Type is set to "Immediate", the pawn actually does teleport, but before starting to move.
    I've now spent +3 hours on a 15 min tutorial and are feeling really stupid, is there any chance you could help me out and tell me what's up?

    Click image for larger version  Name:	Tile.png Views:	0 Size:	153.6 KB ID:	1707513

    Leave a comment:


  • replied
    Originally posted by borrowedLadder View Post
    Hey there, is it possible with this asset to generate at runtime? So if I have something that randomly generates the tiles in different orders at runtime (or players create their own map using tiles at runtime), the toolkit can update the tiles and movement for it?
    Yes, this can be done without much difficulty. The grid is set up when the SetupGridManager event in BP_GridManager is called from BP_ATBTT_State, which normally happens in the first frame after launching.

    You can remove this event call and call it at a later time after you have generated your custom map. Note that you will also want to similarly postpone calling BeginTurnBasedCombat from BP_TurnManager to prevent the game proper from starting (as activated units etc. will assume a grid is present and will throw warnings)

    Leave a comment:


  • replied
    Hey there, is it possible with this asset to generate at runtime? So if I have something that randomly generates the tiles in different orders at runtime (or players create their own map using tiles at runtime), the toolkit can update the tiles and movement for it?

    Leave a comment:


  • replied
    Originally posted by EagleEyeGamma View Post
    Sorry to ask but could you show me where would be a good place to place the take damage I looked at the Execute Ability of the Attack Move and it was in the same place as I had in my own copy, then moved it in the location where i thought you were talking.

    Thanks, EagleEyeGamma.
    In BP_Ability_MoveAttack, the Attack QueueAction is called before TakeDamage, as you can see here:



    Just to make sure you follow the logic: When you run TakeDamage on a Unit, if this causes the unit to be killed, it is removed from GridUnits and initiative. If you then try to access GridUnits' at that unit's index at a later point it will return an empty reference. This is generally a good thing, as it means that unit will not be added as a potential target after it is dead. So if you want to access the unit through GridUnits you need to make sure it is actually there. If not you need to store a separate reference to the unit by getting it at an earlier point or through another method.

    Leave a comment:


  • replied
    Sorry to ask but could you show me where would be a good place to place the take damage I looked at the Execute Ability of the Attack Move and it was in the same place as I had in my own copy, then moved it in the location where i thought you were talking.

    Thanks, EagleEyeGamma.

    Leave a comment:


  • replied
    Originally posted by EagleEyeGamma View Post
    No problem, however i did this and apparently it's still happening here is some screenshots to show what is happening.
    In the first screenshot you are still calling TakeDamage before your queued action

    Leave a comment:


  • replied
    No problem, however i did this and apparently it's still happening here is some screenshots to show what is happening.

    Leave a comment:


  • replied
    Originally posted by EagleEyeGamma View Post
    Here is how the damage is being calculated in the ability.
    Hey, terribly sorry. It seems I missed your message in the midst of all the holiday festivities. I see something here that might be the cause. You are calling TakeDamage before your QueueAction if I'm reading your graph correctly. If TakeDamage leads to a unit being killed, that unit is removed from GridUnits. When you then later try to access that unit from GridUnits as input to your QueueAction, the Find node will return zero. When the ability then later tries to access this unit to animate it taking damage it finds no animation blueprint, leading to an action call without any EndAction.

    So try switching the order for which you call TakeDamage and your QueueAction and see if it helps. Apologies again for my slow response.

    Leave a comment:

Working...
X