Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - bx83

#502
Hi, is v0.2 (export backgrounds to png format) still around? All I can find is v0.6, which exports to .alpha
Btw which compiler do you use for the plugin? Visual C? I'm not versed in anything but AGS but I'll recompile if I absolutely have to :p
#504
Which version? Not version 0.6, and there's no other on the code page (or the site, which is down).
This would be perfect for me (and for the code to make the export button) - is it a whole section of code or just a switch (SaveAsPNG)? Is it still in the 'master' branch? (doesn't seme to be any others)

Also in 0.6 there's some code that appears to export to PNG's:

Code: ags

        private void WriteBackgrounds(XmlTextWriter output, ILoadedRoom room, string roomName)
        {
            output.WriteStartElement("Backgrounds");
            for (int j = 0; j < room.BackgroundCount; j++)
            {
                using (Bitmap bmp = new Bitmap(room.Width, room.Height))
                using (Graphics g = Graphics.FromImage(bmp))
                {
                    // NEW - store as seperate .png file
                    editor.RoomController.DrawRoomBackground(g, 0, 0, j, 1);
                    string roomFileName = PathRoomBackgrounds + GetValidPath(roomName) + "_" + j + ".png";
                    //MessageBox.Show(roomFileName);
                    bmp.Save(roomFileName, ImageFormat.Png);   //THIS LINE
                }
            }
            output.WriteEndElement(); // Backgrounds
        }


...but not in the plugin GUI. So... I dunno :/
#505
AHA! Indexed Colour - thank you Privateer :D
I got confused because I kept thinking RGB more or less meant 256 colour, and... I don't know :tongue:
#506
Quote from: Crimson Wizard on Sun 08/04/2018 01:37:01
Seriously, you are becoming one of the most obnoxious people I've met on this forum. What's with all that making those large unnecessary hysterical posts?
We already got your request. No need to repeat same things over and over again.

Okay, I'm sorry. Please don't get mad or read my posts imagining a hysterical voice; I am only trying to learn the AGS system. I understand Rome wasn't built in a day.
I thought someone would respond with 'good idea, we'll get straight on that and have a release in MM, YYYY' or 'No, *@& off, too hard.'
I did not realise that simply making the post would put it in the feature request cue. Once again, I'm sorry.

Quote from: Crimson Wizard on Sun 08/04/2018 01:37:01
BTW, The fact that AGS does not accept your 8-bit BMPs means only that you are not saving BMPs correctly.

Alright, fair enough - but how *do* I save them properly?
I must change the image, in order at least to resize.
If I save in paint.exe as a 256-colour BMP, it reduces the quality of the colours, making them useless to re-import.
If I use Photoshop CS6, it does not offer the option to save it as 8-bit.
If I save it as a PNG, it doesn't offer colour changing, and remains 16/24/32 bit. Probably because it's a compressed image and I'm not using 8bit colour on my screen (which in fact, I'll try next)

Quote from: Crimson Wizard on Sun 08/04/2018 01:37:01
You must understand, that AGS is practically a dead project. Less and less people working on it. And when they do, they do it when they have spare time and interest. No one here is obliged to do things for you.
If you want something done now and fast, then hire a programmer and bug them instead.

True. I will try. But the last time I did offer $2,000, nobody took it up. I'll try another programmger hire site.

Quote from: Crimson Wizard on Sun 08/04/2018 01:37:01
Quote from: bx83 on Sun 08/04/2018 01:28:32
If anyone can show me:
1. How do I export a copy of the walkable areas via screenshot at 1024x768
2. then resize image to 1920x1080
3. and then reimport

I guess when people want to have a mask in a file, they don't create it inside AGS in the first place. Instead they make masks in the image editor, e.g. as a separate layer, and keep editing them there. This way you do not need to export/import, only reimport from file.
TBH the thing that you keep doing this tedious procedure made me very surprised. Personally, I'd never do such thing, as soon as I see how difficult and time consuming it is.

I will try to import a background image and work on the image in a separate layer. However, this doesn't take care of saving, what editor or format, etc.

I don't know, I'll leave the export till much later and hopefullly someone has figured something out in code.
#507
Quote from: Privateer Puddin' on Sun 08/04/2018 01:08:49
As you said, there's been one post about it since 2009 so there's not a lot of demand. Now, you've requested it again and if there's someone working on the editor, maybe they will add it.

Maybe. Great.

Quote from: Privateer Puddin' on Sun 08/04/2018 01:08:49
I don't think anyone here is arguing the feature wouldn't be useful, but as realistically looking at it there may not be any active development of the editor, trying to offer you help in improving your workflow (with photoshop alone you can speed that up and save to the correct format) but you already declined that support.

