A redesign of the AGS site is being planned! Please check out the mockups and give your feedback.


Two factor authentication (via app or email) is now available for the forums. You can enable it on your profile.

Author Topic: CRMTools - Useful tools for AGS Rooms (Export Masks)  (Read 4615 times)

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

  • Storm Behind The Badge
Re: CRMTools - Useful tools for AGS Rooms (Export Masks)
« Reply #1 on: 01 Oct 2011, 19:02 »
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.

Re: CRMTools - Useful tools for AGS Rooms (Export Masks)
« Reply #2 on: 01 Oct 2011, 20:33 »
Thank you!

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...

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

  • Storm Behind The Badge
Re: CRMTools - Useful tools for AGS Rooms (Export Masks)
« Reply #3 on: 02 Dec 2013, 00:38 »
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: ShowHide

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.DeserializeFro mXML(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.ControlNat iveWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNat iveWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callb ack(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.


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.

Re: CRMTools - Useful tools for AGS Rooms (Export Masks)
« Reply #4 on: 02 Dec 2013, 07:34 »
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).
« Last Edit: 02 Dec 2013, 07:39 by Crimson Wizard »

Re: CRMTools - Useful tools for AGS Rooms (Export Masks)
« Reply #5 on: 02 Dec 2013, 18:11 »
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

  • Storm Behind The Badge
Re: CRMTools - Useful tools for AGS Rooms (Export Masks)
« Reply #6 on: 03 Dec 2013, 15:20 »
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!
« Last Edit: 03 Dec 2013, 15:23 by Knox »
--All that is necessary for evil to triumph is for good men to do nothing.

Re: CRMTools - Useful tools for AGS Rooms (Export Masks)
« Reply #7 on: 03 Dec 2013, 15:26 »
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.
« Last Edit: 03 Dec 2013, 17:22 by Crimson Wizard »

Monsieur OUXX

  • Mittens Vassal
  • Cavefish
  • Mittens Half Initiate
    • I can help with proof reading
    • I can help with translating
    • I can help with voice acting
    • Monsieur OUXX worked on one or more games that won an AGS Award!
    •  
    • Monsieur OUXX worked on one or more games that was nominated for an AGS Award!
Re: CRMTools - Useful tools for AGS Rooms (Export Masks)
« Reply #8 on: 03 Dec 2013, 16:20 »
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.