Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: 90degreedesigns on November 26, 2014, 08:12:56 PM
-
I have one of two things I need accomplished with Playmaker. Here is the formula I am using. H and W are both floats.
X=230 * cuberoot(H/W)
X equals 230 times the cube root of H divided by W.
This can be re-written like this:
X = ((H*W)^1/3)*230
X equals the product of H and W with an exponent of 1/3 then multiplied by 230.
How can I reproduce this using playmaker? The most efficient way doesn't seem possible as there is no cuberoot function in playmaker. :-\
-
Hi,
You'll need a custom action for this I guess. I'll add this in the Float Operator Advanced.
Please bump early next week if you haven't heard back from me.
Bye
Jean
-
Hello,
The action "Float Operator Advanced" doesn't seem to work in unity >4 (my project is in 5.4) and the error is:
Assets/PlayMaker Custom Actions/Math/FloatOperatorAdvanced.cs(10,46): error CS0246: The type or namespace name `FsmStateActionAdvanced' could not be found. Are you missing a using directive or an assembly reference?
I need to use exponents based on variables. Is it easily fixable?
Thanks in advance
-
Hi,
Strange.
Did you get this from the Ecosystem (https://hutonggames.fogbugz.com/default.asp?W1181) ?
I just downloaded it and i have no error on my end
-
Thank you for your answer.
Yes. I just redownloaded it (after upgrading the ecosystem from 0.5.0 to 0.5.1) and I still have the same error message after Unity compiling.
Edit: and the precise version of unity I'm using is 5.4.0f3
-
Hi,
I have added an attachment with the missing script below.
-
Thank you for your help, there is no error message now. I can download & use the action.
But now i can test the action, I see it doesn't seem to manage exponents... :-\
Do you know why Jean didn't add it in 2014? (forgotten or technical problems?) Or is there another solution?
I want to be able to use float variables with another variable as exponent... I already managed it with a loop, but I'll have to use it again, and it would be better to be done properlywith a single action, I think.
-
Hi,
I will ask jean :)
-
Hi,
I simply forgot... d'oh!
I added the operator "power" to the FloatOperatorAdvanced and created a new action GetFloatExponent as well.
for cubeRoot, simple use float.power(1/3), that's how you get a cuberoot.
Let me know if it works for you.
Bye,
Jean
-
It works! Thank you! :)
(tested with FloatOperatorAdvanced)
-
I am trying to calculate various scaling equations such as A*B^.45=C, where B is the base and .45 the exponent. I have installed the Advanced Float Operator and Get Float Exponent actions but can't seem to figure out how to use them. Keep getting 0 using Adv Flt Op and the Power setting. I know I am missing something simple and will feel like an idiot so could someone please show me what to do?
Thanks
-
Ok, this is odd. I have several Float Operators Advanced and at the bottom have a Float Compare to pick an event to go with. All of my results from the Float Operator regardless of setting end up not working. If I put the float compare in a new state and use a finish event to go to it everything works fine. I thought the actions take place one after another from top to bottom? It's like the float compare is going first even though it's on the bottom.
-
There is something not right with Float Operator Advanced. If something else is in at the end like set scale it returns a 0 regardless of operation. I did a Float Operator Advanced and a set scale as a test and got 0 instead of the multiplied value. When I switched to a regular Float Operator everything works fine.
-
Hi,
can you provide a repro scene? together with the expected result, and I'll give it a go and see what's wrong. Thanks :)
Bye,
Jean