playMaker

Author Topic: Float Subtract Appears to Not work?  (Read 1879 times)

Zeldag

  • Full Member
  • ***
  • Posts: 198
Float Subtract Appears to Not work?
« on: February 14, 2018, 10:17:28 AM »
Hi,

I feel pretty stupid here, I have tried a lot of things but it appears that float subtract (and float add and float operator) just wont do maths.

I basically Get the X position for the last map spawned on x axis (red pieces) and subtract 400 from it to get the central position to spawn map pieces on the z axis (green/blue pieces).

The light green piece should always be in the centre when 400 is subtracted (I think, if  I got my logic right), but it just does not seem to get subtracted

I have used debug and attached screenshots with debug enabled so the variables are visible. The variable is set via 'Get FSM float' initially.

Is it possible for the float subtract action to be messing me around or is it me going wrong somewhere?

Thank you all for any input!

(The gif shows how it affects gameplay, the screenshot shows the Actions in the FSM)

https://gfycat.com/FaithfulAdoredAbalone



Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Float Subtract Appears to Not work?
« Reply #1 on: February 14, 2018, 10:50:45 AM »
Have you tried enabling the action sequence or splitting the process in two states?
Available for Playmaker work

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Float Subtract Appears to Not work?
« Reply #2 on: February 15, 2018, 02:53:25 AM »
Hi,

 
Yes, cut down down even in states, so that you can debug the process state by state.

 Bye,

 Jean

Zeldag

  • Full Member
  • ***
  • Posts: 198
Re: Float Subtract Appears to Not work?
« Reply #3 on: February 17, 2018, 08:00:25 AM »
Hi,

Thank you both for your advice.

I finally found a bit of time to get back to it today. I have tried to seperate the actions and it does not seem to help.

As I said I am getting the variable from another FSM. So Im hoping that the error is something to do with the math going on in that FSM but at this stage things are getting too complex for me to find the issue.

I think I will scrap it all and rebuild it. I always thought it would be easier to just get the current Map pieces position and then spawn it to the side or to the front depending on whoch trigger was hit (hehe that still requires float operations but it has never failed for me before so fingers crossed).

I think that will be a better solution overall I was just too far down the rabbit hole with my current attempt, but this error is enough motivation to scrap it haha.

Thank you both for your responses, Ill keep those suggestions in mind for debugging issues in the future.