Hi all, a bit of an issue which is greatly annoying me since it’s pretty fundamental to what I’m doing right now. First off, a little explanation: I’m trying to make a weapon system similar to Borderlands, but with editable parts.
I have a struct NewWeapon which has in it an array of structs, and a struct. The array WeaponModules contains 9 Modules. Each Module has 5 floats and a string, representing one Part of the gun - the name and 5 stats.
What I’m wanting to do is generate random initial values for each of the 5 floats. The default value of all of them is set to 1.0, for an “average” gun. This is not happening.
For some reason, when I try to set the values, it completely ignores me trying to set them and reverts back to the value of 1.0. I know for sure that the floats were random since I printed them every time I (attempted to) set them. I’m not at all sure why this is happening. Since Blueprints are kind of hard to accurately depict, [if you follow this link you will see the first version of the block I tried to use][1]. I understand it is a bit of a mess, I had not gotten around to cleaning it up properly; also, since this is the first version, the Exec and New Weapon pins are now empty, but were hooked up when it was being used.
After encountering this, I had thought maybe I was sloppy in my implementation - so I decided to detach the above block, start from scratch, and hope for a better result. I even made the “random” value to a specific value, to remove the possibility of some error related to that value. Nothing - still the same result - still the array refuses to set, and/or the default value is shown. [Link to the second block version][3].
As you can imagine, I’m pretty frustrated by not being able to do what seems like it should be a very simple task - I don’t know if this is a bug, or if my logic is off. Does anybody have any idea what could be going wrong here?
If you have any questions, I will be happy to elaborate further to aid in resolution of the problem.