Page 1 of 1

scripting questions (general questions and screen overlays)

Posted: Tue Dec 11, 2007 6:40 am
by Destron
ok, I think I've got the wrong idea about scripting.

Can scripting affect non-gameworld things, such as the hud and player inventories? I have some ideas for my game but I'm not sure if I can implement them.

First thing is screen overlays. Is there a way I can do some HUD effects by adding scripted screen overlays? (i.e. when the player is damaged, the display flashes red for a second).

//Destron

Posted: Tue Dec 11, 2007 9:45 am
by Juutis
The manual:
DrawFlipBookImage(char *FlipBookName, int ImageIndex, int XPos, int YPos, float Alpha, int R, int G, int B, float ZDepth );

Draws the image with index ImageIndex of the FlipBook entity FlipBookName parallel to the screen at position (XPos, YPos), ZDepth in front of the camera.

...

DrawText(char *Text, int XPos, int YPos, float Alpha, int Font#, int R, int G, int B );

Draws the text Text at the screen position XPos, YPos using the font Font#.

...

FillScreenArea(int Area#, bool KeepVisible, float Alpha, float R, float G, float B, int Left, int Top, int Right, int Bottom );

Fills a rectangle on the screen with a color and an alpha
Area#: Is a number between 0 and 19 that is used to distinguish between different FillScreenArea commands within one order.
KeepVisible: Keeps the rectangle processed and visible independent of the selected ThinkTime
Alpha: transparency of the filled rectangle (0 is fully transparent, 255 is fully solid)
R, G, B: Define the color to be used to fill the rectangle. Default color is black.
Left, Top, Right, Bottom: Defines the rectangle in screen coordinates to be filled. If not specified, the full screen will be filled

NOTE: The HUD is displayed on top of the FilllScreenArea. If you do not want this, use SetHudDraw(false) to first hide the HUD. This command can be used to fade the screen, or part of the screen. It can also be used eg. in a menu system to create a (semi-transparent) background.

RemoveScreenArea(int Area# );

Removes the filled screen area with number Area# from the screen.
These are all quite powerful commands and let you create all kinds of in-game menus, inventories, mission objective screens, HUD parts etc etc.

Posted: Tue Dec 11, 2007 4:57 pm
by Destron
Thanks Juuties.
So what exactly does 'flipbook' mean? Is it sort of like a bitmap animation - graphics, but without sound?

Posted: Tue Dec 11, 2007 5:16 pm
by Juutis
Flipbook is an entity. See the 'FlipBook' section in the manual for more info.