Universe Sandbox

Universe Sandbox Legacy => Universe Sandbox Legacy | Help => Topic started by: vh on February 12, 2013, 10:58:45 PM

Title: xml file
Post by: vh on February 12, 2013, 10:58:45 PM
How can i create particle instances with the xml? i've seen simulations with rings and stuff but can i just have a single particle?
Title: Re: xml file
Post by: unl0cker on February 12, 2013, 11:49:00 PM
Hmm.. what you mean one particle? I don't understand the question.

You want to duplicate the the dust inside the xml or create a particle only system?

Title: Re: xml file
Post by: Darvince on February 13, 2013, 12:06:58 AM
He wants a single dust particle in a system instead of hundreds.
Title: Re: xml file
Post by: unl0cker on February 13, 2013, 01:38:13 AM
Sounds boring. I rather have one quarter million and a ship. Like this:

TheGrid (http://www.youtube.com/watch?v=bnTEM9VVqj8#)

Anyway.. I've attached a single particle system for you, is what you are looking for?
Title: Re: xml file
Post by: vh on February 13, 2013, 04:31:55 AM
no. i'm looking for a way to designate a single particle with the xml tags in an xml file.
Title: Re: xml file
Post by: unl0cker on February 13, 2013, 08:49:02 AM
Scientia et sapientia vincit peccasse

You know how the xml hierarchy is, but looks like that is exactly what you're asking.

I understand you are familiar with python, that can be easily done with it. Just call random to generate the variables... and use perl and the fav-duo awk/sed to mass move dust around after is created.
Title: Re: xml file
Post by: vh on February 13, 2013, 02:00:45 PM
yes but the question is how to create the dust in the first place.
Title: Re: xml file
Post by: tuto99 on February 13, 2013, 02:46:56 PM
yes but the question is how to create the dust in the first place.
You first select an object, then click the tab with a picture of rings on it.
Then you select the amount of ring particles you want to add, and walla!
Title: Re: xml file
Post by: unl0cker on February 13, 2013, 02:49:08 PM
I just said how.

Use the gnu tools to generate the <pos> values and insert them in the xml. All the other tags can be the same, the position is the important one.

How? Using the tools you already have and know how to use, python, awk maybe perl.

Title: Re: xml file
Post by: unl0cker on February 13, 2013, 02:50:06 PM
Quote
You first select an object, then click the tab with a picture of rings on it.
Then you select the amount of ring particles you want to add, and walla!

Oh that... and here I am complicating things...

I sometimes use shells to erase dust. I explode or colide something thus generating a chaotic scenario full of dust. I then get a pool ball, lock it's mass and make the diameter say 1AU. Then I get this pool ball and star using it as an eraser. The trick is to un pause only when the pool ball is the location that must be erased. In other words, when paused the ball will not erase nothing.

Title: Re: xml file
Post by: vh on February 13, 2013, 02:59:08 PM
tuto, i meant by editing the xml file that universe sandbox can open (not using universe sandbox at all).


i thought it might be possible to create individual dust particles with xml. seems not though, so i'll just figure something else out.
Title: Re: xml file
Post by: tuto99 on February 13, 2013, 03:23:56 PM
tuto, i meant by editing the xml file that universe sandbox can open (not using universe sandbox at all).


i thought it might be possible to create individual dust particles with xml. seems not though, so i'll just figure something else out.
Oh, well I have no idea then. :p
I don't specialize in that sort of thing...
Title: Re: xml file
Post by: unl0cker on February 13, 2013, 03:28:49 PM
The xml structure must be:

Quote
<?xml version="1.0"?>
<dust version="2.2.0">
  <group attachto="Body1">


   <particle>
      <pos>-62216902732.591;4117459770.55927;-29344645.2920446</pos>
      <vel>-6807.46702343351;-102713.587828491;-1148.65755202698</vel>
      <color>207;216;255</color>
      <coloralt>154;174;255</coloralt>
       <size>0.1</size>
    </particle>

 
 </group>
</dust>

As long as you type the particle tag in full, you can create as many as you like changing the <pos> using a text editor.

The only catch thing is this parameter of the group tag: attachto="Body1". In the example this is attaching the dust to the body called Body1. Is always best to attach the dust to some bodies nearby or to very far away unnamed hidden ones.

The reason is because if you leave only dust in a system it will vanish next time you reload. It will also vanish under some other conditions even with bodies present.  So create as many as you want, the way you want, save the sim. Open the saved ubox with winrar (or the building file tools) open the dust file, preferably using a decent editor, like ultraedit or 010 editor, and find and remove all the <group> and </group> tags leaving only the first and last. Now go to the top, and add the proper attach parameter to the group, attaching all the dust created to this single body. Save and load.


Title: Re: xml file
Post by: vh on February 13, 2013, 04:31:28 PM
nice. where'd you get the info about the dust tags
Title: Re: xml file
Post by: unl0cker on February 13, 2013, 04:59:12 PM
From the us generated dust.xml. I opened one and voila.

As for the other stuff, I had to figure that the regular trial n error mode way.