Wrye Bash Wizards

Post » Wed Mar 30, 2011 12:48 am

Am I writing this right?
    Case "CompareObVersion"        If CompareObVersion('1.2.0.416') == -1            Note "Installed Oblivion version is less than the version specified('1.2.0.416')"        Elif CompareObVersion('1.2.0.416') == 0            Note "Installed Oblivion version is the same as than the version specified('1.2.0.416')"        Elif CompareObVersion('1.2.0.416') == 1            Note "Installed Oblivion version is higher than the version specified('1.2.0.416')"        EndIf        Break


It threw this error
Spoiler

An unhandled error occured while parsing the wizard:
Line(409): If CompareObVersion('1.2.0.416') == -1

Traceback (most recent call last):
File "C:\Program Files\Bethesda Softworks\Oblivion\Mopy\belt.py", line 707, in Continue
self.RunLine(newline)
File "C:\Program Files\Bethesda Softworks\Oblivion\Mopy\ScriptParser.py", line 475, in RunLine
key(*self.tokens)
File "C:\Program Files\Bethesda Softworks\Oblivion\Mopy\ScriptParser.py", line 341, in __call__
def __call__(self, *args, **kwdargs): return self.data(*args, **kwdargs)
File "C:\Program Files\Bethesda Softworks\Oblivion\Mopy\ScriptParser.py", line 257, in __call__
return super(Parser.Keyword,self).__call__(*args)
File "C:\Program Files\Bethesda Softworks\Oblivion\Mopy\ScriptParser.py", line 218, in __call__
return self.execute(*args)
File "C:\Program Files\Bethesda Softworks\Oblivion\Mopy\ScriptParser.py", line 235, in execute
return self.function(*args)
File "C:\Program Files\Bethesda Softworks\Oblivion\Mopy\belt.py", line 957, in kwdIf
bActive = self.ExecuteTokens(args)
File "C:\Program Files\Bethesda Softworks\Oblivion\Mopy\ScriptParser.py", line 550, in ExecuteTokens
return self.ExecuteRPN()
File "C:\Program Files\Bethesda Softworks\Oblivion\Mopy\ScriptParser.py", line 671, in ExecuteRPN
ret = i(*args)
File "C:\Program Files\Bethesda Softworks\Oblivion\Mopy\ScriptParser.py", line 341, in __call__
def __call__(self, *args, **kwdargs): return self.data(*args, **kwdargs)
File "C:\Program Files\Bethesda Softworks\Oblivion\Mopy\ScriptParser.py", line 218, in __call__
return self.execute(*args)
File "C:\Program Files\Bethesda Softworks\Oblivion\Mopy\ScriptParser.py", line 235, in execute
return self.function(*args)
File "C:\Program Files\Bethesda Softworks\Oblivion\Mopy\belt.py", line 853, in opMul
def opMul(self, l, r): return l * r
File "C:\Program Files\Bethesda Softworks\Oblivion\Mopy\ScriptParser.py", line 318, in __mul__
def __mul__(self, other): return Parser.Token(self.data * other.data)
TypeError: can't multiply sequence by non-int of type 'str'



Nevermind. I got it to sorta state what I wanted with Note. This bit could be added to the wizard documentation.
Note CompareWBVersion('292')

shows -1, 0 or 1 on the final screen

Note CompareObVersion('1.2.0.416')
threw an error

EDIT: apparently the wizard doesn't like -1 but will accept < 0 for WBVersion
User avatar
Khamaji Taylor
 
Posts: 3437
Joined: Sun Jul 29, 2007 6:15 am

Post » Wed Mar 30, 2011 3:47 am

Running the Exec function then going back(button) then trying to run it again FAILED
The second time through It asked the Icecream question twice, FAILING on the second asking(actually the third asking in the run)

An error occured in the wizard script:
Line: EndExec(9)
Error: (Line 417, Column 10): Unexpected 'EndExec'.
User avatar
Philip Rua
 
Posts: 3348
Joined: Sun May 06, 2007 11:53 am

Post » Wed Mar 30, 2011 9:04 am

Just tried the Demo :celebration: Amazing piece of work. No problems so far with svn 1061.

I need to test more tomorrow .. need sleep - To be honest I spent more time laughing reading the wizard in notepad++ than I did actually testing all options.

