00din's B&W2 Script Tool

00din

New member
Joined
Mar 15, 2003
Messages
17
This project is not done yet, but I've already included some nice features that really improves the scripting experience.

Features:
  • Tabs to edit more than one script at a time.
  • Quick access to enums.
  • Open all scripts referenced in your challenges.txt. This will automatically set the Input and Output paths. ("Open Project" button or CTRL+SHIFT+O)
  • Compile the project and get the feedback in the debug textbox ("Compile" or F5).
  • Search the currently selected script for a specified string (press enter to get the next instance of that string).
  • Line number is displayed for debugging.

B&W2 Script Tool




Enjoy!  :woot
 
TheCraziestMonkey said:
So this tool will make it all around easier to script?
Exactly! Try the beta. It has a few quirks, but nothing serious. :)
 
I hate to say it. But it don't work for me. :(

I changed the pathes to one of my maps and the compiler did run with usual windows error message. But there was no .chl file created and in the result window it showed as only compiling two out of eight scripts.


Also, when trying to open a script, I get a blank page and the following error in a popup. (WinXP SP2)

Code:
See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.MissingMethodException: Method not found: 'System.String System.Windows.Forms.OpenFileDialog.get_SafeFileName()'.
   at BnW2_Script_Tool.mainForm.openProjectToolStripMenuItem_Click(Object sender, EventArgs e)
   at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ToolStrip.WndProc(Message& m)
   at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.42 (RTM.050727-4200)
    CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
B&W2 Script Tool
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///D:/Black%20%26%20White%202/Tools/Script%20Compiler/B%26W2%20Script%20Tool.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.42 (RTM.050727-4200)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.42 (RTM.050727-4200)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.42 (RTM.050727-4200)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
 
Monkey, I'm glad you like it. :)
If you have any suggestions please post them here.


Kays, do you have .NET 3.5 installed? The error you get states that it can't find one of the standard methods. ???

By the way, you can use Open Project if you want to compile.
 
I'll make it save all open scripts before compiling. Any objections?

I've also made it display an asterix in the tabname when a script has been modified since the last save.
 
New: When you open a project a list will be generated of all your defined scripts. Double click on one to insert the code in your currently selected script.



I'll upload it when I've made sure that everything is still running smoothly. :cool:
 
00din said:
Kays, do you have .NET 3.5 installed? The error you get states that it can't find one of the standard methods. ???

By the way, you can use Open Project if you want to compile.

Installing .NET 3.5 got it to work. I couldn't open a project either. Got the same error.  The problem with it not compiling was with the script. No errors, it just stops. But any other script seems to compile without problem.

I like it. It puts every in one place and takes the mystery out of using the compiler. 

00din said:
I'll make it save all open scripts before compiling. Any objections?

How about making it optional?
If someone was using a text editor instead and that file was also open in the scripting tool. Any changes made in the text editor will be over written.

I've also made it display an asterix in the tab name when a script has been modified since the last save.

That's a good idea.



A few suggestions:

A way to close a project or display each project seperately. Right now if you open a second project all of those files are added to the existing open files.

A popup window to define the path and name of the output fiie. Right now it defaults to the name of the challenges.txt file. Maybe even the option to output it directly to the Scripts/BW2 folder

And a button to launch the game. :D

But other than that, it's a great tool and will remove some of the frustrations of scripting.
 
Oh yes I had to forget to mention how well your tool ran on my pc. As far as I know it works on Vista(though designed in XP) and it is simply brilliant. I must admit that I have using it these past few days, to make my scripting go much better and its easier to navigate in the same window rather than opening several text files for each of the enums(once again it wouldn't be a problem because I use Windows Aero).

But an excellent effort so far.  :)
 
Kays said:
The problem with it not compiling was with the script. No errors, it just stops. But any other script seems to compile without problem.
Umm... Remember to turn on the DB if your script uses any "say" or other DB commands. That's the only thing I can think of.

I like it. It puts every in one place and takes the mystery out of using the compiler.
Good. That was one of the reasons I wanted to make this. :)

How about making it optional?
If someone was using a text editor instead and that file was also open in the scripting tool. Any changes made in the text editor will be over written.
Good point. I'll make a settings window.

A way to close a project or display each project seperately. Right now if you open a second project all of those files are added to the existing open files.
That'll require some reworking of the code, but can be done.

A popup window to define the path and name of the output fiie. Right now it defaults to the name of the challenges.txt file. Maybe even the option to output it directly to the Scripts/BW2 folder
Lionhead's compiler is a bit screwy, but I'll see what I can do.

And a button to launch the game. :D
That should definitely be possible. Good idea. :)


Thanks, Daxter. :)
 
I've uploaded the version with the changes mentioned earlier. Most notably of which is the list of defined scripts.

B&W2 Script Tool

Next I'll implement Kays suggestions and whatever else I can think of.
 
Cool, looking forward to seeing it.

A bit late on it, but I've just added the latest version to our downloads.

http://www.bwfiles.com/files/index.php?action=file&id=975

Also stickying this topic. :)
 
Now I know why it took so long for me to get around to doing this.  :shocked

Or maybe I'm just tired and stuff...

In case anyone is wondering: The next update will make the tool more project oriented, which basically means that it will take care of more stuff for you. The treeview (see pic) should also make it easier to work with many files at a time.
 
Back
Top