playMaker

Author Topic: invert numbers[SOLVED]  (Read 6430 times)

MrMitch

  • Full Member
  • ***
  • Posts: 131
    • Rage Quit Games - Coming Soon
invert numbers[SOLVED]
« on: July 04, 2013, 04:47:39 AM »
I'm trying to figure out a way to make a positive value be read as a negative and a negative to be read as a positive, so 1.23 would be -1.23 and vice versa

Any suggestions?
« Last Edit: July 05, 2013, 09:09:50 PM by MrMitch »

escpodgames

  • Hero Member
  • *****
  • Posts: 687
    • Assets
Re: invert numbers
« Reply #1 on: July 04, 2013, 05:04:22 AM »
Easy, use the float sign test action and transition into 2 states with remove or add the initial value from zero.

MrMitch

  • Full Member
  • ***
  • Posts: 131
    • Rage Quit Games - Coming Soon
Re: invert numbers
« Reply #2 on: July 04, 2013, 05:40:44 AM »
Thanks I'll have a look at it when I get home

MrMitch

  • Full Member
  • ***
  • Posts: 131
    • Rage Quit Games - Coming Soon
Re: invert numbers
« Reply #3 on: July 05, 2013, 05:19:13 PM »
Ok so that does work for the system i have it just doesn't give me nearly enough control over the system.

I'm trying to get the device tilt and move a sphere(using force) using the tilt, i have managed to get it to read as 0 when my device is held landscape left but to do this i had to set the orientation to Portriat in Get Device Roll but the main problem is the values are reversed so when i tilt left i get positive numbers and when i tilt right i get negative numbers, i have tried using Float Compare  and setting up several stages of movement speed but for some reason Float Compare doesn't seem to fire off at all.

Are there any other ways to compare float?

escpodgames

  • Hero Member
  • *****
  • Posts: 687
    • Assets
Re: invert numbers
« Reply #4 on: July 05, 2013, 06:31:45 PM »
Device roll :S Check out this thread - http://hutonggames.com/playmakerforum/index.php?topic=3470.0

There are currently issues with device roll ... and this could be your issue?! maybe

Also make sure it's set to everyframe? otherwise it's impossible to tell why it's not working without seeing the setup.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: invert numbers
« Reply #5 on: July 05, 2013, 06:42:00 PM »
I'm trying to figure out a way to make a positive value be read as a negative and a negative to be read as a positive, so 1.23 would be -1.23 and vice versa

Any suggestions?

Use Float Multiply and multiply by -1

escpodgames

  • Hero Member
  • *****
  • Posts: 687
    • Assets
Re: invert numbers
« Reply #6 on: July 05, 2013, 08:12:56 PM »
Haha, Oh man! that is a much easier method ... ignore me :D

MrMitch

  • Full Member
  • ***
  • Posts: 131
    • Rage Quit Games - Coming Soon
Re: invert numbers
« Reply #7 on: July 05, 2013, 09:08:43 PM »
Thank you so much Alex it works perfectly now :) and thanks for trying LampRabbit :)