CRMTools - Useful tools for AGS Rooms (Export Masks)

Started by Endres, Sat 01/10/2011 15:39:02

Previous topic - Next topic

Endres

Well I don't know where this fits best, so I just try to post it here.

CRMTools is my new program which uses the AGS Native Library (and some parts of the official editor sources) for extending the opportunities AGS itself has. To start off, someone asked in another forum if it is possible to resize a room by changing the background image without losing the area masks. The best possibility for this would be to export the masks and later import them again, because otherwise it is quite a huge work to set them all again. While AGS has the feature to import such masks, it doesn't have an export function. So what I basically did is to write an tool which uses a crm file and exported the chosen mask. This is so far version 0.1 of my tools.

You can download them right here.

If someone needs another room function, then let me know, maybe I will continue the development of this project and then try to include that. It would be the best though if these tools could be included in AGS straight away, but only CJ has influence about this. ;)

I hope the program could help you and I would appreciate any feedback.

Knox

Awesome, I always thought it would have been cool to export walkable areas/hotspots, etc to a bmp file...very good idea!

It would be nice that as it exports, it appends the room number to the name (WalkableAreas_Room01.bmp) or something like that.

Seems if the room is very large (3072x2304, for example), the bmp file has a large black space and the walkable mask is reduced to the top left corner by 25%.

This, again, is a very good idea!!
--All that is necessary for evil to triumph is for good men to do nothing.

Endres

Thank you!

Quote from: General_Knox on Sat 01/10/2011 19:02:23
Seems if the room is very large (3072x2304, for example), the bmp file has a large black space and the walkable mask is reduced to the top left corner by 25%.
Strange thing. I'm afraid I can't reproduce it. Even if I scale a room up to 3200x2000 or 3072x2304 I don't get any problems while exporting or importing the masks...

Quote from: General_Knox on Sat 01/10/2011 19:02:23
It would be nice that as it exports, it appends the room number to the name (WalkableAreas_Room01.bmp) or something like that.
I thought about it before, but as the user is free to modify the filename before saving I didn't include that before. Now I added this, so it will be in the next release.

Knox

Geeze I hope its ok I'm posting here but this tool is giving me this error when I try to use it in AGS 3.3:



Spoiler

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

************** Exception Text **************
System.ArgumentException: Requested value 'MultiplyTranslucenceSrcBlend' was not found.
   at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
   at AGS.Types.SerializeUtils.DeserializeFromXML(Object obj, XmlNode node)
   at AGS.Types.Settings.FromXml(XmlNode node)
   at AGS.Types.Game.FromXml(XmlNode node)
   at CRMTools.fMain.LoadRoom(String file)
   at CRMTools.fMain.bLoadRoom_Click(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.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.5472 (Win7SP1GDR.050727-5400)
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
CRMTools
    Assembly Version: 0.1.0.0
    Win32 Version: 0.1.0.0
    CodeBase: file:///C:/Program%20Files%20(x86)/CRMTools/CRMTools.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5468 (Win7SP1GDR.050727-5400)
    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.5467 (Win7SP1GDR.050727-5400)
    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.5467 (Win7SP1GDR.050727-5400)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
AGS.Types
    Assembly Version: 3.2.1.111
    Win32 Version: 3.2.1.111
    CodeBase: file:///C:/Program%20Files%20(x86)/CRMTools/AGS.Types.DLL
----------------------------------------
System.Xml
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5476 (Win7SP1GDR.050727-5400)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
AGS.Native
    Assembly Version: 0.0.0.0
    Win32 Version: 3.2.1.105
    CodeBase: file:///C:/Program%20Files%20(x86)/CRMTools/AGS.Native.DLL
----------------------------------------
msvcm90
    Assembly Version: 9.0.30729.6161
    Win32 Version: 9.00.30729.6161
    CodeBase: file:///C:/Windows/WinSxS/x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.6161_none_50934f2ebcb7eb57/msvcm90.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.
[close]

Endres was last active April 2012 though...if he doesn't respond hopefully someone else has the source code or something, very useful tool!
--All that is necessary for evil to triumph is for good men to do nothing.

Crimson Wizard

#4
I actually wonder why would it need to know the game's general option value, isn't it supposed to work only with rooms?
@Knox, did you copied it into AGS folder (or copied AGS 3.3.0 libraries into CRMTools folder)? Just a thought, but what if it somehow loaded 3.3.0 AGS.Types.dll instead of the one supplied in the CRMTools archive?

Other than that, in my personal opinion, this functionality deserves to be incorporated into Editor itself).

Endres

I may upload the source code of CRM-Tools, but this must have to wait until next week.
I actually wonder, too, why there is a problem with the game.xml. Have you tried to move the room-files to somewhere else and loading them then in CRM-Tools? Unfortunately I did not work on this program for more than two years, but of course I will try to support you.

I also thought that this should be a feature of the Editor.

Knox

Well I have the tool unzipped to a folder on my desktop, double-click the .exe, then I grab the room file I need...then that error pops up. Do I need to something else special? *(I also tried moving a room directly into that desktop folder with the CRM files, no luck).

BTW: Having this as a feature would be a really good idea!
--All that is necessary for evil to triumph is for good men to do nothing.

Crimson Wizard

#7
I tested the program a bit, and it looks like it actually calls AGS.Native initialization routine, which does a lot of excessive stuff, including loading the game data (I think, although not sure); this is why it requires game.agf too (so you probably can't open rooms from anywhere, you can only open rooms from you project folder?).
Also it will not work with any future versions of AGS, because of the data format changes.

UPD: On other hand, as it seems, you can copy new AGS dlls in CRMTools folder, and it will use them. Not sure, if that's fully correct, because in such case I get another error:
Quote
System.NullReferenceException: Object reference not set to an instance of an object.
   at CRMTools.fMain.LoadRoom(String file)
   at CRMTools.fMain.bLoadRoom_Click(Object sender, EventArgs e)

Hmm... I also get same error when opening room from 3.2.1 project :(.


@Endres, if you are planning to work on this program further, I may suggest looking into monkey_05_06's work on picking out the room loading algorythm from C++ to C#: https://github.com/adventuregamestudio/ags/tree/multi_room_edit
What he did is basically a C# class that knows how to read 3.+ rooms into memory.

Monsieur OUXX

I don't know if what I'm about to say makes any sense technically, but my intuition tells me it's the right place to say it :
At the moment AGS has trouble allowing parallel development, because (for example) two people cannot edit a room script together, or they can't add a room to the agf file at the same time on two different machines.

Adding a feature to merge room files, or to merge the "rooms "section of the ags file, would allow to host the game on a versioning system (cvs, git, svn...) and enable parallel development.
 

SMF spam blocked by CleanTalk