I did no such thing.
If anyone can show me:
1. How do I export a copy of the walkable areas via screenshot at 1024x768
2. then resize image to 1920x1080
3. and then reimport

Be my guest, please. As *8bit* PNG, or *8bit* BMP without changing colours. I cannot find a single way it can be done (perhaps in 320x200, but not anything larger with ease).
I've tried more ways than I've shown here in tutorials. None work.

What I don't understand is, if there's already an *import* function (for background image), why not an export (for walkable areas)? Why not take the background image import, reverse commands for a BMP/PNG/whatever, and so export it?
#508
Okay, ignoring JPEG because I probably accidentallly imported image as background instead of mask, here's steps to do it on a BMP:
1. Take a screenshot, open it in Photoshop CS6:


2. Spend 5 minutes trying to cut it pixel perfect to the desired resolution:


3. Save as a BMP... but not be given any option to do 8bit. Hmm. Well, see how it goes:


4. Not great - AGS rejects it for having too many colours.
Okay, import it into Paint.exe:


5. Be warned that this will change colour quality (why?). Import into AGS, be given this error:


6. Be left with this. Bravo.


Okay - let's take photoshop out of it. Let's import the screenshot as a BMP, and save it in Paint.exe as an 8bit BMP:
1. Take a new screenshot, saved as BMP, open in Paint.exe


2. Grab the area of the actual background; I did it free hand, and did it pretty nice. This a 1024 background on a 1920 screen.
But there are some bad grey bits about 2 pixels out of the edge of the image. Since I didn't believe I could get the proper image, I zoomed in a bit to make it easier; and then when the select area didn't scroll for me, I was stuck:


3. I saved it as a BMP 8bit, preparing to open it in Photoshop, zoom and cut to exact size, then select the whole area and paste it back into Paint.exe.
Except then it said that "the colour quality will be reduced", and I was back where I started.
So then I drew on the image, expressing my anger, and threw the entire thing out.


This took 45 minutes.

So please explain to me: WHY not write the 25 lines of code to export the walkable areas/regions/hotspots/etc. as an 8bit BMP file? WHYYYYYY?
Also, this is ignoring what would happen if I had 1920x1080 backgrounds; which was what I was trying to do in the first place! There wouldn't be enough screen realestate to do a proper screenshot.

