Cant load in ProjectMercury particles (SOLVED!)

In xna i was able to use the xml importer with no problems but now there is a problem. Can someone point me in the right direction? I have already converted ProjectMercury over to mono and I am able to run the editor using mono and loading in and exporting the particle xmls. But when I try and load it into another game using the mgcb it keeps saying that it doesnt know the type. I have linked the references and unlinked them idk how many times and wrote a basic importer and processor that gives me the same error.

<?xml version="1.0" encoding="utf-8"?> <XnaContent> <Asset Type="ProjectMercury.ParticleEffect"> <Name Null="true" /> <Author Null="true" /> <Description Null="true" /> <Emitters> <Item Type="ProjectMercury.Emitters.SphereEmitter"> <Name>Emitter 1</Name> <Budget>1000</Budget> <Term>1</Term> <ReleaseQuantity>20</ReleaseQuantity> <Enabled>true</Enabled> <ReleaseSpeed>[200,320]</ReleaseSpeed> <ReleaseColour> <Red>[1,1]</Red> <Green>[1,1]</Green> <Blue>[1,1]</Blue> </ReleaseColour> <ReleaseOpacity>[0.1,1]</ReleaseOpacity> <ReleaseScale>[20,45]</ReleaseScale> <ReleaseRotation> <Pitch>[-3.14157,3.14157]</Pitch> <Yaw>[-3.14157,3.14157]</Yaw> <Roll>[-3.14157,3.14157]</Roll> </ReleaseRotation> <ParticleTextureAssetPath Null="true" /> <BlendMode>Alpha</BlendMode> <Radius>100</Radius> <Shell>false</Shell> <Radiate>true</Radiate> <Modifiers> <Modifier Type="ProjectMercury.Modifiers.OpacityFastFadeModifier"> <InitialOpacity>1</InitialOpacity> </Modifier> <Modifier Type="ProjectMercury.Modifiers.RotationModifier"> <RotationRate>1 1 0</RotationRate> </Modifier> </Modifiers> <Controllers /> </Item> </Emitters> </Asset> </XnaContent>

What does monogome like and not like about this xml? I made a level editor as well that uses serialization and my own content importer and exporter and processor and that compiles just fine after converting it to mono. Any help would be awesome.

The content pipeline tool has its own References that need to be set. When you say you linked the references I assume you meant in the project.

Try opening the pipeline tool, click on Content at the top. Under properties will be ā€œReferences,ā€ which you can use to select the proper DLL for the content pipeline tool to use.

i did that multiple times

I am having the same problem!

In the MonoGame Pipeline Tool, after importing the old xml effects files that worked previously with XNA/Project Mercury, I get the following error for each effect when I try to build:

ā€œMicrosoft.Xna.Framework.Content.Pipeline.InvalidContentException: Could not resolve type ā€˜ProjectMercury.ParticleEffectā€™.ā€

I have added the old dlls (ProjectMercury.dll, ProjectMercury.Content.dll) as references to the Content object in the pipeline tool. The xml effect files begin as follows:

<?xml version="1.0" encoding="utf-8"?>
<XnaContent xmlns:Emitters="ProjectMercury.Emitters" xmlns:Modifiers="ProjectMercury.Modifiers">
 <Asset Type="ProjectMercury.ParticleEffect">

Please advise!

Update:
Iā€™ve added a reference to Monogame.Extended.Particles, and now the error message has changed:

System.Exception: Couldnā€™t create object of type ParticleEffect: No parameterless constructor defined for this object. ā€”> System.MissingMethodException: No parameterless constructor defined for this object.

How does one correctly import legacy Mercury Particle Engine xml particle effects?

Iā€™m guessing ill have to write my own importer and processor for legacy mercury but here is a link to the project that is ported over to mono. https://drive.google.com/open?id=1LMPFQIWwXOQA5CbodOfeFwb78xIJcVJP

The monogame extended only copied some aspects of the mercury particle engine but you can not use it to import xmls

Thats because a default serialize requires the class you are serializing to have a default constructor. Eg. Myclass::Myclass(); The monogame extended particles doesnt allow for xml serialization.

Ok so I have made some progress on this without having to write my own processor and importer. But it seems that inside monogames ReflectiveSerializer.cs inside the Deserialize function it fails when trying to move to Element Enabled. So !input.MoveToElement(info.Attribute.ElementName)). Second thought could it be that the monogame xml is expecting everything to be in order from the class? Because it looks like the elementinfo is getting taken straight out of the position in the class but in the xml document its not in that order. hmmmm

Ok last update and I think everyone will be happy with it now lol. I have fixed the problem! Here is the project with the updated ProjectMercury editor and the content importer and processor. In your ContentPipline tool just point to the SynapseContentImporter.


<div style=font-size:9px;font-family:Arial, Helvetica, sans-serif;width:127px;font-color:#44a854;> online backup

Hi nogbdy1

Iā€™m really interested to try this out as Iā€™ve had similar problems with importing ProjectMercury .xml files - however Iā€™m struggling to follow your instructions of ā€˜point to SynapseContentImporterā€™.

I canā€™t find any Synapse dll files or any mention of Synapse in the code.

Iā€™ve managed to build your code successfully and have tried a variety of dlls in the pipeline tool but no luck so far.

Would you mind sharing the SynapseContentImporter file so itā€™s basically fool proof for me :slight_smile:

Thanks!

Lol whoops i mean to say point to ProjectMercuryContentImporter.dll

Ah :slight_smile: Well turns out I had guessed correctly which dll to use but still having no joy.

Iā€™ve tried importing the EffectLibrary xml files that come with the original ProjectMercury. e.g. BasicExplosion.xml.

Iā€™m adding them in the Pipeline Tool. Iā€™ve referenced the dll and Iā€™ve set the xml file to use the MercuryImporter. Weirdly it gets a tick in the Pipeline Tool but it fails with an error: The Xml element Name is required!

Iā€™ve tried your test version from the top of this page. That fails with: The Xml element Enabled is required!

Is this related the the ContentImporter ordering problem that seems to be a problem across many Monogame Content files or can you spot something more obvious Iā€™m missing?

Cheers

Ok so for me I have referenced ProjectMercuryContentImporter.dll, ProjectMercury.dll, and ProjectMercury.ContentPipeline.dll And to be safe I included ProjectMercury inside of the sln project.

Also make sure youre project you are building for ex. x64 is the same for all other projects. It doesnt like mixing x86 with x64.

Thanks - that seems to be an improvement. The Content Pipeline is happy with all the dlls added. Although, I was pretty sure I tried that combination right at the beginning but nevermind :slight_smile:

So I can load in your test version now - but Iā€™m still having no luck with the included EffectLibrary .xml files. Did you have any joy with those? I get a host of different missing elements xml errors - so Iā€™ve be re-jigging the xml to make it a bit happier - but havenā€™t managed yet.

Looks like Iā€™m going to have to compile the MGCB from source and dig a bit deeper.

When this happened to me it was because the dlls didnt like one project being set as 32 bit or any cpu it just likes the 64bit instead.

We are trying to do this too but the link:
@nohbdy1
http://www.filedropper.com/projectmercurycontentimporter
No longer works.

Would someone be able to post the code for the importer?

Thanks
Much appreciated