First run through no problems. Finish page seen with no hiccups en-route.

Really want to try all those options though :)

Edit: For anyone who missed it Metallicow posted >http://www.gamesas.com/index.php?/topic/1185023-relz-wrye-bash-thread-65/page__view__findpost__p__17698785<
User avatar
Neko Jenny
 
Posts: 3409
Joined: Thu Jun 22, 2006 4:29 am

Post » Wed Mar 30, 2011 11:59 am

Running the Exec function then going back(button) then trying to run it again FAILED
The second time through It asked the Icecream question twice, FAILING on the second asking(actually the third asking in the run)

An error occured in the wizard script:
Line: EndExec(9)
Error: (Line 417, Column 10): Unexpected 'EndExec'.

Oops, I know what's going on there... I forgot to make the Exec function "Back button safe". I'll work on that one.
User avatar
Neko Jenny
 
Posts: 3409
Joined: Thu Jun 22, 2006 4:29 am

Post » Tue Mar 29, 2011 11:29 pm

Using the Demo....

Nice job...got a bunch of LOL moments reading some of the things..thanks for that...:)....can OBMM do that....ect..


An error occured in the wizard script:
Line: Note "Hello"[0] ;returns "H"
Error: (Line 559, Column 20): Invalid character: '['


I get that a lot...if i just pick default option >next> this error.? and Back button is grayed out. have to close WIZ
Think with all the Info you put in that DEMO i might actually be able to WIZ all my mods....hmmmm

Forgot to mention...nice ASCII Art. Oblivion logo sweet looking.
User avatar
Rinceoir
 
Posts: 3407
Joined: Thu Jun 29, 2006 1:54 am

Post » Wed Mar 30, 2011 12:15 am

Using the Demo....

Nice job...got a bunch of LOL moments reading some of the things..thanks for that...:)....can OBMM do that....ect..

An error occured in the wizard script:
Line: Note "Hello"[0] ; returns "H"
Error: (Line 559, Column 20): Invalid character '['



I get that a lot...if i just pick default option >next> this error.? and Back button is grayed out. have to close WIZ
Think with all the Info you put in that DEMO i might actually be able to WIZ all my mods....hmmmm
Make sure you're updated to the latest SVN. String indexing just got added very recently, so it'll just give errors (like yours) if you have an older version.

Also, I just realized the wizard docs have a functions 'CompareObVersion', where I had originally named it 'CompareOblivionVersion' and it's recognized that way in the parser. Guess I'll change the name of the function, it's easier that way.
User avatar
Jade
 
Posts: 3520
Joined: Mon Jul 10, 2006 6:42 am

Post » Wed Mar 30, 2011 1:15 am

Demo... Got me thinking a bit....

Requests:
========
The Message and DisplayImage really are simple.
(wx.textctrl)
&
wx.(whatever you have been using for the image sizer))

These would be a 1:1 conversion (word -wise)

[ code ]
Ideas
=====
Now besides the obvious how can we make things more dymanic? (simply & graphically)
I haven't played that much with the wx.wizard but....
What about a RTctrl or HTMLctrl or (Haha)STC for dynamic behavior in the wizard?

1. Colored lines
Ex: SelectOneColored "Huh, why is the background colored redish", "#FF0000",\

2. Colored (key)words
Ex: 'this is a string This is a {{b}}STRING{{/b}}. This is a string'

3. Why color? Just Because.
Ex: do it yourself.... Both examples working together.

and a few other brain twisters as to how it "could look" nicely, in a dialog or not............?

image comboboxes
image textctrls

wx.Toolbook...etc....a.bit.far.fetched.(for.a.but within reason.)...
etc...

Hopefully you'll think sommore


The [ /code ] before is but ideas that might be able to be put into code....


But, yeah, a simple Message and DisplayImage Dialogs would round things off.

Message being a dialog with a header but just a simple readonly textctrl...
The Display image dialog being as just the image(scaled right as has been accomplished)
User avatar
Yvonne Gruening
 
Posts: 3503
Joined: Mon Apr 23, 2007 7:31 pm

Post » Wed Mar 30, 2011 2:27 pm

That's a lot of work :ooo:

But seriously though, depends on the demand. How many people would like a message box and image box-like display option?

