Experimental AGSEditor *BUFF* Edition!

Started by Shane 'ProgZmax' Stevens, Thu 18/11/2010 16:39:01

Previous topic - Next topic

Calin Leafshade

#20
Quote from: ProgZmax on Mon 22/11/2010 11:28:31
It loads fine, the swatch cannot adjust to the engine-custom colors because the 0-31 values are kind of a hack that auto-assigns every 8 units of Blue up to 248 a specific color, so 8=1, 16=2, all the way up to 248=31.  You can test this with the palette form.  Unfortunately there's no way of making the color swatch match a color that's being assigned in this fashion, though as I say, entering in these values will resort in the proper in-game color.

I'm not entirely sure how the property grid color picker works in windows forms (as opposed to WPF) but surely the function that returns the colour is a virtual one and thus can be overrided with a wrapper class.

EDIT:

After looking up the control it should just be a matter of changing the accessor function for the colour.

something like

Code: ags

    [CategoryAttribute("Speech Settings")]
    public Color SpeechColorVal
    {
        get { 
                //special cases or just set normal values
               }
        set { 
               //special cases or just set normal values
               }
    }


You'd also need to alter the accessor function for the SpeechColor value too i suppose.

I apologise if this is not the case but I see no reason why not since the engine has no dealing with this colour value anyway, providing the original speech value is still the same.

tzachs

Quote from: ProgZmax on Mon 22/11/2010 11:28:31
And as I already explained, this is so you can place the character with precision since character x and y values are based on the bottom center of the sprite.
I understand your reasoning, but it's still feels a bit weird, and possibly there's a better way.
I thought of maybe moving the character towards the cursor instead the other way around, but on second thought, that would be even worse for the user.
Maybe just placing a marker at the bottom center of the character instead?

Quote
...And neither are objects.  Scaling items in the room editor based on walkable area scale values would be extremely dodgy, particularly due to the zoom feature.  It might be something I'll look at later, but aside from yourself I'm sure many many people will find it useful as it is.
Agreed on all accounts. It will be difficult to implement, but worth it.

