Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Knox on Wed 03/06/2009 15:26:08

Title: Technical Questions From Me :)
Post by: Knox on Wed 03/06/2009 15:26:08
Hi,

I can get transparency to work when there are zones 100% transparent. I either use the PNG or I use a bitmap with a pink color to punch through...however, when I want to make an area semi-transparent, it doesnt work.

When I load the PNG with semi-transparency, the preview shows its semi-transparent, however, when I start the game, its just opaque. I then made an alpha channel and saved as a TGA file, but when I come to import the tga file, it doesnt seem to be supported (doesnt show up in the options to import)...even though while browsing the forums Ive seen people mention they use TGA.

Its in 32-bit true color and the sprite Im trying to get semi-transparency to work is a dialog portrait set to Sierra with Background.

Thanks!
Title: Re: Semi-Transparency
Post by: Knox on Wed 03/06/2009 16:55:45
By the way, if its a character sprite, the semi-transparency works super fine...its ONLY when I try to do it for a speech portrait where the semi-transparency doesnt work.
Title: Re: Semi-Transparency
Post by: Trent R on Wed 03/06/2009 18:34:45
A couple notes:

-If it's semi-transparent (i. has a alpha channel) it will ask you when you import.
-I don't think speech portraits (sierra style) allow transparency. A way to test this is to use one of its sprites somewhere else that does support transparency (object, character, etc).
-TGA's are no longer supported, from 3.0 when CJ switched the importing routines.
Quote from: Pumaman on Mon 02/03/2009 19:20:11
There was a change in supported file formats between 2.72 and 3.0, at which point PCX and TGA were lost, and JPG and TIF were added instead. This was as a result of AGS switching from custom file import code to using the standard Windows file import routines.
-You can edit your posts instead of double posting. :)


~Trent
Title: Re: Semi-Transparency
Post by: Knox on Wed 03/06/2009 19:11:00
I never thought of that (editing instead of double-posting). Thanks for that advice!

Ok, I think you are right on the sierra style portraits not allowing semi-transparency...it allows simple transparency, but not semi...oh well, maybe in a new release!

Ok, so long TGA's!

Im currently reading and doing the scripting tutorials, Im starting to get the hang of it (very slowly).

:)
Title: Re: Semi-Transparency
Post by: Trent R on Wed 03/06/2009 21:10:43
Well, there's other ways to display dialog so that you can use the Semi-transparency. Check out some modules, or even check out the manual entries on custom dialog rendering (somewhat-advanced scripting, so you may want to wait a bit).

[Edit]: Off the top of my head, some modules you might check out are: CustomDialogGui (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=36313.0), KADS-Kick Ass Dialog System (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=34826.0), GuiPortrait (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=34996.0).

I haven't used these modules, just read through the threads once upon a time. But with some modification I think either of them can do what you need.


~Trent
Title: Re: Semi-Transparency
Post by: Knox on Thu 04/06/2009 14:49:54
Ive got the CustomDialogGui (which is absolutely awesome btw!), and I just downloaded the GuiPortrait. KADS link is broken though...doh!

Ive got some really good news yesterday for legal issues/permissions, etc...but I wont reveal that until I have more info.

Anyways, thanks again Trent...I appreciate all your help.

:)
Title: Re: Semi-Transparency
Post by: abstauber on Fri 05/06/2009 08:02:41
Unfortunately custom dialog rendering (as used in CDG) doesn't support semi-transparency too, so we just have to wait until CJ decides to put it in.

btw. I'm glad you like that module :)
Title: Re: Semi-Transparency
Post by: Knox on Mon 08/06/2009 23:28:01
Yah, its cool...so sweet.

One more thing, not wanting to start yet another thread..is about widescreen resolution. I read those threads about how the maximum res is 1024 x 768...however, when I go into fullscreen mode with a widescreen...it gets stretched vertically...which is pretty ugly!

Is there a way to make the fullscreen mode have a blackbar at the bottom and/or top so the aspect ration is maintained?

Title: Re: Semi-Transparency
Post by: Matti on Mon 08/06/2009 23:55:41
Quote from: general_knox on Mon 08/06/2009 23:28:01
Is there a way to make the fullscreen mode have a blackbar at the bottom and/or top so the aspect ration is maintained?