Aside from that though, it would probably be a good idea to change the text box used for the Description and Notes into an RTF control. It would function the same, plus the text could be formatted if desired. IIRC you can even make HTML links with it.
User avatar
Breanna Van Dijk
 
Posts: 3384
Joined: Mon Mar 12, 2007 2:18 pm

Post » Wed Mar 30, 2011 10:10 am

Don't recall myself about the links with RTF but, yeah that would be a great start. :) Yep, the demo says it supports urls.

I guess if a Message dialog was a RTF or HTML control that would serve as a very basic DisplayImage dialog also, which could house more than one image and provide linking functionality.

Rich Text Control from the wxPython Demo
Spoiler
Welcome to wxRichTextCtrl, a wxWidgets control for editing and presenting styled text and imagesby Julian SmartWhat can you do with this thing?  Well, you can change text colour, like this red bit. And this blue bit. Naturally you can make things bold or italic or underlined. Different font sizes on the same line is allowed, too. Next we'll show an indented paragraph.It was in January, the most down-trodden month of an Edinburgh winter. An attractive woman came into the cafe, which is nothing remarkable.Next, we'll show a first-line indent, achieved using BeginLeftIndent(100, -40).It was in January, the most down-trodden month of an Edinburgh winter. An attractive woman came into the cafe, which is nothing remarkable.Numbered bullets are possible, again using sub-indents:This is my first item. Note that wxRichTextCtrl doesn't automatically do numbering, but this will be added later.This is my second item.The following paragraph is right-indented:It was in January, the most down-trodden month of an Edinburgh winter. An attractive woman came into the cafe, which is nothing remarkable.The following paragraph is right-aligned with 1.5 line spacing:It was in January, the most down-trodden month of an Edinburgh winter. An attractive woman came into the cafe, which is nothing remarkable.Other notable features of wxRichTextCtrl include:Compatibility with wxTextCtrl APIEasy stack-based BeginXXX()...EndXXX() style setting in addition to SetStyle()XML loading and savingUndo/Redo, with batching option and Undo suppressingClipboard copy and pastewxRichTextStyleSheet with named character and paragraph styles, and control for applying named stylesA design that can easily be extended to other content types, ultimately with text boxes, tables, controls, and so onRichTextCtrl can also display URLs, such as this one: The wxPython Web Site. Click on the URL to generate an event.Note: this sample content was generated programmatically from within the MyFrame constructor in the demo. The images were loaded from inline XPMs. Enjoy wxRichTextCtrl!Additional comments by David Woods:I find some of the RichTextCtrl method names, as used above, to be misleading.  Some character styles are stacked in the RichTextCtrl, and they are removed in the reverse order from how they are added, regardless of the method called.  Allow me to demonstrate what I mean.Start with plain text. BeginBold() makes it bold. BeginItalic() makes it bold-italic. EndBold() should make it italic but instead makes it bold. EndItalic() takes us back to plain text. Start with plain text. BeginBold() makes it bold. BeginUnderline() makes it bold-underline. EndBold() should make it underline but instead makes it bold. EndUnderline() takes us back to plain text. According to Julian, this functions "as expected" because of the way the RichTextCtrl is written.  I wrote the SetFontStyle() method here to demonstrate a way to work with overlapping styles that solves this problem.Start with plain text. Bold. Bold-italic. Italic. Back to plain text. Start with plain text. Bold. Bold-Underline. Underline. Back to plain text. 

User avatar
Amanda savory
 
Posts: 3332
Joined: Mon Nov 27, 2006 10:37 am

Post » Wed Mar 30, 2011 12:22 am

This looks great - I am ever so grateful that you are considering my request - many thanksJust a few points...1. Would need to be able to iterate over the Espms in a sub-package (rather than the entire BAIN package) to replicate what I currently do in OBMM2. Need to be able return the file names regardless of whether they are an ESP or ESM (ie it could be a KF file or an unknown Extension)
To follow up on this:
  • For loops now have two new versions, for iterating over files in an installer:
    • For subpackage in SubPacakges
    • For file in subpackage

  • Two new functions to work in conjunction with these for loops:
    • GetFilename: Gets just the filename from a path string, ex: for alpha\beta.gamma, this will return beta.gamma
    • GetFolder: Gets the folder from a path string, ex: for alpha\beta.gamma, this returns alpha.


