Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Realm Works Forums > Realm Works Discussion
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
EightBitz
Senior Member
 
Join Date: May 2013
Posts: 1,458

Old February 22nd, 2017, 07:39 PM
https://github.com/EightBitz/RWImport

Please read the readme. Do not consider this a finished product.

Backup your database. Make copies of your realms. This is only lightly tested, and in a limited environment. I can't guarantee anything if you run this code. I have run it several times on my own system, but I've only ever imported into empty realms, never populated ones.

I'm mainly sharing this for those who have asked to see my process. Be safe and be cautious.

And read the readme.
EightBitz is offline   #1 Reply With Quote
Absintheminded78
Member
 
Join Date: Jan 2016
Location: Sydney, Australia
Posts: 48

Old February 26th, 2017, 02:10 AM
Had a play with this today. Only had to iron out a couple of spelling discrepancies in my CSV file (easily picked up from the errors thrown by PowerShell) and worked like a treat. Thanks!
Absintheminded78 is offline   #2 Reply With Quote
EightBitz
Senior Member
 
Join Date: May 2013
Posts: 1,458

Old February 26th, 2017, 01:19 PM
Quote:
Originally Posted by Absintheminded78 View Post
Had a play with this today. Only had to iron out a couple of spelling discrepancies in my CSV file (easily picked up from the errors thrown by PowerShell) and worked like a treat. Thanks!
No problem.
EightBitz is offline   #3 Reply With Quote
Happydevil43
Senior Member
 
Join Date: Apr 2014
Location: Perth, Australia
Posts: 161

Old February 26th, 2017, 03:11 PM
I know its probably me, and didn't follow an instruction somewhere (plus my skills at this sort of thing are what you would call, non-existent)... but I had a crack (cos I am a curious bugger!) and hit a problem (and totally get this is prototype!)

Here is what I did:

1. So I copied my realm (ok good good... no problem there)
2. Made a structure file (did the export structure from copied realm) (ok possible first mistake since my extension is rwstructure not rwexport)
3. got a copy of the spell list and made the couple of changes suggested
4. modified the texty bit (see my technical knowledge shining!)
<##> $Structure_File = "d:\Jr_Structure.rwstructure"
<##> $Spell_Spreadsheet = "d:\spell_full - updated 25feb2017.csv"
<##> $New_XML_File = "Pathfinder_Spells.rwexport"

5. Hit run....

I get :
Add-Type : Cannot add type. The type name 'objIDMap' already exists.
At D:\spell_Import.ps1:1 char:1
+ Add-Type @'
+ ~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (objIDMap:String) [Add-Type], Exception
+ FullyQualifiedErrorId : TYPE_ALREADY_EXISTS,Microsoft.PowerShell.Commands. AddTypeCommand


and then a bucket load of errors before I finally stop it.
You cannot call a method on a null-valued expression.
At D:\spell_Import.ps1:12 char:5
+ $NewTopic = $contents.OwnerDocument.CreateElement("topic",$con ten ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: ( [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull


I went wrong at step 2 right ?
Happydevil43 is offline   #4 Reply With Quote
Absintheminded78
Member
 
Join Date: Jan 2016
Location: Sydney, Australia
Posts: 48

Old February 26th, 2017, 03:29 PM
Hey Happydevil43,

Yeah, I did the same thing hahaha Has to be an "export" that ends in .rwexport, I got tripped up there too by the wording of EightBitz's file.

Also a few things that popped up when I was running it were:
A couple of spelling errors in the .csv file compared to the script - spell_resistence instead of spell_resistance and description_formated, should be description_formatted.
Make sure your script, export file and csv are all in the same directory (stupidly I was running it from my downloads folder with my files in another folder )

Worked a treat after I sorted all that out.
Absintheminded78 is offline   #5 Reply With Quote
Happydevil43
Senior Member
 
Join Date: Apr 2014
Location: Perth, Australia
Posts: 161

Old February 26th, 2017, 03:35 PM
Quote:
Originally Posted by Absintheminded78 View Post
Hey Happydevil43,

Yeah, I did the same thing hahaha Has to be an "export" that ends in .rwexport, I got tripped up there too by the wording of EightBitz's file.

Also a few things that popped up when I was running it were:
A couple of spelling errors in the .csv file compared to the script - spell_resistence instead of spell_resistance and description_formated, should be description_formatted.
Make sure your script, export file and csv are all in the same directory (stupidly I was running it from my downloads folder with my files in another folder )

Worked a treat after I sorted all that out.
so its just a full export and not a structure? will give it a crack.

cheers
Happydevil43 is offline   #6 Reply With Quote
EightBitz
Senior Member
 
Join Date: May 2013
Posts: 1,458

Old February 26th, 2017, 03:46 PM
Quote:
Originally Posted by Happydevil43 View Post
so its just a full export and not a structure? will give it a crack.

cheers
A full export of an empty realm. If the realm has any topics or articles or anything, then you'll have issues with topic_id conflicts.
EightBitz is offline   #7 Reply With Quote
EightBitz
Senior Member
 
Join Date: May 2013
Posts: 1,458

Old February 26th, 2017, 03:47 PM
Quote:
Originally Posted by Absintheminded78 View Post
Hey Happydevil43,

Yeah, I did the same thing hahaha Has to be an "export" that ends in .rwexport, I got tripped up there too by the wording of EightBitz's file.

Also a few things that popped up when I was running it were:
A couple of spelling errors in the .csv file compared to the script - spell_resistence instead of spell_resistance and description_formated, should be description_formatted.
Make sure your script, export file and csv are all in the same directory (stupidly I was running it from my downloads folder with my files in another folder )

Worked a treat after I sorted all that out.
Errr, uhhh, yeah, I uhhh ... forgot to mention those spelling corrections. *cough*
EightBitz is offline   #8 Reply With Quote
Absintheminded78
Member
 
Join Date: Jan 2016
Location: Sydney, Australia
Posts: 48

Old February 26th, 2017, 03:59 PM
Quote:
Originally Posted by EightBitz View Post
Errr, uhhh, yeah, I uhhh ... forgot to mention those spelling corrections. *cough*
hehehe

I have pretty basic PowerShell knowledge so it was good to have to investigate the errors to find out what was wrong.

Also, no pressure (), do you have any plans to do more scripts for say Feats etc.?
Absintheminded78 is offline   #9 Reply With Quote
EightBitz
Senior Member
 
Join Date: May 2013
Posts: 1,458

Old February 26th, 2017, 04:13 PM
Quote:
Originally Posted by Absintheminded78 View Post
hehehe

I have pretty basic PowerShell knowledge so it was good to have to investigate the errors to find out what was wrong.

Also, no pressure (), do you have any plans to do more scripts for say Feats etc.?
I do, but I've been slacking on job hunting, so I have to start managing my time. Anyone here a hiring manager? :-)
EightBitz is offline   #10 Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 11:07 PM.


Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.