playMaker

Author Topic: [Request] new Set Float action [Solved]  (Read 2928 times)

Skaeren

  • Playmaker Newbie
  • *
  • Posts: 11
[Request] new Set Float action [Solved]
« on: December 05, 2015, 05:00:09 PM »
I was wondering if someone could make me a set float action that will set the float value like this:

float=intX.intY

Just in case it is difficult to read, what I mean is that the float, given floats are decimal, is a number where intX is the whole number and intY becomes the decimal portion of the float.
« Last Edit: December 09, 2015, 03:08:30 AM by Skaeren »

Auggie

  • Playmaker Newbie
  • *
  • Posts: 6
Re: [Request] new Set Float action
« Reply #1 on: December 05, 2015, 08:51:37 PM »
Can can use Convert Float To String action possibly ?  If you use that you can print out as many decimal places as you like with the Format field in the action.

Just use Nx in the Format part of the action where x is the number of decimal places you'd like to use.  IE 1.123456 with N3 in the format field will store 1.123 in the string.

Here's the complete list for formatting options
https://msdn.microsoft.com/en-us/library/dwhawy9k.aspx
 
« Last Edit: December 05, 2015, 08:54:02 PM by Auggie »


Skaeren

  • Playmaker Newbie
  • *
  • Posts: 11
Re: [Request] new Set Float action
« Reply #3 on: December 07, 2015, 06:56:57 PM »
Thanks so much! The reason I needed this was because the project I am working on features a hex grid, with each hex having an int value for its horizontal hex position, and it's vertical hex position. To make checking specifics for a particular hex easier, I wanted their hex coordinates stored as a float, with the x axis hex value being pre-decimal and their y axis hex value being post-decimal.

So, once again, thank you so much!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: [Request] new Set Float action
« Reply #4 on: December 08, 2015, 12:43:27 AM »
Hi,

 Thanks dubebxl :) you should definitly tweet about them to get even more exposure.

 https://twitter.com/JeanAtPlayMaker/status/674101582921867264

Bye,

 Jean

Skaeren

  • Playmaker Newbie
  • *
  • Posts: 11
Re: [Request] new Set Float action
« Reply #5 on: December 08, 2015, 01:21:33 AM »
I, once again, need help. Using split int to float gives my float a value of NaN. Both Ints are positive in value. I have also tested split float to int incase I was using the wrong one, and it does not modify the float variable, so I am assuming split int to float is the correct one.

Could it be because of my own personal modification adding an every frame bool?

dudebxl

  • Hero Member
  • *****
  • Posts: 602
Re: [Request] new Set Float action
« Reply #6 on: December 08, 2015, 09:49:42 AM »
hi,

mmm weird cause it works on my side (there are limitations and it is best to keep your ints to max 3/4 digits - if you have large numbers then you will have to use strings to avoid having unity rounding the float). I have added everyframe to both actions so please re-download from eco, test and let me know.

dudebxl

  • Hero Member
  • *****
  • Posts: 602
Re: [Request] new Set Float action
« Reply #7 on: December 08, 2015, 09:50:29 AM »
@jeanfabre

thx dude..  ;D

Skaeren

  • Playmaker Newbie
  • *
  • Posts: 11
Re: [Request] new Set Float action
« Reply #8 on: December 09, 2015, 03:08:07 AM »
Works perfectly, thanks heaps!