You should be able to do everything you need with combinations of these for loops, functions, the new string manipulation functions, and the new string indexing.

@Surazal: if you need any more functions to make it work, let me know.



Am I writing this right?
    Case "CompareObVersion"        If CompareObVersion('1.2.0.416') == -1            Note "Installed Oblivion version is less than the version specified('1.2.0.416')"        Elif CompareObVersion('1.2.0.416') == 0            Note "Installed Oblivion version is the same as than the version specified('1.2.0.416')"        Elif CompareObVersion('1.2.0.416') == 1            Note "Installed Oblivion version is higher than the version specified('1.2.0.416')"        EndIf        Break

It threw this error
Spoiler
An unhandled error occured while parsing the wizard: Line(409): If CompareObVersion('1.2.0.416') == -1Traceback (most recent call last):  File "C:\Program Files\Bethesda Softworks\Oblivion\Mopy\belt.py", line 707, in Continue    self.RunLine(newline)  File "C:\Program Files\Bethesda Softworks\Oblivion\Mopy\ScriptParser.py", line 475, in RunLine    key(*self.tokens)  File "C:\Program Files\Bethesda Softworks\Oblivion\Mopy\ScriptParser.py", line 341, in __call__    def __call__(self, *args, **kwdargs): return self.data(*args, **kwdargs)  File "C:\Program Files\Bethesda Softworks\Oblivion\Mopy\ScriptParser.py", line 257, in __call__    return super(Parser.Keyword,self).__call__(*args)  File "C:\Program Files\Bethesda Softworks\Oblivion\Mopy\ScriptParser.py", line 218, in __call__    return self.execute(*args)  File "C:\Program Files\Bethesda Softworks\Oblivion\Mopy\ScriptParser.py", line 235, in execute    return self.function(*args)  File "C:\Program Files\Bethesda Softworks\Oblivion\Mopy\belt.py", line 957, in kwdIf    bActive = self.ExecuteTokens(args)  File "C:\Program Files\Bethesda Softworks\Oblivion\Mopy\ScriptParser.py", line 550, in ExecuteTokens    return self.ExecuteRPN()  File "C:\Program Files\Bethesda Softworks\Oblivion\Mopy\ScriptParser.py", line 671, in ExecuteRPN    ret = i(*args)  File "C:\Program Files\Bethesda Softworks\Oblivion\Mopy\ScriptParser.py", line 341, in __call__    def __call__(self, *args, **kwdargs): return self.data(*args, **kwdargs)  File "C:\Program Files\Bethesda Softworks\Oblivion\Mopy\ScriptParser.py", line 218, in __call__    return self.execute(*args)  File "C:\Program Files\Bethesda Softworks\Oblivion\Mopy\ScriptParser.py", line 235, in execute    return self.function(*args)  File "C:\Program Files\Bethesda Softworks\Oblivion\Mopy\belt.py", line 853, in opMul    def opMul(self, l, r): return l * r  File "C:\Program Files\Bethesda Softworks\Oblivion\Mopy\ScriptParser.py", line 318, in __mul__    def __mul__(self, other): return Parser.Token(self.data * other.data)TypeError: can't multiply sequence by non-int of type 'str'
Nevermind. I got it to sorta state what I wanted with Note. This bit could be added to the wizard documentation.
Note CompareWBVersion('292')
shows -1, 0 or 1 on the final screen
Note CompareObVersion('1.2.0.416')
threw an error

EDIT: apparently the wizard doesn't like -1 but will accept < 0 for WBVersion
Oops, missed this report ealier. I thought I had fixed the -1 thing, but was wrong. It should work fine now. Also, I noticed I had 'CompareObVersion' in the documentation, but the parser was looking for 'CompareOblivionVersion', so that's changed as well to match what the documentation says (CompareObVersion).
User avatar
Your Mum
 
Posts: 3434
Joined: Sun Jun 25, 2006 6:23 pm

Post » Wed Mar 30, 2011 5:24 am

For those updating their scripts to the newer..

If also appears that
If DataFileExists "file_name.esp"   bValue = http://forums.bethsoft.com/index.php?/topic/1174346-wrye-bash-wizards/TrueEndIf