... I guess you mean you mean a bar on both sides of the screen instead of the top/bottom  ;)

Well, I don't think so but if there is, I'd be more than interested since I have the exact same annoying problem with my laptop.
Title: Re: Semi-Transparency
Post by: Knox on Tue 09/06/2009 00:10:12
Heh, yeah, on the side :P

Its annoying, eh?

Hopefully something will be added to fix this in the next release of AGS!

Title: Re: Semi-Transparency
Post by: Matti on Tue 09/06/2009 00:15:34
Well, it would be nice to have a feature like this implemented in AGS but really don't understand why such a feature isn't supplied by windows.... I have the problem with other games too. I would like to see those bars whenever I play something in fullscreen...
Title: Re: Semi-Transparency
Post by: Knox on Tue 09/06/2009 21:46:37
Ive got a minor problem...I have my own custom gui for Quit...but when I call it up from the icon bar, the cursor doesnt go to the pointer cursor...its the walk cursor...It does work however if I call the quit from the PanelGui.

How do we change it so it uses the pointer cursor when we call Quit from the icon bar? I tried enabling the pointer mode, and disabling the other modes...but it doesnt work...the walk cursor (or any currently used cursor) stays there.

{
  mouse.EnableMode(eModePointer);
  mouse.DisableMode(eModeInteract);
  mouse.DisableMode(eModeLookat);
  mouse.DisableMode(eModeTalkto);
  mouse.DisableMode(eModeWalkto);
  gQuitgui.Visible = true;
  gIconbar.Visible = false;
  gPanel.Visible = false;
}

**this does work however from the panel gui (weird!)
Title: Re: Semi-Transparency
Post by: Trent R on Tue 09/06/2009 21:50:30
mouse.Mode=eModePointer;


~Trent
Title: Re: Semi-Transparency
Post by: GuyAwesome on Tue 09/06/2009 22:06:19
I'd guess the Iconbar GUI just turns the Quit GUI on, while the Panel GUI has an extra line like what Trent suggested. Check the button functions in the Global script to be sure.

And the widescreen 'stretching' thing, I'm pretty sure Mr Matti's right and it's a general video card/monitor/Windows thing so it might not be fixable by AGS alone.
Title: Re: Semi-Transparency
Post by: Knox on Wed 10/06/2009 13:15:59
Hey Trent (and GuyAwesome), this works!

I now have it setup like I need it to be!

:)

Merci beaucoup!!

Edit: I decided to edit the main title to include any general technical questions I might have...I really dont want to create a gazillion topics!

Ok, I have a new question: When I have an item in the inventory, I was wondering if it were possible to select a region as a hotpost instead of a small crosshair hotpost.

Right now, when I click on the "look icon", you have to click on a specific location on the inventory item's pic, if not, my display message doesnt appear.

I know that for a cursor there are hotspots you assign, and you have the option of turning pixel-perfect detection on or off...but it seems that for an object in an inventory...you cant select a full region of the sprite to be a "look at" hotspot.

How would one go about making this possible?

I looked at the functions for iventory but could seem to find anything useful.
Title: Re: Technical Questions From Me :)
Post by: Khris on Sun 14/06/2009 16:09:17
I find that even with Pixel-perfect click detection being enabled, I can select an inventory item just fine by clicking anywhere inside it's grid box, even a transparent part of the sprite.
Something must be wrong with either the InvWindow's item dimensions or with the mouse cursor's hotspot, I guess.
Title: Re: Technical Questions From Me :)
Post by: Knox on Mon 15/06/2009 00:36:58
You're right. I rechecked the "item dimensions" you mentionned and it was the default size...way too small for my inv sprite!

Thanks ;D

Ive checked the forums here and couldnt seem to find anything on how to animate how a gui "opens". Right now when I call on a custom gui, it just appears...but what if I would like it to slowly appear, or slowly zoom in, or act like a page from a book, etc...

Al Emmo has this kind of feature...when you move your mouse cursor up and to the right, a gui page "unfolds", animated...pretty cool.

What would you suggest I lookup in the wiki to find out how to make this possible? I tried different combinations without success (animated Gui, animate a custom gui, etc...)