Quote
It loads fine, the swatch cannot adjust to the engine-custom colors because the 0-31 values are kind of a hack that auto-assigns every 8 units of Blue up to 248 a specific color, so 8=1, 16=2, all the way up to 248=31.  You can test this with the palette form.  Unfortunately there's no way of making the color swatch match a color that's being assigned in this fashion, though as I say, entering in these values will resort in the proper in-game color.
Pretty much what Calin said.
No need to alter the setter though (since the swatch will not allow for 1-31 colors anyway), but changing the getter to something like this should do the trick (unless I'm missing something):

Code: ags

    [CategoryAttribute("Speech Settings")]
    public Color SpeechColorVal
    {
        get { 
                   //getR, getG, getB, are the methods I mentioned earlier
                   int R = getR(SpeechColor);
                   int G = getG(SpeechColor);
                   int B = getB(SpeechColor);
                   return Color.FromArgb (R ,G ,B);
            }
        set { 
                  ....
            }
    }


Quote
No.  SpeechColor is an integer property and for the purposes of the editor loading must remain one for now (especially for backwards compatibility).  SpeechColorVal is a Color property that converts the color swatch value (R,G,B) back into an engine compatible color. 
You can change the display name of a property without changing the real name of the property (with a DisplayNameAttribute), so that's not really a problem. Simply put:

Code: ags

    [CategoryAttribute("Speech Settings")]
    [DisplayNameAttribute("Speech Color")]
    public Color SpeechColorVal
    { 
       ....
    }

Guybrush Nosehair

How were you able to alter the editor when AGS is closed source?


Shane 'ProgZmax' Stevens

#24
*[DisplayNameAttribute("Speech Color")]

Good idea with this!   I've already changed the display property name back to SpeechColor as well as the other GUI properties.


As far as visually displaying the 1-31 reserved colors, it doesn't work because these values are locked and don't display any 'real' value by number except in the palette form (and in game).  These values are drawn from a palette array loaded by the editor at runtime and I'm still looking for a way to access it from character.cs.

For instance, if you put 2 into the palette form in the editor it will display GREEN (R=0,G=0,B=16), but when you open 'find colour' it corresponds to very dark blue.  No conversion process will yield them because they are literally arbitrary values placed in the palette array that are drawn out when 0 < SpeechColor < 32 (or 0 < color.Blue < 249).  If I could directly access the Factory class in characters.cs it would be a simple matter of altering my existing code to the following:

Code: ags

set
{
     Game game = Factory.AGSEditor.CurrentGame;  //creates a reference to the currently loaded editor.

     Color colortemp = value;

               //if Blue is non-zero and R and G are zero then we have the special condition preset palette values to load
               //this assumes you are entering multiples of 8 for each index
                if(colortemp.R == 0 && colortemp.G == 0 && colortemp.B > 0)
                {
                     colortemp=game.Palette[color.B/8].Colour;

                }
                    //existing code that converts the RGB color into an AGS-compatible integer value

                    _speechColor = (colortemp.B / 8) + ((colortemp.G / 4) << 5) + ((colortemp.R / 8) << 11);

}




So you have to draw the color from the Palette array since a value of 0,0,8 doesn't really generate pure blue, 0,0,16 doesn't really generate green, and so on.  These are special reserved colors ags uses internally.  If/when I track down a reference to Factory I can use from within Characters.cs then I'll be able to do the above but it's still more or less a 'hack' imo since the color swatch you'd see when entering 8-248 for Blue wouldn't be a product of the actual RGB values entered.  This is why I didn't mess with it in the first place since these preset colors still work in game when you enter the proper value for Blue.  Note that with the above, after you press enter the RGB value you typed in would change to the actual RGB value of the color stored in the palette index, which may confuse some people but is unavoidable.

A better alternative I've been looking into would be to get the RGB values of all the preset colors and re-order the swatch custom colors grid with them in their 1-31 order.  I think that all of them are already represented on the grid in fact, and this should obviate the need to enter in the shortcut values to get them.  

Edit:  Sorry I missed this:

QuoteMaybe just placing a marker at the bottom center of the character instead?

Not really ;( .  The reason I say this is because the mouse coords displayed reflect the mouse position so you aren't going to have a 'precise' idea of where the character is located in this way, which is especially important when over walkable areas, for example.  Is the way the mouse placement works with characters really a problem?  A few people have told me that they like the precision it offers so I was actually considering moving the mouse cursor for objects to the upper left corner so that they, too, could be placed with absolute precision.  I do think the current approach works if you give it a chance, though :) .


I'm currently in the process of cleaning up code and commenting every major change I made so it should be easy to follow along and integrate into a future combined release.  The major addition was a new filter file called CharactersEditorFilter.cs which contains all the functionality for displaying and moving around (and is functionally SIMILAR to ObjectsEditorFilter.cs).  Barring any new bugs found or feature requests that I can readily implement, I should be able to release the source this week, possibly Friday.  Then anyone can take what I've done here and integrate it into whatever they're working on ^_^. 

Hopefully CJ will find the time to check out the build and offer his approval and/or suggestions.




Calin Leafshade

#25
Isnt Factory a static class?

I'm fairly sure you can reference the game *directly* from Factory.

Isn't that the whole point of having a global static factory class like this?

What I mean to say is that you dont need to make an instance of it. You can just use the factory reference directly from the setter method.




Shane 'ProgZmax' Stevens

#26
Factory is part of AGS.Editor and character is part of AGS.Types which means I basically have to go through and create and initialize a reference to Factory.AGSEditor.CurrentGame to get it to show up in AGS.Types..

Which I have now done.  I find creating references between projects to be quite a bother but it's part of the deal...


This release restores some original property display names and allows you to see the reserved AGS colors (0-31) by entering 0,0,x, where x is a blue value between 0 and 248 (in units of 8 ).  

AGSEditor BUFF Bugfix Edition C

tzachs

MediaFire gave me an "invalid or deleted file" message..

Sslaxx

#28
[No longer necessary.]
Stuart "Sslaxx" Moore.

Shane 'ProgZmax' Stevens

#29
First post always has the latest version :).  I made a tiny fix for imported guis from old versions of ags that would import backgroundimage with a -1 value if there was no image loaded  (oddly enough, this happens in spite of code cj already had in place to prevent it).  Once I get back a few more reports that this build is stable I'll release the source, which may not be today because I have only received about 3 reports so far...

Shane 'ProgZmax' Stevens

Source has been released.  See the first post for details!

Joe

Congratulations on realising this version, I really like it and will use it for my next game, hope this version gets everyone's support!!
;)

Joe
Copinstar © Oficial Site

Knox

Will there be some sort of version that will "combine" various other people's features into this one as a single-major updated version? Seems to be a few versions out now by various peeps, it would be cool to get all those together in one!
--All that is necessary for evil to triumph is for good men to do nothing.

Calin Leafshade

I've just integrated Progz's work into my editor (or rather the other way round)

http://www.adventuregamestudio.co.uk/yabb/index.php?topic=42092.0

Joe

What does "Drawing modes are no longer continuous" mean?
Copinstar © Oficial Site

Shane 'ProgZmax' Stevens

It was a bug that appeared after I initially added characters to rooms where line draws and such would keep drawing even after you released the mouse button.

dbuske

#36
I am using your new version of the editor.
I like it alot.  Especially the inclusion of the sound and music directoies right in the editor, very helpful and speeds things up.
Not a complaint, but the character showing up in room edit isn't very useful yet.  But it is nice to see where the character is in the room without running the game.
Good work.

I did notice that you removed the play music on load tab from the room area.
What if your blessings come through raindrops
What if your healing comes through tears...

Calin Leafshade

actually those changes you mention were already in the 3.2 version of the editor made by CJ.

The official version is still 3.12

Gilbert

Well, the official version of AGS IS V3.2, but the "official official version" is still V3.12 (if you understand what I mean). The beta/announcement thread wasn't that active lately, so it was pushed to page 2 of the listing. I have just stickied it to make it more visible (...or not) .

Shane 'ProgZmax' Stevens

#39
Looks like I packaged an old version of ikMP3.dll that doesn't like the editor.  I've uploaded a working version so mp3 files will play properly in the editor (this doesn't affect in-game sounds, just the editor).

http://www.mediafire.com/?xa21v9n2r1s88w5


SMF spam blocked by CleanTalk