Doesn't work anymore and should be written with parenthesis like so:
If DataFileExists ("file_name.esp")   bValue = http://forums.bethsoft.com/index.php?/topic/1174346-wrye-bash-wizards/TrueEndIf

Or will throw an error.(without parenthesis)
User avatar
no_excuse
 
Posts: 3380
Joined: Sun Jul 16, 2006 3:56 am

Post » Wed Mar 30, 2011 3:53 am

For those updating their scripts to the newer..

If also appears that
If DataFileExists "file_name.esp"   bValue = http://forums.bethsoft.com/index.php?/topic/1174346-wrye-bash-wizards/TrueEndIf


Doesn't work anymore and should be written with parenthesis like so:
If DataFileExists ("file_name.esp")   bValue = http://forums.bethsoft.com/index.php?/topic/1174346-wrye-bash-wizards/TrueEndIf

Or will throw an error.(without parenthesis)

That's because DataFileExists is a function... functions are supposed to have their arguments in parenthesis. If it used to work that way, it wasn't supposed to :shrug: I wasn't aware that it could be done that way.
User avatar
josie treuberg
 
Posts: 3572
Joined: Wed Feb 07, 2007 7:56 am

Post » Tue Mar 29, 2011 11:28 pm

That's because DataFileExists is a function... functions are supposed to have their arguments in parenthesis. If it used to work that way, it wasn't supposed to :shrug: I wasn't aware that it could be done that way.


Happened to notice that for a few that I/someone else had converted over from an OBMM Scripts/etc..
probably just overlooked at the time making a quick conversion, but yeah, it did work that way at one time.
User avatar
Cool Man Sam
 
Posts: 3392
Joined: Thu May 10, 2007 1:19 pm

Post » Wed Mar 30, 2011 4:09 am

@Surazal: if you need any more functions to make it work, let me know.

Many thanks for this - much appreciated. I have not been testing WB v292 yet - have been working on some other stuff and needed to keep the game stable for a while. I have also been monitoring the OP to see when the functions I requested go "green" - am I correct in my monitoring?

Also, in case you are interested, I came up with an idea yesterday to write a Word macro that generates a wizard.txt to install the Sensual Walks ESPs. Phase 1 is now working (ie the detection of the master esps/esms and the selection). I now need to code the logic to deal with the choices users have to make when I can't detect which version is being used. Also means that the BAIN version has much fewer ESPs because importing into the Bashed patch is assumed. Hoping I can release this before I go away on Sunday for a week - otherwise it will have to wait.

Once again - huge appreciation for the incredible work you are doing on this and the tremendous responsiveness - simply amazing!

Edit:
A nicety (ie not essential) would be implementing OBMM's feature to select a variable rather than get user input...

SelectVar
SelectString
Instead of allowing the user to choose an option, these test the value of the supplied argument instead.

Example:
SelectVar package    Case 8    Case 9    Case 10    Break Default    Message "You must be using shader package 8, 9 or 10" "Error"    FatalError EndSelect

User avatar
Shaylee Shaw
 
Posts: 3457
Joined: Wed Feb 21, 2007 8:55 pm

Post » Wed Mar 30, 2011 4:52 am

Many thanks for this - much appreciated. I have not been testing WB v292 yet - have been working on some other stuff and needed to keep the game stable for a while. I have also been monitoring the OP to see when the functions I requested go "green" - am I correct in my monitoring?

Also, in case you are interested, I came up with an idea yesterday to write a Word macro that generates a wizard.txt to install the Sensual Walks ESPs. Phase 1 is now working (ie the detection of the master esps/esms and the selection). I now need to code the logic to deal with the choices users have to make when I can't detect which version is being used. Also means that the BAIN version has much fewer ESPs because importing into the Bashed patch is assumed. Hoping I can release this before I go away on Sunday for a week - otherwise it will have to wait.

Don't know if lojack has "exactly" kept up on the coloring of the OP....Lo....?,

Anyway my next release of TES4WizBAIN is going to implement quite a bit of the features of STC into it. By word macro what are you exactly meaning.? Microsoft Word? wordy? G11Macro? etc... macros take many forms and if it is something
I could get done in an hour or so, maybe I can implement it in my program for you.
It was designed from day 1 for developing wizards, but has become a bit more of an specialized moddable game editor since...

