Welcome, Guest

Author Topic: xml file  (Read 8650 times)

vh

  • formerly mudkipz
  • *****
  • Posts: 1140
  • "giving heat meaning"
xml file
« 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?

unl0cker

  • *****
  • Posts: 192
Re: xml file
« Reply #1 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?


Darvince

  • *****
  • Posts: 1842
  • 差不多
Re: xml file
« Reply #2 on: February 13, 2013, 12:06:58 AM »
He wants a single dust particle in a system instead of hundreds.

unl0cker

  • *****
  • Posts: 192
Re: xml file
« Reply #3 on: February 13, 2013, 01:38:13 AM »
Sounds boring. I rather have one quarter million and a ship. Like this:


Anyway.. I've attached a single particle system for you, is what you are looking for?

vh

  • formerly mudkipz
  • *****
  • Posts: 1140
  • "giving heat meaning"
Re: xml file
« Reply #4 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.

unl0cker

  • *****
  • Posts: 192
Re: xml file
« Reply #5 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.
« Last Edit: February 13, 2013, 11:29:41 AM by unl0cker »

vh

  • formerly mudkipz
  • *****
  • Posts: 1140
  • "giving heat meaning"
Re: xml file
« Reply #6 on: February 13, 2013, 02:00:45 PM »
yes but the question is how to create the dust in the first place.

tuto99

  • *****
  • Posts: 533
  • Baba Booey
Re: xml file
« Reply #7 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!

unl0cker

  • *****
  • Posts: 192
Re: xml file
« Reply #8 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.


unl0cker

  • *****
  • Posts: 192
Re: xml file
« Reply #9 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.

« Last Edit: February 13, 2013, 02:59:54 PM by unl0cker »

vh

  • formerly mudkipz
  • *****
  • Posts: 1140
  • "giving heat meaning"
Re: xml file
« Reply #10 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.

tuto99

  • *****
  • Posts: 533
  • Baba Booey
Re: xml file
« Reply #11 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...

unl0cker

  • *****
  • Posts: 192
Re: xml file
« Reply #12 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.


« Last Edit: February 13, 2013, 03:43:47 PM by unl0cker »

vh

  • formerly mudkipz
  • *****
  • Posts: 1140
  • "giving heat meaning"
Re: xml file
« Reply #13 on: February 13, 2013, 04:31:28 PM »
nice. where'd you get the info about the dust tags

unl0cker

  • *****
  • Posts: 192
Re: xml file
« Reply #14 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.