To make a tech tree, I’m using a 2D bool array by using a custom structure that only contains an array of bool. I then make an array of those array which gives me a 2D array (one array for each branch of the tech tree).
Now, when the player buys an upgrade, I’m turning the bool to true, so that the button can forever be disable. And for some reasons, it’s not working. It only works if I force the default value to true, otherwise, the following print is ALWAYS false, I have no clue why. (I tried clicking the button multiple times). The following code is triggered on button click. The rest of the code is working properly (that is, setting the missile reload time to 2 secs).
If you’re using a struct, you need to set members this way:
Otherwise, you’re just creating copies of the struct at index. Do note the tiny out pin icon on the Get node, it’s not a circle (copy) but a diamond (a reference). You can right click the Get node and convert.
Ok I’m getting closer to the answer. But I cannot find how to get the diamont out of the GET. I used Set Members In CommonData and now the bool is TRUE, but it seems to be local because my button listening function is still printing false on that value. There is no option “convert” or whatever when I right click the “get”, on on any pin
You’re on 4.15, that’s why. Structs got some love in the last 3 engine iterations with 4.18 improving things significantly. It would be a great move to update, the sooner the better.
If I remember correctly, before Get got the reference/copy option: