opening sprite files from the editor question...

Started by miguel, Fri 15/01/2010 09:39:01

Previous topic - Next topic

miguel

Sorry if this was talked about before but after a quick search I didn't find anything.

My question is:

When opening a sprite with the paint program that I defined as default for the purpouse of correcting, say, minor pixels, I have to "Save As..." to a previous sprite file, quit and re-import the sprite.
I can't just save it and quit & return to AGS editor because the transparent pixel will not work thus having a colored square surrounding the sprite.

Is this common or am I doing something wrong?
I'm using 3.1 SP1
Working on a RON game!!!!!

Khris

As a workaround, you can use the "magic pink" (255,0,255) as background color.

miguel

Is this the same pink color MSPaint has on it's palette?
Working on a RON game!!!!!

abstauber


miguel

it doesn't work somehow,
I save the ags sprite file and quit, returning to the editor and the sprite gets color squared even with the magic pink!
I must be really dumb, oh well I just save it and reimport it
Working on a RON game!!!!!

monkey0506

Is the magic pink pixel appearing only in the editor, or is it actually showing up in-game? Because the transparent pixels should show up pink in the editor.

Also you mentioned using "Save as..." When you're using the editing feature, do not use "Save as..." just simply use "Save". That's because AGS writes the sprite to a temporary file and has to read it back from the same file otherwise your changes won't be registered.

Another thing to check is to double-click on the pink in MS Paint and make sure it has the exact RGB values of (255, 0, 255). If it's even slightly different (i.e. if you saved a similar but different color to that slot) then it will not work.

My final question would be, you're not using an alpha channel on this sprite are you? If your game is 32-bit and you have an alpha channeled sprite then MS Paint won't play nicely with your sprite to begin with seeing as it doesn't support alpha channels at all.

So pending all of this, try testing your game and see if the sprite is in fact showing up with the pink pixel.

miguel

#6
sorry for only answering now monkey_05_06,

well, the sprites in the editor do show up pink and I'm using 16bit graphics on the game...
I do use "Save" to save the file regarding it's a internal file from AGS, I use "Save As..." to save the sprite and then reimport it as I don't seem to get it working.

I'll try and edit the sprite in photoshop and not MSpaint and get back to you...

Thanks

----Not working, does everybody use alpha channels? Is that the reason I can't get it to work?------
Working on a RON game!!!!!

Khris

Edit a sprite, then Save (NOT Save As), quit the paint program, then run the game and see if the sprite's transparency is also gone in-game.

(I opened the default game, double clicked the key sprite (yellow on black, black being transparent in game), edited a few pixels in PSP7, then saved and quit. In the editor, the key now had a pink background but would still show up in-game correctly.)

Writing this, I thought of something: I changed the transparency setting to bottom-right pixel, and as soon as I did that, it didn't work any longer. The sprite had lost its transparency completely after returning to AGS.
Not even yellow was transparent now, although the bottom right pixel is yellow.

miguel

Ok, well I've been doing just that Khris,

Edit a sprite, Save, then Exit. Ran the program and it was pink squared...

Then I did all those steps again but before starting the game I did "revuild all files" first, but the result wasn't better...
Working on a RON game!!!!!

monkey0506

I think you're still not understanding miguel. It is SUPPOSED TO have the pink area wherever there is transparency. This is what SHOULD appear in the editor. This is BY DESIGN. This is functioning AS INTENDED. This is CORRECT BEHAVIOR.

When you RUN the game however, these pink areas should not show up in the sprites and should be transparent.

miguel

I know that monkey,
when I say the sprite is pink squared I mean during testing my game...

This is what's happening: when I import a sprite and set it's transparent pixel being top-left or whatever position, it works;
                                     when I import a sprite and the background color is "magic" pink, it works;
                                     WHEN I try to edit a sprite using AGS option to do so, and after SAVING the sprite, when quiting the paint program (PAINT and PHOTOSHOP7 used) it does not work, runing the game will show that sprite pink squared and not transparent as it should appear.
Working on a RON game!!!!!

Danman

Maybe you should set a transparency in Photoshop. I think in edit or something there is an option set color to transparency that should work then Instead of magic pink. Just as one solution ;)



barefoot

#12
Sometimes when editing sprites in a paint program, I use psp7, you sometimes get an 'off colour', normally aound the border and is slightly lighter then the background,
(if you select top right pixel in AGS for example it will pick up that colour)

Open the sprite in your paint program, magnify it and check that the whole of the background is all one color. If you find an off color on the borders then select background colour and brush over the new colour.. Simples.. Then copy to clipboard and paste sprite back into AGS..

I sometimes find this myself... and this works everytime

barefoot

I May Not Be Perfect but I Have A Big Heart ..

miguel

well guys, I've done all that and can't get it to work...

There's no problem here, as I just workaround it,

to all that helped me I thank you and wish for happy game making.
Working on a RON game!!!!!

Danman

#14
Just out of curiosity if you set the color to transparency what color does it go in AGS? ???

EDIT: I am sure certain formats don't support transparency.



miguel

I did just a small sprite, yellow filled circle on a red background.
imported to AGS and chose top left pixel as transparent, tried during game play and it worked;
next I opened the sprite editor (photo7) and just painted the background blue, assigned blue as transparent, saved and quited back to the editor.
The result is a blue box with a yellow circle in the middle...

anyway, thanks for the help, I got used to it and it's not a big deal anyway.
Working on a RON game!!!!!

Danman

I am pretty sure some formats don't support transparency maybe that is the problem. When you save the file using save as. It tells you what formats support layers and transparency. If you know what I mean.

Instead of choosing a color then try using the magic erase tool. If that don't work then I give up. 



Khris

I wanted to test this; the weird thing is, if I set PS CS2 as the editor and double click a sprite, I can't edit it at all in Photoshop; no matter what tool I select, the cursor stays in hand mode.
It's like the file is locked, however I can save it.
Turning the sprite to greyscale, then saving and quitting worked, the transparency got lost though.

monkey0506

#18
I'm not sure why it's not working for you Khris, but I was able to successfully use PS CS2 to edit an image...

However, I did get some interesting results. When I edit the image using PS CS2 any pixels which are "magic pink" (transparent) in the original sprite become solidified in the resulting sprite, meaning that in-game the pixels are not used as transparent.

If I edit the SAME image in MS Paint then I do not have this problem.

What gives?

Edit: Further testing shows that if PS saves the image then it is destroying the transparency setting. That is, if I edit the image first in PS then in Paint the result is the same (with the flattened pink pixels)...something fishy is going on here and I'm not entirely sure what. But it seems AGS is picky about what programs are used for external editing...(perhaps PS is just saving the file in a non-standard way, but I'd expect that more from a MS product *coughiecough*)

ThreeOhFour

Just for the record, the few times I tried using this feature I had the same issue.

SMF spam blocked by CleanTalk