• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Importing custom xml for tags

manchuwook

Well-known member
I figure I'm trying to do something pretty straightforward:

Code:
<?xml version="1.0" encoding="utf-8"?>
<export xmlns="urn:lonewolfdevel.com:realm-works-export" format_version="3" is_structure_only="true" game_system_id="2">
	<definition>
		<details name="Ackerman Puglisi Traits" abbrev="apTraits" import_tag_id="Tag_1"/>
		<content_summary max_domain_count="1" max_category_count="1" />
	</definition>
	<structure>
		<domain name="Positive Traits" abbrev="appostrait">
			<tag_global name="adaptable" />
...
			<tag_global name="over-sensitive" />
		</domain>
	</structure>
</export>

Except I'm getting either a 'Divide by 0' error message or an 'Object reference not set to an instance of an object.' Can someone tell me what the mandatory elements and attributes for an import need to be? I'm told that UUIDs should be excluded, but do I need to have tag_ids or anything else?
 
Are you basing this on a structure only export of new tags? I only did a structure only export once but that one exported the entire structure.
 
It looks like this isn't a viable route to take unfortunately.

All domain and tag elements need an original_uuid attribute, and these can only be allocated by Realm Works.

Realm Works uses it's own pattern for the UUIDs rather than following the standard UUID pattern (which would have allowed import tools to specify their own UUID for each element) so only an export from Realm Works will generate valid UUIDs.

Other than that...

tag_global elements should appear inside domain_global elements. The children of a domain element should be a tag element. Both tag and tag_global require a tag_id attribute, which must be unique in the file but otherwise can be of the form "Tag_x" where x is a number.

domain tags require a "domain_id" attribute, typicall of the format "Domain_x" where x is a number (the number can change from one import to another, since it is only used while loading the XML file).
 
I'm almost there:

Code:
<?xml version="1.0" encoding="utf-8"?>
<export xmlns="urn:lonewolfdevel.com:realm-works-export"
        format_version="3"
        is_structure_only="true"
        game_system_id="2"
        source_scope_uuid="1306257B-91C6-5D3A-00D0-6A93B70F6BA9"
        owner_uuid="CED32A7B-91C6-5D3A-00D0-6A935C3C6BA9">
	<definition>
		<details name="Ackerman Puglisi Trait"
		         abbrev="aptraits"
		         import_tag_id="Tag_1"
		         import_tag_uuid="DF829BB6-7BBF-82B8-A9A1-6893B70F6BA9"
		         original_uuid="E0829BB6-7BBF-82B8-A9A1-6893B70F6BA9"/>
		<content_summary max_domain_count="1"
		                 max_category_count="1" />
	</definition>
	<structure>
		<domain_global domain_id="Domain_1"
		               name="Ackerman Puglisi Trait"
		               global_uuid="741E2A7B-91C6-5D3A-00D0-6A935D3C6BA9">
			<tag_global tag_id="Tag_2"
			            name="adaptable"
			            global_uuid="741E2A7B-91C6-5D3A-00D0-6A935D3C6BA9" />
...
			<tag_global tag_id="Tag_637" name="over-sensitive" global_uuid="741E2A7B-91C6-5D3A-00D0-6A935D3C6BA9" />
		</domain_global>
	</structure>
</export>

I'm getting a "Wrapper object not found within list" error. original_uuid was giving an error about the attribute not declared.
 
Last edited:
I'm almost there:

Code:
<?xml version="1.0" encoding="utf-8"?>
<export xmlns="urn:lonewolfdevel.com:realm-works-export"
        format_version="3"
        is_structure_only="true"
        game_system_id="2"
        source_scope_uuid="1306257B-91C6-5D3A-00D0-6A93B70F6BA9"
        owner_uuid="CED32A7B-91C6-5D3A-00D0-6A935C3C6BA9">
	<definition>
		<details name="Ackerman Puglisi Trait"
		         abbrev="aptraits"
		         import_tag_id="Tag_1"
		         import_tag_uuid="DF829BB6-7BBF-82B8-A9A1-6893B70F6BA9"
		         original_uuid="E0829BB6-7BBF-82B8-A9A1-6893B70F6BA9"/>
		<content_summary max_domain_count="1"
		                 max_category_count="1" />
	</definition>
	<structure>
		<domain_global domain_id="Domain_1"
		               name="Ackerman Puglisi Trait"
		               global_uuid="741E2A7B-91C6-5D3A-00D0-6A935D3C6BA9">
			<tag_global tag_id="Tag_2"
			            name="adaptable"
			            global_uuid="741E2A7B-91C6-5D3A-00D0-6A935D3C6BA9" />
...
			<tag_global tag_id="Tag_637" name="over-sensitive" global_uuid="741E2A7B-91C6-5D3A-00D0-6A935D3C6BA9" />
		</domain_global>
	</structure>
</export>

I'm getting a "Wrapper object not found within list" error. original_uuid was giving an error about the attribute not declared.

All the UUID attributes are unique values which need to be allocated by Realm Works. There's no easy way to generate them from outside RW.
 
