Playmaker Forum
PlayMaker Updates & Downloads => Share New Actions => Topic started by: Flying Robot on September 16, 2013, 09:03:35 AM
-
Hi,
This would be my first PlayMaker custom action. Let me know if you like it.
It takes a float (input) and offsets its value within a random range of a percentage (input) of it's value.
May come useful if you want to add a little random variation to a float value.
-
Hi,
Nice! You got action writing standard well executed, well done.
I would add a small feature: everyframe. So thyt this action can generate a random float in that range constantly, might be useful for such thing as noisy animations and stuff.
bye,
Jean
-
Thanks Jean,
I've Updated the attachment with everyframe option.
-
Hi,
Cool.
one important advice as a general way of scripting. Avoid duplicating code. Instead, create a new method ( ie "ComputeRandom()") where you will have your code, and call that method form the onEnter and OnUpdate methods. This way you only have one set of commands for your feature. In more complex programming this is essential to not fall into bad bugs and totally painful refactoring. In our case, it's minor, but still, if you need to edit this featurem you will have to do it twice, and you may forget or make a small typo and then it will work differently is eveyframe is checked than if not...
Bye,
Jean
-
Thanks Jean,
I'll follow you suggestions and pack the code into a new method and call it from the enter or update.
-
There's an error in the Tooltip section for this action. Can it be fixed please? :)