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.
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.
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.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
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?
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).
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!