All the UUID attributes are unique values which need to be allocated by Realm Works. There's no easy way to generate them from outside RW.
re
Well, I exported the UUIDs from other rwstructure files into a table and did a join on them to get a list, after checking to make sure the UUIDs were unique (remove duplicates in Excel). I imagine the different realms didn't share IDs, otherwise, there'd be a tonne of collisions. I'm still getting the wrapper error, though. :<

EDIT: Though now that I think about it, I might need to check to see if the UUID for the Realm I am importing it into doesn't have the same UUID.

EDIT 2: Poop. They are the same. I guess I gotta wait for them to get back from GenCon.
 
Last edited:
How many tags are you trying to import? The amount of time you've spent why not just use the built in UI?
 
re
Well, I exported the UUIDs from other rwstructure files into a table and did a join on them to get a list, after checking to make sure the UUIDs were unique (remove duplicates in Excel). I imagine the different realms didn't share IDs, otherwise, there'd be a tonne of collisions. I'm still getting the wrapper error, though. :<

EDIT: Though now that I think about it, I might need to check to see if the UUID for the Realm I am importing it into doesn't have the same UUID.

EDIT 2: Poop. They are the same. I guess I gotta wait for them to get back from GenCon.

I will almost guarantee you that they're going to tell you not to do anything clever with UUIDs, because you will risk corrupting your database.
 
I will almost guarantee you that they're going to tell you not to do anything clever with UUIDs, because you will risk corrupting your database.

It's a shame that they don't support the standard semantics of UUIDs, because then they can be created as guaranteed unique since each UUID would included an encoded date/time when it was created.
 
How many tags are you trying to import? The amount of time you've spent why not just use the built in UI?

I'd have to do it over a few hours, it's a highly repetitive motion for 160+ tags. For some reason, it gives me headaches and shakey hands. Normally I'd use automation to do it, but my licence for WinAutomation expired. Plus, it is for future work - I may have more tags than traits.
 
Last edited:
It's a shame that they don't support the standard semantics of UUIDs, because then they can be created as guaranteed unique since each UUID would included an encoded date/time when it was created.

That's beyond my scope of knowledge. I'm just going off of what I recall them saying in the past.
 
It would be great to be able to manage tags in a batch-like way... Let's hope someone from LWD can clarify :D
 
It looks like RFC 4122 so I'll give that one a shot.
Nevermind - it has a 5 starting on the 3rd group.
Maybe I'll just do a string replace on 4s.
 
Last edited:
That's the version number, assuming it is RFC 4122, which it should be. version 5 is a hash of the timestamp from earlier versions. Version 4 is a pseudo random number.
 
If there are no security concerns - its just a unique id I suppose? Maybe they can share the information on how to do it...
 
I'm fairly sure that Realm Works doesn't follow the RFC. They use the same grouping of digits, but that's the only similarity.
Why do you think that? It seems bizarre that they wouldn't just use the standard library call to get a GUID, GUID.NewGuid() in C#. Now I've been unable to find anything saying what standard that uses so it could be some MS specific thing.
 
Why do you think that? It seems bizarre that they wouldn't just use the standard library call to get a GUID, GUID.NewGuid() in C#. Now I've been unable to find anything saying what standard that uses so it could be some MS specific thing.

When I first started writing the Import tool I tried examining the UUID pattern that RW was using, and I couldn't marry up the UUIDs in the RW export files to any particular RFC-based UUID pattern.

My hope was that I could use the UUID pattern that included the date/time of creation of the UUID in order to create what would be a guaranteed UUID for the generated import tool. But without a guarantee that RW uses standard UUID patterns I wasn't able to guarantee that any self-generated UUIDs wouldn't conflict in the future with a UUID created internally by RW.
 
When I first started writing the Import tool I tried examining the UUID pattern that RW was using, and I couldn't marry up the UUIDs in the RW export files to any particular RFC-based UUID pattern.

My hope was that I could use the UUID pattern that included the date/time of creation of the UUID in order to create what would be a guaranteed UUID for the generated import tool. But without a guarantee that RW uses standard UUID patterns I wasn't able to guarantee that any self-generated UUIDs wouldn't conflict in the future with a UUID created internally by RW.

True, but I think there are a few thoughts on that. If the number were incremental, that means there is a way to convert it to a long number and just do one that is lower (milliseconds - 000, minutes - 60, hours - 60, days - 30, years - 12, decades - 3 (or at least back to 1-1-1970 if it was Microsoft). After all, the content markets and sharing a .rwstructure file between computers and even between realms on the same computer, the UUIDs might have collisions there, too.

This is all pure speculation for me, but at the very least, you should be able to do a partial by checking doing an export of the one you're importing to. Just run an XPath of //@global_uuid on your rwstructure file to list them out, find the smallest UUID's number, and make your imports significantly lower. Though there might also be stuff like a change in one of the of sets that states whether it is a tag, partition, facet, or whatnot.
 
Last edited:
Back
Top