Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Miori on Sat 29/11/2008 23:24:52

Title: Show Face over Gui?
Post by: Miori on Sat 29/11/2008 23:24:52
I have a little Problem. I have a Line at the top and the bottom of the Screen. The bottom Line is for the Intventory and in the top Line you see the speech with Faceset.

Now i have a bigger room, it scrolls if you walk to the side. I want to make the lines as GUI, so it doesn't scroll too, but then i can't see the Faceset anymore. What should i do?

Screenshot from the Game:

(http://www.specky-online.de/traffic/speckyadventurescreen.png)
Title: Re: Show Face over Gui?
Post by: Shane 'ProgZmax' Stevens on Sun 30/11/2008 16:11:40
I have no idea what this Faceset thing you're referring to actually is, but if you want some non-gui items to update with the player's x (or y) position, just use the GetViewportX() and GetViewportY() functions to get the current viewport positions, then set whatever it is you're doing to that x (or y) value plus whatever offset you're using to place it.
Title: Re: Show Face over Gui?
Post by: subspark on Mon 01/12/2008 00:55:10
Your not talking about setting the character to face a certain direction are you?

The manual describes the following:

Quote(Formerly known as global function FaceLocation, which is now obsolete)

Character.FaceLocation(int x, int y, optional BlockingStyle)

Similar to the FaceCharacter function, except that this faces the character to room co-ordinates (X,Y). This allows him to face not only other characters, but also hotspots or anything else as well (you can get co-ordinates by watching the co-ordinates displayed in the Room Settings mode as you move the mouse over the room background).
If the character has Turning enabled (ie. the "Characters turn to face direction" game option is turned on, and the character does not have the "Do not turn before walking" option checked), then the character will turn on the spot in order to face the new direction. In this case, the BlockingStyle parameter determines whether the script waits for the character to finish turning (eBlock, the default) or whether the script continues immediately and the character finishes turning later on (eNoBlock).

If the character does not have Turning enabled, he will immediately turn to face the new direction and the BlockingStyle parameter has no effect. In this case, the screen will not be refreshed straight away -- if you want to see the character facing his new direction immediately, call Wait(1);

Example:

cEgo.FaceLocation(cEgo.x + 50, cEgo.y);

will make the character face to the east.

Cheers,
Sparx.
Title: Re: Show Face over Gui?
Post by: Trent R on Mon 01/12/2008 03:25:16
Faceset is probably referring to something similar to Facesets of RPGMaker (http://www.rpgnet.ionichost.com/facesets/arex.png), so dialogue pictures. But yeah Miori, try to be a bit more descriptive.

I'm guessing it's a probably with GUIs Z-orders, and that the dialogue text window GUI needs a higher Z-order than the lines GUIs.


~Trent
Title: Re: Show Face over Gui?
Post by: Ryan Timothy B on Mon 01/12/2008 06:22:32
I think he's trying to say that the top bar displays the characters speech text and picture.
But when he's walking in the scrolling room the speech text stays at the left side of the background if he walks right.

I haven't played around with speech gui's at all.  But I think you'll need to use GetViewportX() and GetViewportY() and add them to the speech GUI.x with the characters picture.
Title: Re: Show Face over Gui?
Post by: Miori on Fri 05/12/2008 21:54:17
With faceset I meaned the speech picture.

The bars are part of the background graphic, but now i have a scrolling room, so the bars scroll too. But I don`t want this. I want to make the bars as a gui, the problem is, that then the speech picture is behind the gui, so I only see the text  :(

Title: Re: Show Face over Gui?
Post by: Trent R on Sat 06/12/2008 05:06:54
What speech setting do you have? Lucas Arts? Sierra with no picture? Sierra with picture? Sierra with full portrait? (I think that's all)


~Trent
Title: Re: Show Face over Gui?
Post by: Miori on Sat 06/12/2008 06:36:15
I use Sierra with Picture and AGS 3.0
Title: Re: Show Face over Gui?
Post by: ciborium on Tue 09/12/2008 03:57:20
You should be able to set the z-order of the GUI to 0.  That is if the engine considers the Sierra Speech Overlay a GUI.   

Quote
ZOrder property

(Formerly known as SetGUIZOrder, which is now obsolete)


int GUI.ZOrder


Gets/sets the z-order of the GUI. This allows you to dynamically change the ordering of GUIs on the screen.

The Z-order setting is an arbitrary number between 0 and 1000. AGS draws the GUIs in order, from the lowest numbered at the back to the highest numbered at the front.

Example:


gStatusline.ZOrder = 0;


sets the STATUSLINE GUI to be behind all other GUIs.

See Also: GUI.GetAtScreenXY

Title: Re: Show Face over Gui?
Post by: Pumaman on Tue 09/12/2008 18:33:15
You currently can't configure the z-order of standard sierra-style speech; probably the best bet would be to create the top and bottom borders as characters instead of GUIs, and have some code in repeatedly_Execute_always to keep them always in the current room and always aligned to the screen in scrolling rooms.
Title: Re: Show Face over Gui?
Post by: Miori on Tue 09/12/2008 22:46:58
It is a good idea to make it as Charakter, but I don't know how to align it  always to the screen X_x . I have to put in in this function right?:

function room_RepExec()
{
}

But i don't know what to wright into it  ::) sry, it's the first game i make with AGS
Title: Re: Show Face over Gui?
Post by: Pumaman on Tue 09/12/2008 22:57:50
putting something like this would do the trick:

cTopBanner.x = GetViewportX() - System.ViewportWidth / 2;
cTopBanner.y = GetViewportY() + (PUT HEIGHT OF BANNER HERE);

because character positions are specified at the bottom-middle, this script would maintain the character's image at the top-left of the screen.

I hope to add a feature to a future version of AGS to allow you to specify the Z-order of character speech, and avoid having to do a hack like this.
Title: Re: Show Face over Gui?
Post by: Miori on Wed 10/12/2008 01:33:29
Thank you very much it works   :-*  ;D
But is it normal that it judders so much ?  ???
Title: Re: Show Face over Gui?
Post by: Pumaman on Wed 10/12/2008 17:49:52
It's probably lagging behind the room by 1 frame. What you could do is, rather than using the built-in automatic scrolling, also do the scrolling yourself using SetViewport; that way you would be able to keep the two in sync.

Untested but something like this:

SetViewpoint(player.x - System.ViewportWidth / 2, player.y - System.ViewportHeight / 2);
cTopBanner.x = GetViewportX() - System.ViewportWidth / 2;
cTopBanner.y = GetViewportY() + (PUT HEIGHT OF BANNER HERE);
Title: Re: Show Face over Gui?
Post by: Shane 'ProgZmax' Stevens on Thu 11/12/2008 04:00:10
I believe CJ meant SetViewport there, not SetViewpoint.  Just so you don't get confused.
Title: Re: Show Face over Gui?
Post by: Miori on Fri 12/12/2008 08:51:07
Now the bars don't lag anymore, but the player XD