I'm making a game with a grid-based battle system, and working on the initial setup and prototyping. I'm planning on having ways of changing the grid during play, from things like using a key on a door tile to remove it (turning it into a regular passable tile), to a terraformer class with limited ability to change cell types (eg, regular land to a mountain, to make a choke point). How would I set something like that up? I see a Check Grid Cell Type node in the events, but I haven't found anything that would let me set the grid cell type.

Also, if I have a prefab for a combatant class, how might I change the color of a child object on it to indicate what faction it belongs to? Right now I have separate prefabs for player and enemy units, with only the material changed, and separate combatant entries, but it would certainly be more efficient to just change the color depending on faction.

Thanks in advance! I'm really glad that I found this. I've learned some programming over time, but I'm primarily a designer, and it's really a breath of fresh air to have a tool kit like this.
  • Use temporary cell events, but remember that you need to use Store Grid Cells node around the target cell to be able to use Battle Cell Templates. You can add to your ability animation a second event that would spawn prefabs on cells that use the same key as a given temporary cell event.

    In the moving or action costs for a cell have a formula, at the start of formula check for boolean variable (that would be activated by a switch*), if it's false then set costs to some astronomical number, if true then proceed with your formula normally.

    *Or in cases of abilities use object variables on cells and have ability switch object variable on selected keys.
  • Thanks for the help. I hadn't thought of approaching it like that.
  • Yeah, cell types can currently not be changed in a running game. Might be something coming in future updates, though :)

    As for the color changing, that's probably possible via the event system, e.g. having an Autostart event interaction on it to check the combatant's faction and change the color via a fade node. Depending on if your combatants can change factions during gameplay, you can either have it only be used once or in regularly.
    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!
  • Thank you, that was exactly what I needed!
  • Hi, I'm sorry to have to bring this thread up again, but some life stuff stopped me from being able to work on my project for a couple weeks. I'm having some trouble with setting this up still, and I think it deals with Store Grid Cells and found objects. I've looked through the tutorials and other help documents, and I haven't been able to find anything that really explains well enough for me where I'm going wrong.

    Right now I have a door tile with movement cost set at 100, a bool isLocked that starts true, and a movement formula that sets movement cost to 1 if isLocked is false. I have an Unlock Door ability that spawns the prefab of a doorless tile over the door tile, and that part works just fine. But I can't figure out how to "target" the cell in the event system to change isLocked to false. I have a Store Grid Cells node, and I've been experimenting with how to add a temporary cell event to it, but nothing has worked so far. Could I get some more help on how that should look?
  • I assume the isLocked bool is on the cell via object variables?
    If that's the case, you can simply use the Change Game Variables node to change it, using the Object variable origin to access the cell's object variables (if you've already got the cell stored somewhere).
    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!
  • Alright, thank you. I was trying to use a temporary cell event to change the variable and for whatever reason couldn't get it to work, but directly changing the object variable in the ability did work, so I'll just stick with that.
  • I don't know why this one thing is causing me so much trouble. My issue now is with the movement formula that I have on the door cell type. It's using the currently selected combatant as the user and target of the formula, so it isn't actually checking the object variable isLocked on the cell. Does the move cost pass the cell into the formula when it checks the formula value? How do I get it to check something other than the combatants?
  • Hm, no, the cell isn't actually available in the formulas - I'll look into it for 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!
  • Thank you! I'll just get back to working on other parts of the project, and come back to this later.
  • Will be in the next update, both move cost and action cost using formulas will have access to the cell using (local) selected data via the key action.
    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!
Sign In or Register to comment.