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: Roblox XML

Previous Thread :: Next Thread 
B3tturTh3nU is not online. B3tturTh3nU
Joined: 18 Jun 2008
Total Posts: 6574
29 Jul 2012 08:09 AM
I know how annoyed you guys get when someone asks a question here, but I figure you guys know the most about Roblox's file format out of anyone that goes to Scripting Helpers.

I was trying to create parts dynamically, via my own program(because laziness). I know it's easier to just do in Studio, but I'm very stubborn, and I wanted to play with their XML for a bit. =P

The part creation goes very smoothly, giving each part the exact properties I specified. The only real problem comes up when I try adjusting the CFrame. When I check in Roblox, the CFrame defaults to the identity matrix. In the file, it's as the program claims. At first, I just assumed "Oh, I bet my math is just off." So, I did a check to see if the matrix is orthogonal.

Here's exactly what I got, by multiplying the matrix with its inverse.

1.0, 0.0, 0.0
0.0, 1.0, 5.551115123125783E-17
-0.0, 0.0, 1.0

Obviously except for the number on the side, that's a _perfect_ identity matrix.
Is 5...e-17 somehow too large an error for Roblox to handle? Or, is there another reason it's rejecting a perfectly good Rotation Matrix?
Report Abuse
Vitouliss14 is not online. Vitouliss14
Joined: 18 Mar 2009
Total Posts: 7918
29 Jul 2012 08:10 AM
I know a bit off-topic plus caps but:

I REMEMBER YOU FROM THE GOOD OLD DAYS IN THE SCRIPTERS FORUM!
Report Abuse
B3tturTh3nU is not online. B3tturTh3nU
Joined: 18 Jun 2008
Total Posts: 6574
29 Jul 2012 08:20 AM
Yeah. I figured I'd stop back here every now and again, see how people are doing and such. That is, while I still have free time. =P

/ Off Topicness
Report Abuse
jordan4762 is not online. jordan4762
Joined: 08 Sep 2008
Total Posts: 4116
29 Jul 2012 08:28 AM
I remember you too. Sorry, can't really help with this. But it would be neat to see this program when you are done with it.
Report Abuse
B3tturTh3nU is not online. B3tturTh3nU
Joined: 18 Jun 2008
Total Posts: 6574
29 Jul 2012 08:39 AM
Well, I plan on releasing it if I can get it to generate CFrames correctly. I might even open source it when I get too lazy to update it. =P

On the question: I actually tried saving basic parts in rbxm files, to figure out the difference between Roblox's xml and my own. I ended up with a _really_ strange result.

I started with a basic part, and threw this in the command line.
Workspace.Part.CFrame = CFrame.new(0, 10, 0) * CFrame.Angles(2.5, 0, 0)

I saved it as a model, checked the XML(it seemed okay), and tried to insert it again. I expected the block to be, at the very least, rotated in the same way. The actual result I got was the same block, but it's CFrame was rounded to the nearest 90 degree angle!

Could someone try that out for me, and make sure I'm just insane? Because, if that actually happens... I don't even know how Roblox loads models...
Maybe someone(possibly a mod) could inform me as to why that would happen?
Report Abuse
stravant is not online. stravant
Forum Moderator
Joined: 22 Oct 2007
Total Posts: 2893
29 Jul 2012 10:51 AM
"Is 5...e-17 somehow too large an error for Roblox to handle"

Roblox is _very_fault tolerant with CFrames. You'd have to completely and utterly break the CFrame to make Roblox unable to handle it.

So, it's probably something else. Are you sure you have the exact right format for the CFrame property?
Report Abuse
B3tturTh3nU is not online. B3tturTh3nU
Joined: 18 Jun 2008
Total Posts: 6574
29 Jul 2012 11:14 AM
@Stravant

Sorry. I should've posted when I resolved the problem earlier, but I figured the thread wouldn't be getting much more attention.

I found out that it was probably caused by the way my Matrix was oriented. I guess Roblox didn't like it too much. Plus, I had to make sure I used Tools > Insert Model Raw, so it doesn't round off my coordinates.

Though, I will say right now, Roblox treats models kind of strange. The working result I had was intermittent. Sometimes Roblox would insert it correctly, other times it would adjust the CFrame in strange ways. That, and I think I realized that the XML order matters in some cases.

Either way, I appreciate that you wanted to help. I'll keep this thread open, just in case I have another problem(that doesn't involve my poor math skills =P).
Report Abuse
stravant is not online. stravant
Forum Moderator
Joined: 22 Oct 2007
Total Posts: 2893
29 Jul 2012 12:09 PM
"That, and I think I realized that the XML order matters in some cases."

Make sure you're doing your referents properly. Stuff will not load correctly if you don't have them sequential as expected.
Report Abuse
ohsnapijustsharted is not online. ohsnapijustsharted
Joined: 22 Dec 2010
Total Posts: 11
29 Jul 2012 12:15 PM
gimmie money
Report Abuse
B3tturTh3nU is not online. B3tturTh3nU
Joined: 18 Jun 2008
Total Posts: 6574
29 Jul 2012 12:18 PM
@Stravant
Earlier, when I was doing some tests to see what I could optimize out of the XML, the referents didn't seem to affect anything I was looking at. So, I took them out to save space.

Do they just help order the bricks, like I suspected? Or can they actually influence the orientation of a brick? If they can, I may need to add them back in.
Report Abuse
stravant is not online. stravant
Forum Moderator
Joined: 22 Oct 2007
Total Posts: 2893
29 Jul 2012 12:35 PM
The referents are for deserialization. What happens when you save a model with an ObjectvValue pointing to part of the model? It doesn't just get nulled out, it uses the referent to specify what object it's pointing to.

Ideally it wouldn't be necessary but I would leave it in because in practice the loader may expect it to be there and do bad things when it is not.

Report Abuse
B3tturTh3nU is not online. B3tturTh3nU
Joined: 18 Jun 2008
Total Posts: 6574
29 Jul 2012 12:42 PM
Okay, thanks for the tip. It seems to create a default just fine, but I'll try and work the referent back into the XML. Shouldn't be too hard to keep track of the number of instances.
Report Abuse
stravant is not online. stravant
Forum Moderator
Joined: 22 Oct 2007
Total Posts: 2893
29 Jul 2012 12:45 PM
Yup, just have a counter and increment it every time you write one.
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