generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Odd problem

Previous Thread :: Next Thread 
HexC3D is not online. 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 is not online. HexC3D
Joined: 30 Jun 2012
Total Posts: 10044
10 Jun 2016 10:33 AM
I am at loss with this one >_>
Report Abuse
HexC3D is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. HexC3D
Joined: 30 Jun 2012
Total Posts: 10044
10 Jun 2016 11:20 AM
o_0 come on guys
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
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
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
10 Jun 2016 11:33 AM
print(string.format("%.2f", button.Position.X.Scale)..":"..button.Name)
Report Abuse
HexC3D is not online. 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 is not online. 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 is not online. HexC3D
Joined: 30 Jun 2012
Total Posts: 10044
10 Jun 2016 12:53 PM
>_< navar
Report Abuse
HexC3D is not online. HexC3D
Joined: 30 Jun 2012
Total Posts: 10044
10 Jun 2016 01:14 PM
./.
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
10 Jun 2016 01:19 PM
WHAT ARE YOU TRYING TO DO


Report Abuse
HexC3D is not online. 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 is not online. 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 is not online. 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
wonderful72pike is not online. wonderful72pike
Joined: 13 Jul 2010
Total Posts: 7009
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 is not online. 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 is not online. 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 is not online. HexC3D
Joined: 30 Jun 2012
Total Posts: 10044
10 Jun 2016 02:20 PM
Im offering 1.5k.
Report Abuse
HexC3D is not online. 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
boatbomber is not online. boatbomber
Joined: 26 Oct 2012
Total Posts: 386
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image