!
Title: Re: Technical Questions From Me :)
Post by: Khris on Mon 15/06/2009 10:13:32
In the Technical forum, Edmundito posted this a few days ago: Tween Module (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=38015.msg499775#msg499775).

Anyway, what's the problem? Fading in a GUI by gradually changing the transparency is trivial.
So is "animating" using a second GUI with a huge button, animating it, then turning it off and the actual GUI on.

Sorry to ask, but do you contemplate this stuff at least for a minute before you ask here?
Title: Re: Technical Questions From Me :)
Post by: Knox on Mon 15/06/2009 17:29:04
Hmm...I dont think there is any need to be rude, KhrisMUC. Not everyone has had the experience in scripting, etc...how would you feel if you had an artistic question and I responded in the same fashion?

You don't have to answer any of my questions if you dont feel like it. Its kind of hurtful to get responses like you just left, Im really trying hard to learn this stuff. Yes, I am "contemplating for more than a minute".  :'(

I dont understand how some people can react this way (?)
Title: Re: Technical Questions From Me :)
Post by: Akatosh on Mon 15/06/2009 18:05:17
Yeah, the AGS forums as a whole can be sort of... short-fused when it comes to questions that could be easily solved by flipping through the manual a little, or doing a forum search. I'm fairly certain it wasn't meant as a personal insult, though - Khris always does that.  :=

Still, he sort of has a point- with a bit of research, the answers are fairly obvious. For example, the manual directly tells you how to fade out a GUI (in the article "Transparency property (GUI)", no less) - reversing that to make it a fade-in shouldn't be too hard.

And don't worry - practice makes perfect, as they say, and when it comes to scripting, they're certainly correct.
Title: Re: Technical Questions From Me :)
Post by: Khris on Mon 15/06/2009 18:09:40
Sorry man, don't take this too personal, I've just noticed that recently the beginner's forum gets kinda flooded with requests that are really very trivial to solve.
I try hard not to just post RTFM although it seems appropriate to do that to me half the time.
I mean, there's this really great manual which lists and explains all the available commands, with examples and sometimes in great detail. And some people seem to be complete unable to use it.

The other half of the time though the problem is different. The thing is that knowing the available commands is not enough, you need to "get" how to tackle programming problems. This can be difficult, and there's people who are more prone to fail at it than others, but my point is that teaching you this is not the purpose of this forum.
We still do it, I do it, but what this forum is for is to solve AGS scripting problems, not teach people how to program.

Excuse the rant, but I've been visiting this forum for almost five years now and seeing the umpteenth post about how the fuck to find out which inventory item was used just sometimes gets to me and I get a little rude.

There's great people here who ask good questions, who explain in an understandable way what they've tried, what happened, what didn't happen, what code they've used and what exact error message they got.
This should be the usual contents of a new topic's opening post here, but it's not by a long, long shot.
People don't post their code, tell something of an "error in some line", don't tell what didn't work, fail to explain themselves understandably and so on.
And then there's people who seem to not even have tried solving the damn problem ON THEIR OWN first.

That's what I read in your post, so if that's not true, excuse me.
Title: Re: Technical Questions From Me :)
Post by: Knox on Mon 15/06/2009 19:23:37
Its ok...I understand. I actually work in a game studio and Ive been a texture artist for 6 years...they always get the newbies sitting next to me so I can teach  them what I know, and it can be frustrating when they ask questions without even trying themselves first...

I assure you, I am NOT like that...I dont have much background in programming, Im purely an artist...however Ive got knowledge in mel scripting, so I understand variables, functions, etc...

Perhaps I should refrain from asking too many questions for now though, the last thing I want to do is annoy people, or abuse the forums.

I guess Im so excited about this AGS program that I get caught up in the whole creation deal and post too quickly p'raps...

Anyways, sorry to anyone if I pass off as someone who doesnt take the time to try things out himself...I DO!! I really do...

:-[
Title: Re: Technical Questions From Me :)
Post by: Khris on Mon 15/06/2009 21:49:29
Relax, it was just that one question, there are others who do this constantly.
Sorry again, please feel free to post anything you want. It's not my forum :)