We could just get rid of all this mumbo-jumbo bs, and instead of trying an exact sequence of events, we could just ADD AN EXPORT BUTTON.
#509
Cool.
Snarky I meant neither of these image formats have support in photoshop for saving as 8bit colour in a format that ags will accept. Only jpeg (ironically) seems to work. I'll give it another go and see if I can record exactly the steps I take.
#510
And neither of which actually works in paint and photoshop. :/
Could you just add an export function? Pretty please :p
#511
A feature request. If it's so obvious to go through minimum 3 things to save as a jpeg, why isn't as easy to export as a jpeg?
#512
We all know there is an easy way to *import* these masks, but no easy way to export them (which makes no sense to me, surely you'd just reverse the import porocess...?)
There is no clear way to *export* the masks.

After much pain, I manageed to:
-take a screenshot, on a white background (which you've had to cut to size and re-imported into the editor), of 0% transparency
-copy to clipboard, paste into Paint
-save as a .png file
-open in Photoshop CS6
-change mode to RGB/8bits
-save as a .jpg file
-enlarge the mask to a new screen size
-reimport the mask back into the editor

Here's what might have been easier:
-export the walkable areas/walk behinds etc. into one file
-...

That's it. This would be so, so, so much simpler. But yet there's only one post about this from 2009 with no editor change? I mean WTF? Wouldn't you just reverse the function of import and make it export? Please please tell me something cogent about this.
#513
Beginners' Technical Questions / ignore
Fri 30/03/2018 10:56:03
ignore
#514
Beginners' Technical Questions / ignore
Fri 30/03/2018 04:19:20
ignore post
#516
It work's perfectly :D

But one more problem; it doesn't go away after the dialog finishes. Where is the exit point for the dialog script?

EDIT: found the closing statement in the dialog script:
Code: ags

...
cCharacter.Say("Goodbye")
Stop


But putting a 'gFakeDialogOptions.Visible = false;' at the end of every single script (after 'goodbye', before Stop) is, like, 60 scripts that needs editing. I would rather replace this with one line in a function, but I don't know where this function is.
Can't put it directly after 'dDialog.Start();', as Dialogs are non-blocking and this statement does nothing.
Is there a function like 'IsCharacterInDialog' or 'RunThisAtTheEndOfDialog'? It seems you .Start the dialog and then... the programme just dissapears into a dialog script. I don't really know where the compiler is after dDialog.Start

dialog_request look's promising, in that it can run StopDialog()....? Doesn't look workable for a dialog though, only a text parser (whatever the hell that is :P).
#517
So just add the definition outside the functions in GlobalScript.acs? Isn't that illegal?
#518
Here's my code so far. I've created a GUI called gFakeDialogOptions in the editor.

Code: ags

function dialog_options_get_dimensions(DialogOptionsRenderingInfo *info)
{
  info.X = 0;
  info.Y = 704;
  info.Width = 1024;
  info.Height = 64;
}

function DrawDialogOptions(DrawingSurface *ds, DialogOptionsRenderingInfo *info)
{
  int i = 1, ypos=0, xpos=0;
  ds.Clear(15);
  while (i <= info.DialogToRender.OptionCount)
  {
    if (info.DialogToRender.GetOptionState(i) == eOptionOn)
    {
			String str = info.DialogToRender.GetOptionText(i);
			int cur_img = str.AsInt;
			ds.DrawImage(xpos, ypos, cur_img);
			xpos+=64;
	}
    i++;
  }
}

function dialog_options_render(DialogOptionsRenderingInfo *info)
{
	DrawDialogOptions(info.Surface, info);
}

function dialog_options_repexec(DialogOptionsRenderingInfo *info)
{
	int i = 1,  xpos = 0;
  while (i <= info.DialogToRender.OptionCount)
  {
	 if (info.DialogToRender.GetOptionState(i) == eOptionOn)
    {
      if (mouse.y >= info.Y && mouse.x >= xpos && mouse.x <= xpos+64)
      {
        info.ActiveOptionID = i;
				return;
      }
			xpos+=64;
    }
    i++;
	}
}

function dialog_options_mouse_click(DialogOptionsRenderingInfo *info, MouseButton button)
{
	if (info.ActiveOptionID > 0) {
		DynamicSprite *MyDynamicSpriteForTheFakeGUI = DynamicSprite.Create(info.Width, info.Height, true);
		DrawingSurface *ds = MyDynamicSpriteForTheFakeGUI.GetDrawingSurface();
		DrawDialogOptions(ds, info);
		ds.Release();

		gFakeDialogOptions.X = info.X;
		gFakeDialogOptions.Y = info.Y;
		gFakeDialogOptions.Width = info.Width;
		gFakeDialogOptions.Height = info.Height;
		gFakeDialogOptions.Clickable = false;

		gFakeDialogOptions.BackgroundGraphic = MyDynamicSpriteForTheFakeGUI.Graphic;
		gFakeDialogOptions.Visible = true;
		info.RunActiveOption();
	}
}


QuoteYour second video shows that it's close to working. It looks like you're either showing the wrong GUI, drawing to the wrong GUI, or using the same GUI or dynamic sprite for the fake dialog options as for the speech bubble module.

None of these apply (I think; look at the code).
As for SpeechBubble (v0.8.0) using GUIs as well, perhaps there'e some cross-over? Though there's no GUI of the same name in SpeechBubble.
#519
Quote-What you have done (in this case, what you've done differently than in previous attempts)
Wrote the code crimson wizard wrote.

Quote-What you expected to happen
A copy of the GUI would be displayed.

Quote-What did in fact happen
Selecting a question did the same as before; speech erased the dialogue options window, and it was only brought back when speech was over.
This happened with your code also.

QuoteLet's say the fake GUI you've created is called gFakeDialogOptions, set to Visibility: Normal (initially off). Try this:
How do you define the GUI? With 'GUI *gFakeDialogOptions = ???' or by designing a GUI with this name in the editor?

Still don't fully understand it; but copying all code as you write it.

Here's a video of what happens (by designing the GUI in the editor;
this
#520
Quote-What you have done (in this case, what you've done differently than in previous attempts)
Wrote the code crimson wizard wrote.

Quote-What you expected to happen
A copy of the GUI would be displayed.

Quote-What did in fact happen
Selecting a question did the same as before; speech erased the dialogue options window, and it was only brought back when speech was over.
This happened with your code also.

QuoteLet's say the fake GUI you've created is called gFakeDialogOptions, set to Visibility: Normal (initially off). Try this:
How do you define the GUI? With 'GUI *gFakeDialogOptions = ???' or by designing a GUI with this name in the editor?

Still don't fully understand it; but copying all code as you write it.

Here's a video of what happens:
this
SMF spam blocked by CleanTalk