Site
Home
   Other works
Links
* Beyond Unreal
* UnrealSP.org

Usable Screen

What's this?

This is Unreal actor that makes an usable screen displayed on any texture.
The basic principles of usable screen (technical stuff).
1. It becames controllable by touching UsableScreenController actor.
2. It has areas (slices) that will cause different events on fire and alt-fire. Slices may have different properties and behaviour.
I've added replication to UsableScreen, so it can be used in network games too now.

Screenshots

screen
First demo map. Here you can see wrap of text by delimiter and by lack of screen's width. Text in console is caused by events.
screen
Second demo map. Uses pages and slices-containers.

Download

UT99

Version 0.9b: us09b.zip, 62 kb. Contains 2 example maps. Don't use this version of UsableScreen in any of your maps.
Version 1.00: us100.zip, 11 kb. Contains only UsableScreen.u package.
Version 1.05: us105.zip, 11 kb. Fixed bug with invisible mouse on listen server.
Version 1.1: us11.zip, 12 kb. Added new features to UScreenSliceChanger.
Version 1.2 beta: us12b.zip, 59 kb. Slices can fire Trigger() and UnTrigger() events.

UT2004

Version 0.7: us2k4v07.zip, 26 kb. Have all functions from UT99 version but without replication.

Where it is used

It is used in Diamond's singleplayer map SP-Plateau.
Also it will be used in such mods for Unreal Tournament as Lost Secrets of Na Pali and The Chosen One.

Using Usable Screen in UT maps

1. Setting up UnrealEd

Currently UsableScreen was developed and tested with Unreal Tournament version 436, so make sure you've pathced your game to this or later version.
You will need to add some packages to EditPackages. Add this lines into [Editor.EditorEngine] section of your UnrealTournament.ini :
EditPackages=UsableScreen
Now you will have UsableScreen's package loaded at startup of UnrealEd.

2. Creating ScriptedTexture for screen

It is important to create corresponding scripted texture for each UsableScreen. After creating scripted texture you can apply it to some surface or even set it as skin for mesh.
You can notice that 256x256 textures doesn't have enough space to fit all you need. You can create ScriptedTextures with any dimensions with this UnrealEd command:
TEXTURE NEW NAME="texturename" CLASS="engine.scriptedtexture" GROUP="somegroup" PACKAGE="somepackage" USIZE=size VSIZE=size

3. Adding UsableScreen

Now you should add UsableScreen actor to your map. It can be found in Actor Class Browser:
Actor->Info->ClientScriptedTexture->UsableScreen
Set it's ScriptedTexture property (ClientScriptedTexture section in properties window) to scripted texture corresponding this screen.

4. Adding slices

Slice -- it is an interactive rectangle area on UsableScreen's texture. You can choose between different types of slices, but all of them are subclasses of Actor->Keypoint->Uslice.
Common properties for all slices:
X: X coordinate of slice.
Y: Y coordinate of slice.
SizeX, SizeY: Height and width of slice.
bVisible: Toggles visibility of slice.
bDrawFrame: Indicates whether should frame be present on slice or not.
FrameTexture: Picks the color of frame.
FireEvent: Event caused by clicking fire button on slice.
AltFireEvent: Event caused by clicking alt-fire button on slice.
ClickSound: Sound played on fire/alt-fire.
After adding slice to map you must add it to the Slices array in corresponding UsableScreen actor.
USlice does nothing when added, you should use it's subclasses to have something displayed on screen.
By default USlice calls only Trigger() event caused by clicking fire or alt-fire button. But it is possible to make it call UnTrigger() event by setting it's initial state to Controlling. Note that you can't fire different events with fire and alt-fire buttons in this state and you should set only one of FireEvent or AltFireEvent properties. UChangeableTextureSlice will work properly in this state and will change it's texture to default only after fire/alt-fire button was released.

4.1 UTextSlice

Slice to display text.
DisplayedText: Text that will be displayed in this slice.
FontName: Name of font which will be used to display text.
bAutoSize: Indicates whether should splice be strethed to fit text or not.
bTextWrap: Indicates whether should text be wrapped or not.
WrapDelimiter: If bTextWrap is set to True, text will be wrapped by lack of splice/screen width and by special wrap delimiter symbol. The default delimiter is "|".

4.2 UPlayerNameSlice

The sublass of UTextSlice that displays the name of player using this screen.

4.3 UTextureSlice

Slice to display graphical information. Notice that palettes of UsableScreen's base texture and displayed texture should be the same for normal colors. DisplayedTexture: Texture to be displayed.
bMaskedTexture: Should it be masked or not.

4.4 UChangeableTextureSlice

These derived from UTextureSlice slices serves to create a set of buttons, only one of which is displayed pressed while all of rest remains unpressed.
SecondTexture: Second texture that should represent button in pressed state.
AffectedSlices: Array of UChangeableTextureSlices which works in conjuction with this slice.

4.5 USlicesContainer

I created this slice to place more than 32 slices at one screen and to group slices with common goals.
Slices: You can place up to 16 slices here.
Parent: Set UsableScreen on which it should be displayed. Notice that it should be added into UsableScreen's Slices list too.
Notice: Don't put one USlicesContainer into other USlicesContainer to prevent uncorrect work in network games.
Coordinates of slices in USlicesContainer aren't relative to USlicesContainer's coordinates -- they should be set as for any other slices.

5. UsableScreenController

To take control over UsableScreen you must add UsableScreenController.
Properties:
ControlledScreen: UsableScreen which should be controlled by this UsableScreenController.
TextureCenterX, TextureCenterY: Coordinates of texture's center.
MouseTexture: Texture of mouse cursor.
MouseSizeU, MouseSizeV: The size of mouse cursor.

6. UScreenSliceChanger

This actors creates dependencies between slices to create tab-controls. It has two lists of slices -- content slices and control slices.
Properties:
ControlSlices: Slices that makes controls to switch content slices
ContentSlices: Slices that contains corresponding data.
You should set FireEvent or AltFireEvent of ControlSlices to the Tag property of UScreenSliceChanger.
In UsableScreen version 1.1 UScreenSliceChanger has 2 states:

6.1 TabSheets state (default)

It works like TabSheets in Windows. When it gets triggered it checks is actor which caused event a slice from ControlSlices array. If it is then it shows corresponding slice from ContentSlices. It always makes visible only one slice from ContentSlices.

6.2 FreeSwitch state

In this state it is possible to turn visible multiple slices. To implement this you should add several slices into ContentSlices array and set all corresponding slices in ControlSlices to the slice which will control these slices.

In case you used older version of UsableScreen UScreenSliceChanger will use TabSheets state.

UnrealWiki Search

If you have some questions about creating scripted textures or something else you can find an answer at Unreal wiki site or start search on it from right here.
Copyrigth (c) kea, 2005
Hosted by uCoz