Hello !

I would like to know if its possible to cancel movement or placement after the player accepts it.

For example until before the placement is completely over (all player placed), using the cancel command remove the prefab from the the grid one by one , allowing them to be placed elsewhere.

Also during a player's turn once the movement is finished (it costs 0 action points) and the action(the movement) consumed (but turn still active) if I cancel , bring the player back to the initial location to authorize him to move again while having the "move once" option active. I did a few tries but I can't get the desired effect so I wanted to know if it was at least possible.
  • I don't think canceling during placement to 'unplace' already placed combatants is currently possible.
    I'll look into that.

    As for canceling during an action - that's possible, but maybe a bit complex to set up.
    You need to either handle this in the schematic animating the action (e.g. in the grid move schematic) or via a global machine that's started by the cancel input and cancels an action for a combatant.

    Doing this in the schematic animating the action would e.g. use a Input Key node to check for the input and cancel out of the movement, placing the combatat at the starting cell again (you need to remember that at the start of the schematic and store it into selected data).

    Via a global machine, you can use the Stop Battle Actions node to stop all or a combatant's actions.
    In the schematic animating the action, enable Use End Slots in the Settings node - that'll add additional slots in the node that will be used when the schematic is stopped and at the end of the schematic. Here, you'll do the reset to the original cell via the Stop slot (again, store the initial cell in selected data at the start of the schematic).
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited March 2023
    Hum sounds not so hard ,its close to battle end schematics settings back the player at his spot in a map after the battle^^
    In my case its mostly to cancel the movement so I will try with the schematics for the gridmove ^^

    Thanks for the guidance :)
    Post edited by omeegaa on
  • An option to remove placed combatants when canceling during combatant placement will be in the next update :)
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • So great ,thank you =D
  • edited March 2023
    Ok well I did some tests today, it doesn't work even if according to the description of the nodes I don't think I made a mistake in those.

    I tried several methods to reproduce the solution explained to make the schematics (without the global machine).

    I tried to store my data with 2 nodes:
    -"store combattant cell" and "select grid cells"

    In both cases I tried to put the storage node just after the start of the schematics and just after "check grid path length" (but not at the same time) then at the end of the schematics (last node) a "set" node cell combattant " and a "store combattant cell" node this time configured in type load and using the selected data used in the storage node at the beginning.

    This produces absolutely nothing so I'm attaching pictures of how I filled them in because it makes sense to build it this way but I guess I'm wrong.The point of this schematic is only to see if the combattant go back in his starting cell after the end of the move.
    https://imgur.com/a/r6MEFVf

    For the moment the only method that produces something but not the desired effect is when I use a "select grid cells" node and I configure "store cells" in "path" as on the image .
    But the result is that my player moves backwards but off the map (outside the grid cells) + his real position on the grid is not modified. https://imgur.com/a/zwxTWpM


    I admit that I do not understand why the selected data would not be stored or not used if stored, the methods explained have been used with several different names for the selected data and tested locally + global.

    Post edited by omeegaa on
  • The Store Combatant Cell node will store the cell coordinates and rotation of the combatant on the combatant itself, i.e. remember a cell per combatant. If you use this, use the Store Combatant Cell node to Load the cell data on the combatant itself again (i.e. Machine Object).

    Your Select Grid Cells setup stores the path, but you want the original cell the combatant is on, i.e. either use a battle range template that just uses the origin cell or set up a custom range in the node.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • I will try out the first method later today ^^
    For the select grid cell I tried to use a custom range in a battle range template with 0 at minimum and maximum wich should give the origin cell.
    Is that process correct?
  • Better use a Mask setup with the origin cell selected, I think range 0 will not work, not 100% sure, though.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited March 2023
    Yep I managed to make it work on the first iteration ,now I have to add the cancel input but I think its the easy part.Now I am looking at the schematics and I can't find out a node that can give the move command back(I use 'Only Move Once' and action cost is 0 to move).

    seems that the select grid cell with the custom range(mask) inside in the node is the easiest way ^^ I had to use a set grid path node too to set the new position of the highlighted cell at the end of the turn.I pretty sure its normal because seems logic to me but you didn't talk about so I rather give the info ^^

    canceling placement is sooooo easy now too =) Thanks for this add ,its time saving ;)
    Post edited by omeegaa on
  • Finally managed to fake the movement command back with a start grid move selection.

    Is this schematics seems optimized to you?Couldn't make it work with "input key" node(nothing happened even with 3 node of it at different point) or via the global machine because it triggered the reset at any time in the movement when I wanted it during the grid orientation selection.
    https://imgur.com/a/GIaYAfo
  • omeegaa said: Now I am looking at the schematics and I can't find out a node that can give the move command back(I use 'Only Move Once' and action cost is 0 to move).
    There's no node for that - will look into adding one :)
    omeegaa said: I had to use a set grid path node too to set the new position of the highlighted cell at the end of the turn.
    Ah, yeah - forgot about that. The end of a grid move action will set the combatant on the final cell of the path, so either remove the path or set it to the cell you want.
    omeegaa said: Is this schematics seems optimized to you?
    No idea - you showed a different image :D
    You probably checked for the input key at a specific point, so if it wasn't pressed at e.g. the frame between finishing movement and selecting the next cell, it'll not go off.
    You can e.g. use a Wait For Input node to wait for the duration of the movement instead of having the movement pause the schematic.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • gamingislove said: h, yeah - forgot about that. The end of a grid move action will set the combatant on the final cell of the path, so either remove the path or set it to the cell you want
    Yeah I made it differently ^^


    gamingislove said: No idea - you showed a different image :D
    You probably checked for the input key at a specific point, so if it wasn't pressed at e.g. the frame between finishing movement and selecting the next cell, it'll not go off.
    You can e.g. use a Wait For Input node to wait for the duration of the movement instead of having the movement pause the schematic.
    yeah my bad x) There is the schematics : https://imgur.com/a/gu43oOb
  • Well, with that setup you only allow canceling at the end.
    If you disable waiting in the Change Position node and use a Wait For Input node afterward to wait for the time it would also allow canceling during movement :)
    Otherwise looks ok.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Initialy I wanted to make the cancel possible only during the orientation selection but seems not great or possible,so I changed it for set a wai for input right before the orientation selection but after the movement.
Sign In or Register to comment.