If interested send me a PM to a link or post here... whatever.

Basically, I would only need a description of the actions taken (total) to perform the task.
and also any special inserts etc, deviations... etc...

Mooo
User avatar
Ebou Suso
 
Posts: 3604
Joined: Thu May 03, 2007 5:28 am

Post » Wed Mar 30, 2011 1:39 pm

I could get done in an hour or so, maybe I can implement it in my program for you.
It was designed from day 1 for developing wizards, but has become a bit more of an specialized moddable game editor since...

If interested send me a PM to a link or post here... whatever.

Thanks for your interest.

It is a Microsoft Word Macro that generates a wizard containing all the logic for the installation of Sensual Walks for Female NPCs ESPs. I see this as a temporary measure until WB v292 is released. It is all working now. If you are interested in the logic, take a look at the Sensual Walks OMOD (sig has link) - that is what I have replicated. The key requirement was to drive the installation based on the subpackage and ESP names (ie nothing is hardcoded, so I can add or change mods without changing the script). Having said that, the generated script has everything hardcoded because v291 wizard can't read directory and file names in a BAIN package - so the plan is to rerun the macro before I upload changes.

The macro I wrote gets the subpackage names and generates a wizard based on the subpackages that are present and uses the ESP names to derive the master ESP so it can generate the script required to check if it exists on the user's system. In addition, some choices need to be made by the user - in these cases, they are given a selection so they can choose which variation of a mod with the same name is installed.

I have just got add a few finishes touches and package the documentation before releasing it. Generates about 3,200 lines of script compared to the 550 (including lots of comments) that the OMOD has.

BTW, it took me under two hours to write the macro to generate the script using Word (includes time to learn WB's wizard syntax) - so pretty quick for me as well - will probably take longer to package up the documentation :)
User avatar
Russell Davies
 
Posts: 3429
Joined: Wed Nov 07, 2007 5:01 am

Post » Wed Mar 30, 2011 12:46 am

Edit:
A nicety (ie not essential) would be implementing OBMM's feature to select a variable rather than get user input...

SelectVar
SelectString
Instead of allowing the user to choose an option, these test the value of the supplied argument instead.

Example:
SelectVar package    Case 8    Case 9    Case 10    Break Default    Message "You must be using shader package 8, 9 or 10" "Error"    FatalError EndSelect

If I'm understanding this correctly, you could just do something like:
If package == 8    ; Do somethingElif package == 9    ; Do somethingElif package == 10    ; Do somethingElse ; Default    Cancel "You must be using shader package 8, 9, or 19"EndIf

If I am understanding correctly, then I don't think I'll add that, as you can do it in pretty much the same ammount of code here. If that's not what you meant, then I can look at it some more.
User avatar
CYCO JO-NATE
 
Posts: 3431
Joined: Fri Sep 21, 2007 12:41 pm

Post » Wed Mar 30, 2011 11:33 am

If I am understanding correctly, then I don't think I'll add that, as you can do it in pretty much the same ammount of code here. If that's not what you meant, then I can look at it some more.

You understood perfectly - that's why I said it was a nicety rather than required - my generated script uses the construct you highlighted.

No problem at all if not implemented - thanks for considering.
User avatar
YO MAma
 
Posts: 3321
Joined: Thu Dec 21, 2006 8:24 am

Post » Tue Mar 29, 2011 11:39 pm

Wizardry team - Can you cast your eye across a problem with Surazals new BAIN starting with this post http://www.gamesas.com/index.php?/topic/1131490-relz-sensual-walks-for-female-npcs/page__view__findpost__p__17730524

Had a go at trying to figure it out but no joy. Using Wrye Bash svn 1080 - It works fine with v291, and without the imodcount inclusion, Surazal just needs a workaround for combining Integers and Strings in the note and futureproof the wizard against v292
User avatar
Sebrina Johnstone
 
Posts: 3456
Joined: Sat Jun 24, 2006 12:58 pm

Post » Wed Mar 30, 2011 10:23 am

Ooh, thanks for pointing that out, I probably would never have noticed otherwise. I posted my response there :)
User avatar
Charles Weber
 
Posts: 3447
Joined: Wed Aug 08, 2007 5:14 pm

Previous

Return to IV - Oblivion