Age Verification
You must be over 18 years old to visit this website
You must be over 18 years old to visit this website
Thank you for your submission Alexa
Yes I know this... is a bit ago but I can remember good.... its always the same
Never invite people directly from the editor. If you do so, they will see the old version and you the new one.
First jump into your own room so it gets saved to the server and than invite somebody to it.
Next version will have the possibility to add a watermark to a world file to give room thieves a harder nut to crush ^^
On 26.6.2018 at 6:53 PM, Ivee said:ok sorry didn't realize it wa brought up already duh should read first please let us know if an updated version comes available
thanks..
You are using an old version. Please download and install the latest version from here.
I try to fix that soon... seems that thex changed the colors from int to float? Can somebody verify this?
9 hours ago, 3dxBromeo said:Chloe,
Thank you. I'm not a coder and frankly don't have the patience to be one. But thank you for putting this out there for us builders. I'm running through my worlds cleaning them up when I came across this particular error using the latest build of your application:
Optimizing file 'C:\...\Pool Party Club.world'...
ERROR: Failed to parse file content.
Input string '0.238' is not a valid integer. Path 'objects[0].c[0]', line 1, position 264.
Hmm... I check this if I am home again. Currently I am in the hospital. I wonder why you have a float color value.
17 hours ago, Icarus said:Thank you for sorting Chloe. Coz I am a fan of this tool, I had to test the new version straight.
Was asking cause people are saying ingame, that the file-size of a room is related to get lags or not, when you make a room public and it is crowded. Something like a room should not be bigger than 500kb. But I think it is more related to textures and lights in a room.
You can use it as an indicater... like the number of objects too. But there are a difference if you have just blocks or more complex objects. And sure lights and animated objects cost performance too.
On 2/23/2018 at 11:36 AM, Icarus said:
That is normal since the values are now stored as float and no longer as integer. I did changed that to support modded DLLs. 3dx don't care if you import floats (with decimals) or integers. So the file size is a bit bigger but after import (either with a modded DLL or the default one) you will not notice any change or different behavior but you maybe get a higher precision using a mod.
Kisses Chloe
@Ica: For a follow up check the conversation between Ayon and Alex on the first page.
New version released which will now work with floats
https://3dxmodz.com/index.php?/files/file/123-remove-duplicate-objects-world-json-files/
Okay.... yes my code expects int, if the vanilla importer has no problems with floats I will change this.
3 hours ago, Ayon said:hi There:)
I am pretty sure the doors you saw were part of the old 3DXChat 1.0
They are not available in the new WE but I believe they can still be used in game.
I have not tried this myself yet, But I assume if you can open the .world file and replace the name of a prop to door_1 or _door_2 the game should load them.
Example would be:
Open WE in game, add say a single light cube to an empty room. Save it.
Open the .world file and replace the name of the Light Cube with "door_1"
Again I have not tried this with the WE, but I assume it would work.
At least the round bar stools can be brought back in game with the same trick
Since a friend did asked I have done a stand alone version. Just extract the ZIP and start the Executable file
@Ayon If you still want to add it to the files section it would be nice if you could do so
Offline version does not really make sence... the installer from web + auto update works good I think.
New version checks the file on load and give some stats, like number of unique objects and groups too.
2 hours ago, Ayon said:Hi Chloe
Did you want to add this Modz with the Installer to the Files section of the forums?
Hi Ayon, I will create an offline installer later so it can be addedto the Files section, ty.
is c:[X,Y,Z] the color? If so I should not test for it to detect duplicates! Or maybe I will implement a flag to do a check with or without color + material.
Any suggestions?
TamaraX reported that she needed to run my tool 5 times before 0 duplicates were found. O don't know were my logic hole is but anyway, I have implemented a multi pass so really every duplicate object should be deleted after a single run:
using System; using System.Collections.Generic; using System.IO; using System.Text; using Newtonsoft.Json; namespace World { public class XCollectedObject { public bool isgroup { get; set; } public XObject obj { get; set; } public IXHasChildren container { get; set; } public string hash { get; set; } } public interface IXHasChildren { List<XObject> objects { get; set; } } public class XRespawn { public int[] p { get; set; } public double r { get; set; } } public class XObject : IXHasChildren { public string n { get; set; } public int[] p { get; set; } public int[] r { get; set; } public int[] s { get; set; } public int[] c { get; set; } public string m { get; set; } public List<XObject> objects { get; set; } public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("{"); sb.AppendFormat("n:{0}", n); sb.Append(","); if (n == "group") { sb.Append("objects:["); bool first = true; foreach(var obj in objects) { if (!first) sb.Append(","); first = false; sb.Append(obj.ToString()); } sb.Append("]"); } else { sb.AppendFormat("{0}:[{1},{2},{3}]", "p", p[0], p[1], p[2]); if (r != null) { sb.Append(","); sb.AppendFormat("{0}:[{1},{2},{3}]", "r", r[0], r[1], r[2]); } if (s != null) { sb.Append(","); sb.AppendFormat("{0}:[{1},{2},{3}]", "s", s[0], s[1], s[2]); } if (c != null) { sb.Append(","); sb.AppendFormat("{0}:[{1},{2},{3}]", "c", c[0], c[1], c[2]); } sb.Append("}"); } sb.Append("}"); return sb.ToString(); } } public class XDoc : IXHasChildren { public XRespawn respawn { get; set; } public double oceanlevel { get; set; } public string weather { get; set; } public List<XObject> objects { get; set; } } class Program { static void Collect(ref List<XCollectedObject> list, IXHasChildren container) { foreach (var obj in container.objects) { var c = new XCollectedObject() { isgroup = obj.n == "group", obj = obj, container = container, hash = obj.ToString() }; list.Add(c); if (c.isgroup) { Collect(ref list, c.obj); } } } static int RemoveDuplicates(ref List<XCollectedObject> list) { List<XCollectedObject> unique = new List<XCollectedObject>(); foreach (var objA in list) { bool duplicate = false; foreach (var objB in unique) { if (objA.hash == objB.hash) { // remove object from parent container objA.container.objects.Remove(objA.obj); duplicate = true; break; } } if (!duplicate) unique.Add(objA); } // find empty containers foreach (var objA in list) { if (objA.isgroup) { if (objA.obj.objects.Count == 0) { objA.container.objects.Remove(objA.obj); } } } return list.Count - unique.Count; } static int RemoveDuplicates(string json, out string cleanJson) { int counter = 0; XDoc doc = JsonConvert.DeserializeObject<XDoc>(json); List<XCollectedObject> allObjects = new List<XCollectedObject>(); Collect(ref allObjects, doc); counter = RemoveDuplicates(ref allObjects); cleanJson = JsonConvert.SerializeObject( doc, Formatting.None, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); return counter; } static void Main(string[] args) { int totalCounter = 0; int counter = 0; if (args.Length == 0) { Console.WriteLine("Please specify a filename :)"); return; } string fileName = args[0]; string json = File.ReadAllText(fileName); string cleanJson = null; // max 10 loops for (int i = 0; i < 10; i++) { counter = RemoveDuplicates(json, out cleanJson); totalCounter += counter; if (counter > 0) { json = cleanJson; } else { break; } } Console.WriteLine("{0} duplicate objects found.", totalCounter); File.WriteAllText(fileName.Substring(0, fileName.Length - 6) + "_xxx_clean_xxx.world", cleanJson); } } }
So maybe try my tool... its just a simple command-line tool but may help you to delete duplicate objects.
Hello all,
I had yesterday a big problem with the World Editor. For whatever reason everything was duplicated. Maybe it was me, maybe a bug, I don't know. Anyway, it was to late to load my last saved work because I changed to much.
I was frustrate but than I said to myself: Chloe, calm down, you can code So I wrote a little command line tool for the new JSON-World format to remove duplicate objects. Also inside of groups. I didn't had many but if you work on complex structures it can happen that you duplicate a block by accident.
The usage is pretty straightforward:
ChloeCleanTheWorld.exe "c:\...\awesome.world"
The check routine does not considering material. So if you have two objects with the same size and position on top each other with different materials, one of them will be removed!
If you like to write your own version, here is the (quick and dirty) code:
using System; using System.Collections.Generic; using System.IO; using System.Text; using Newtonsoft.Json; namespace World { public interface IXHasChidren { List<XObject> objects { get; set; } } public class XRespawn { public int[] p { get; set; } public double r { get; set; } } public class XObject : IXHasChidren { private string _tostring = null; public string n { get; set; } public int[] p { get; set; } public int[] r { get; set; } public int[] s { get; set; } public int[] c { get; set; } public string m { get; set; } public List<XObject> objects { get; set; } public override string ToString() { if (_tostring != null) return _tostring; StringBuilder sb = new StringBuilder(); sb.Append("{"); sb.AppendFormat("n:{0}", n); sb.Append(","); if (n == "group") { sb.Append("objects:["); bool first = true; foreach(var obj in objects) { if (!first) sb.Append(","); first = false; sb.Append(obj.ToString()); } sb.Append("]"); } else { sb.AppendFormat("{0}:[{1},{2},{3}]", "p", p[0], p[1], p[2]); if (r != null) { sb.Append(","); sb.AppendFormat("{0}:[{1},{2},{3}]", "r", r[0], r[1], r[2]); } if (s != null) { sb.Append(","); sb.AppendFormat("{0}:[{1},{2},{3}]", "s", s[0], s[1], s[2]); } if (c != null) { sb.Append(","); sb.AppendFormat("{0}:[{1},{2},{3}]", "c", c[0], c[1], c[2]); } sb.Append("}"); } sb.Append("}"); _tostring = sb.ToString(); return _tostring; } } public class XDoc : IXHasChidren { public XRespawn respawn { get; set; } public double oceanlevel { get; set; } public string weather { get; set; } public List<XObject> objects { get; set; } } class Program { static void RemoveDuplicates(IXHasChidren container) { List<XObject> uniqueObjects = new List<XObject>(); foreach (var objA in container.objects) { bool duplicate = false; foreach (var objB in uniqueObjects) { if (objA != objB) { if (objA.ToString() == objB.ToString()) { duplicate = true; break; } } } if (!duplicate) uniqueObjects.Add(objA); } Console.WriteLine("{0} duplicate objects found.", container.objects.Count - uniqueObjects.Count); container.objects = uniqueObjects; } static void Main(string[] args) { if (args.Length == 0) { Console.WriteLine("Please specify a filename :)"); return; } string fileName = args[0]; string json = File.ReadAllText(fileName); XDoc doc = JsonConvert.DeserializeObject<XDoc>(json); RemoveDuplicates(doc); foreach (var objA in doc.objects) { if (objA.n == "group") { RemoveDuplicates(objA); } } string cleanJson = JsonConvert.SerializeObject( doc, Formatting.None, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); File.WriteAllText(fileName.Substring(0, fileName.Length - 6) + "_xxx_clean_xxx.world", cleanJson); } } }
Have fun and take care!
Chloe
I have changed the code to do deep search of duplicate objects inside groups. Means more duplicate objects are now found
Please use the tool with care!
SOURCE CODE:
using System; using System.Collections.Generic; using System.IO; using System.Text; using Newtonsoft.Json; namespace World { public class XCollectedObject { public bool isgroup { get; set; } public XObject obj { get; set; } public IXHasChildren container { get; set; } public string hash { get; set; } } public interface IXHasChildren { List<XObject> objects { get; set; } } public class XRespawn { public int[] p { get; set; } public double r { get; set; } } public class XObject : IXHasChildren { public string n { get; set; } public int[] p { get; set; } public int[] r { get; set; } public int[] s { get; set; } public int[] c { get; set; } public string m { get; set; } public List<XObject> objects { get; set; } public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("{"); sb.AppendFormat("n:{0}", n); sb.Append(","); if (n == "group") { sb.Append("objects:["); bool first = true; foreach(var obj in objects) { if (!first) sb.Append(","); first = false; sb.Append(obj.ToString()); } sb.Append("]"); } else { sb.AppendFormat("{0}:[{1},{2},{3}]", "p", p[0], p[1], p[2]); if (r != null) { sb.Append(","); sb.AppendFormat("{0}:[{1},{2},{3}]", "r", r[0], r[1], r[2]); } if (s != null) { sb.Append(","); sb.AppendFormat("{0}:[{1},{2},{3}]", "s", s[0], s[1], s[2]); } if (c != null) { sb.Append(","); sb.AppendFormat("{0}:[{1},{2},{3}]", "c", c[0], c[1], c[2]); } sb.Append("}"); } sb.Append("}"); return sb.ToString(); } } public class XDoc : IXHasChildren { public XRespawn respawn { get; set; } public double oceanlevel { get; set; } public string weather { get; set; } public List<XObject> objects { get; set; } } class Program { static void Collect(ref List<XCollectedObject> list, IXHasChildren container) { foreach (var obj in container.objects) { var c = new XCollectedObject() { isgroup = obj.n == "group", obj = obj, container = container, hash = obj.ToString() }; list.Add(c); if (c.isgroup) { Collect(ref list, c.obj); } } } static void RemoveDuplicates(ref List<XCollectedObject> list) { List<XCollectedObject> unique = new List<XCollectedObject>(); foreach (var objA in list) { bool duplicate = false; foreach (var objB in unique) { if (objA.hash == objB.hash) { // remove object from parent container objA.container.objects.Remove(objA.obj); duplicate = true; break; } } if (!duplicate) unique.Add(objA); } // find empty containers foreach (var objA in list) { if (objA.isgroup) { if (objA.obj.objects.Count == 0) { objA.container.objects.Remove(objA.obj); } } } Console.WriteLine("{0} duplicate objects found.", list.Count - unique.Count); } static void Main(string[] args) { if (args.Length == 0) { Console.WriteLine("Please specify a filename :)"); return; } string fileName = args[0]; string json = File.ReadAllText(fileName); XDoc doc = JsonConvert.DeserializeObject<XDoc>(json); List<XCollectedObject> allObjects = new List<XCollectedObject>(); Collect(ref allObjects, doc); RemoveDuplicates(ref allObjects); string cleanJson = JsonConvert.SerializeObject( doc, Formatting.None, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); File.WriteAllText(fileName.Substring(0, fileName.Length - 6) + "_xxx_clean_xxx.world", cleanJson); } } }
Hello all,
I had yesterday a big problem with the World Editor. For whatever reason everything was duplicated. Maybe it was me, maybe a bug, I don't know. Anyway, it was to late to load my last saved work because I changed to much.
I was frustrate but than I said to myself: Chloe, calm down, you can code So I wrote a little command line tool for the new JSON-World format to remove duplicate objects. Also inside of groups. I didn't had many but if you work on complex structures it can happen that you duplicate a block by accident.
The usage is pretty straightforward:
ChloeCleanTheWorld.exe "c:\...\awesome.world"
The check routine does not considering material. So if you have two objects with the same size and position on top each other with different materials, one of them will be removed!
Have fun and take care!
Chloe
-----------------------------
I have changed the code to do deep search of duplicate objects inside groups. Means more duplicate objects are now found
Please use the tool with care!
Chloe
---------------------------------
TamaraX reported that she needed to run my tool 5 times before 0 duplicates were found. O don't know were my logic hole is but anyway, I have implemented a multi pass so really every duplicate object should be deleted after a single run:
---------------------------------
Now with UI and installer (and auto update)
---------------------------------
Did this for Chloe
Tamara
Nice dome Rob ... and I love the tube... nice idea
Well of cause I also use the Rochi' DLL hack for building.... I did forget that... sry Rochi
By using and viewing this site, you agree to our Terms of Use.
LAST EXILE - Night Club
in 3DXChat Build Competition
Posted
Thank you for your submission Alexa