HexC3D
|
  |
| Joined: 30 Jun 2012 |
| Total Posts: 10044 |
|
|
| 10 Jun 2016 10:29 AM |
When I iterate recursively through the children of a playergui for guibuttons, the x-scale always returns to be
print(button.Position.X.Scale..":"..button.Name) > 0.10000000149012:button1 > 0.10000000149012:button2
but when it's out of the event it's equal to the actual scale |
|
|
| Report Abuse |
|
|
HexC3D
|
  |
| Joined: 30 Jun 2012 |
| Total Posts: 10044 |
|
|
| 10 Jun 2016 10:33 AM |
| I am at loss with this one >_> |
|
|
| Report Abuse |
|
|
HexC3D
|
  |
| Joined: 30 Jun 2012 |
| Total Posts: 10044 |
|
|
| 10 Jun 2016 10:34 AM |
WHY ARE THEY RETURNING THIS NUMBER >_<
I TRIED IT AFTERWARDS AND STILL THE SAME SCALE NUMBER OVAR AND OVAR AGAIN q_q |
|
|
| Report Abuse |
|
|
East98
|
  |
| Joined: 17 Jun 2012 |
| Total Posts: 418 |
|
|
| 10 Jun 2016 10:35 AM |
It has to do with the way roblox saves decimals in binary code. Check the section "Tricky Mistakes" in the following link for an explanation of it.
http://wiki.roblox.com/index.php?title=Lua_errors
--East98 |
|
|
| Report Abuse |
|
|
HexC3D
|
  |
| Joined: 30 Jun 2012 |
| Total Posts: 10044 |
|
|
| 10 Jun 2016 10:43 AM |
.-. I see
But if the two scales were originally of different values how would it translate to the same value no matter the position.
|
|
|
| Report Abuse |
|
|
HexC3D
|
  |
| Joined: 30 Jun 2012 |
| Total Posts: 10044 |
|
|
| 10 Jun 2016 10:55 AM |
And he's a goner .-.
Wait im starting to get it, but how would I avoid this number. |
|
|
| Report Abuse |
|
|
HexC3D
|
  |
| Joined: 30 Jun 2012 |
| Total Posts: 10044 |
|
| |
|
|
| 10 Jun 2016 11:30 AM |
You can't, unless you round it or use something besides IEEE 754. Since you can't do the latter in any practical way, you should round it if you are wanting to display it. If this is a behind-the-scenes number, leave it. |
|
|
| Report Abuse |
|
|
|
| 10 Jun 2016 11:33 AM |
| print(string.format("%.2f", button.Position.X.Scale)..":"..button.Name) |
|
|
| Report Abuse |
|
|
HexC3D
|
  |
| Joined: 30 Jun 2012 |
| Total Posts: 10044 |
|
|
| 10 Jun 2016 11:47 AM |
Even if you round the x coordinate is way off then what I wanted for each button.
Would've rounded it if it was remotely close to any of x scales for each button. |
|
|
| Report Abuse |
|
|
HexC3D
|
  |
| Joined: 30 Jun 2012 |
| Total Posts: 10044 |
|
|
| 10 Jun 2016 11:54 AM |
| o_o will I die with this problem at hand. |
|
|
| Report Abuse |
|
|
HexC3D
|
  |
| Joined: 30 Jun 2012 |
| Total Posts: 10044 |
|
| |
|
HexC3D
|
  |
| Joined: 30 Jun 2012 |
| Total Posts: 10044 |
|
| |
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
| |
|
HexC3D
|
  |
| Joined: 30 Jun 2012 |
| Total Posts: 10044 |
|
|
| 10 Jun 2016 01:57 PM |
Cross the border >_<
It's pretty simple, im using the descendentsadded event on the screengui, getting the x scale position on buttons.
but it returns the same no matter what. |
|
|
| Report Abuse |
|
|
HexC3D
|
  |
| Joined: 30 Jun 2012 |
| Total Posts: 10044 |
|
|
| 10 Jun 2016 02:04 PM |
DOES ANYONE GET WHAT IM TRYING TO DO .-.
ITS NOT EVEN DAT HARD |
|
|
| Report Abuse |
|
|
HexC3D
|
  |
| Joined: 30 Jun 2012 |
| Total Posts: 10044 |
|
|
| 10 Jun 2016 02:06 PM |
I should lay down my limited on this problem i think it's 1.5k.
seems good enough. |
|
|
| Report Abuse |
|
|
|
| 10 Jun 2016 02:07 PM |
I keep trying to reply but it's censored, hopefully this one won't be:
If the scale is supposed to be 0.1, that extra 14 billion(ths) won't matter. Unfortunately this isn't a problem you can resolve on your end, it's a C-sided issue due to the way the number is being stored in memory. |
|
|
| Report Abuse |
|
|
HexC3D
|
  |
| Joined: 30 Jun 2012 |
| Total Posts: 10044 |
|
|
| 10 Jun 2016 02:10 PM |
i cri
function ButtonCheck(Child) if Child:IsA("GuiButton") then table.insert(Buttons, Child) print(Child.Position.X.Scale..":"..Child.Name) end end
FileMod:RecursiveGetChildren(Interface, ButtonCheck) Interface.DescendantAdded:connect(ButtonCheck)
> 0.10000000149012:button1 > 0.10000000149012:button2
.-. y do i get the same number, is there anything I can do about it? |
|
|
| Report Abuse |
|
|
HexC3D
|
  |
| Joined: 30 Jun 2012 |
| Total Posts: 10044 |
|
|
| 10 Jun 2016 02:12 PM |
| Is there a different way I can go about this? |
|
|
| Report Abuse |
|
|
HexC3D
|
  |
| Joined: 30 Jun 2012 |
| Total Posts: 10044 |
|
| |
|
HexC3D
|
  |
| Joined: 30 Jun 2012 |
| Total Posts: 10044 |
|
|
| 10 Jun 2016 02:25 PM |
IM A DUNCE >_<
I FIGURED OUT MY PROBLEM ONCE AGAIN
THANKS FOR YOU PEOPLE LEADING ME INTO THE RIGHT DIRECTION! |
|
|
| Report Abuse |
|
|
|
| 10 Jun 2016 03:20 PM |
| I do that all the time. i solve it myself after many people try and I fell like a dope. |
|
|
| Report Abuse |
|
|