2.6 PAGE definition

2.6 PAGE definition

PAGE defines a custom HTML template which can be sent to the player’s client. Any PAGE definition must be placed in the GUI section according to the following syntax:   (square brackets indicate optional parts):   PAGE viewId , template     In practice, the specified template is loaded at startup time and then used at the programmer’s need.   The template is actually an HTML file which you build with any suitable editor. When designing the view, you should insert in the HTML code the placeholders: $scene, $icons, $inventory, $navpad, $messages which will be replaced at run-time by the actual content.   Parameters Meaning viewId Identifier of the view (mandatory) Note: “default” refers to the pre-defined view. template It is normally a .HTM file which resides in the media folder. You can specify a file name, a relative path, or an absolute URL starting with http:// This is also called HTML template. See next section to learn how to produce one.   The defined PAGEs can be used later by means of the UseView script instruction (See section 3.12.27).   2.6.1 HTML templates HTML Templates are HTML files which can be used by the game engine to produce game views. They must be declared by using the PAGE tag in the GUI section (see above), and then called at programmer’s need by using the script’s SendPage instruction.   HTML templates can be prepared by the programmer by using any HTML editor (or any text editor if you like). They can include special placeholders which will be automatically replaced by game’s real values during game display. Also, the player’s chosen skin is applied to the HTML template automatically.   The following is a list of currently supported placeholders:   Placeholder Will be replaced with… $display Player’s messages (avatar’s thoughts) $icons Icons of objects in the current room. $navpad Navigation pad $inventory Player’s inventory $banner ONLY the banner of focusized object normally seen at the top of a $scene.  Typically used when NOT displaying the $scene. $properties Player’s properties (all those beginning with a capital letter) $scene Scene display (usually the room’s image), with focusized object on top. Note: this will always appear in the...

Read More

2.5 PANEL definition

2.5    PANEL definition

Any PANEL definition must be placed in the GUI section and defines a controls panel (forms) to be used in the game.   GUI section’s syntax is as follows (square brackets indicate optional parts): PANEL panelId [VERSION OF parentPanelId]  [BUTTON definition | CR definition | MAP definition | TEXTBOX definition | LABEL definition | DROPDOWN definition | DELETE spec ] [more control definitions…]   The VERSION OF tag may be added to build a modified version of an existing panel, so that you just add additional controls, or delete existing ones.   Parameters Meaning panelId Identifier of the panel (mandatory) If the panelId identifier represents an existing panel, the new definition will replace the existing one. Note: “default“, “chat“, “connecting” and “exiting” are IDs of pre-defined panels. “default” is the panel to be used by default at the game’s startup and in controls’ quick definitions. “chat” is an alternate, simplified set of commands which can be used for chatting purposes, by means of the SetPanel instruction (see section 3.12.25, in the SmallBasic reference). “connecting” is the panel to be used while connecting. “exiting” is the panel used when a “Save and Exit” command is used. parentPanelId (Optional) Identifier of an existing panel from which commands should be imported.   As it should be clear, a PANEL tag just specifies the PANEL’s id for later reference, and acts as a container for the controls’ specifications. For more information about them, see 2.5.2 – How PANELs work. 2.5.1    Pre-defined PANELs DimensioneX has got a number of pre-defined PANELS which, in turn, consist of pre-defined controls. Please remember that all defined PANELs can be inspected by using the DimensioneX Administrator’s screen, selecting Snapshot and then Panels.   panel id what is it? built-in control IDs Default It is the panel used normally – all commands available. go, look, use, use2, _sep4, open, close, pick, drop, _sep9, search, hide, put, give, _sep14, enter, exit, _sep17, _sep18, txtBox, say, _sep21, _sep22, clear, help, _sep25, save,savexit, logout Chat It is a simplified panel, useful for chatting and little else go, look, _ctr2, _sep3, txtBox, _sep5, _sep6, use, _sep8, _sep9, help, savexit, logout   Connect Initial connect screen go, look, lbl0,...

Read More

2.4 HOOKS definition

2.4 HOOKS definition

HOOKS defines commands that the game server will accept from the outside, regardless of the state of the client (in-game player or not). Each command you specify in the HOOKS line will be associated to an event defined by you. Then, in the event code, it will be up to you what to process and what to output. Syntax: [ HOOKS hookID=eventName, … ]   The function handling the event can have input parameters which will be specified by the user in the URL used for the call. The programmer may read the input parameters also via the input() set. Any output can be done via the Print instruction. The hook will be activated by opening the game’s URL and using the cmd parameter with the specified hook ID. So you activate your event by opening an URL like this: http://localhost:8080/dimx/servlet/multiplayer?game=1&cmd=hookID&param1=foobar   2.4.1 Example In the following example, we define a hook. We want to enable a way to peek into the game and quickly locate objects and characters, even when we are not connected. We want that, when the server receives the command: findobj on the game’s URL, the event doFindObj() is triggered and, after getting the name of the object we are searching for, it outputs the results of the search in a plain text format. The name of the object we are searching for will be specified in the obj parameter.   GUIHOOKS findobj=doFindObj  ‘ when you receive ‘findobj’ call doFindObj() …   EVENTS Function doFindObj(obj) ‘we expect a parameter named obj ‘obj = input(“obj”) ‘Print “input: ” + input + “<br>” ‘Print “obj: ” + obj + “<br>” ‘Print “Searching: ” + obj + “<br>” Dim c For Each c In getItemsIn($WORLD) If InStr(c.name,obj) found=1 Print $AGENT,”<LI>” + c.name + ” is in: ” + c.container.name End_If Next For Each c In getCharactersIn($WORLD) If InStr(c.name,obj) found=1 Print $AGENT,”<LI>” + c.name + ” is in: ” + c.container.name End_If Next If Not(found) Print “Not found: ‘” + obj + “‘” End_If End_Function END_EVENTS   The command must be specified in the game’s URL by using the cmd parameter. So you activate this hook by opening an URL like this: http://localhost:8080/dimx/servlet/multiplayer?game=1&cmd=findobj&obj=spell  ...

Read More

2.3 GUI section

2.3 GUI section

The GUI section is optional and describes the command panels that will used in the game. Inside it, each PANEL tag describes a command panel in the game.  INCLUDE statements could be used to include libraries of reusable PANEL and PAGE definitions.   GUI section’s syntax is as follows (square brackets indicate optional parts, things which are not written in bold can be changed by you): GUI[ SCENE SIZE 350×235] [ SCENE LOOK lookType ] [ SCREEN SIZE 800×600] [ LOGOSRC gamelogo.jpg ] [ MAP gamemap.jpg ] [ COMPASS true ] [ MSGLISTSIZE 3 ] [ SKINS skinspec, skinspec, … ] [ SHOW PROPERTIES property1, property2, … ] [ HOOKS cmd1=event1,cmd2=event2, … ]   [PANEL definition] [PANEL definition …]   [PAGE definition] [PAGE definition …]   END_GUI   Tag Meaning and values SCENE SIZE (Optional) Specifies the default size of the rooms’ scenes, in pixels. Format: widthxheight. This is just a standard value, of course. You can design rooms with scenes of any size you like later. The default value is 350×235 which may be a good value for 640×480 screens, but rather small for bigger screens. SCREEN SIZE (Optional) Specifies the size of the “default” screen, in pixels. Format: widthxheight. The “default” screen we are talking about here is the screen for for which the game was designed (typically the one used by the game programmer dureing design and testing). The value for SCENE SIZE should enable a “perfect” display on this “default” screen. The game engine is able to automatically reproportion images so that the display is correct on different screen sizes. So, if a game with SCENE SIZE 350×200 was designed for a  640×480 screen, we simply state so by using the SCREEN SIZE tag. This way, when a player will be using a larger screen (say, 1024×768) the images will be proportionally enlarged. SCENE LOOK (Optional) Determines how the scene will look like in the standard view. Possible values for lookType are: 1STPERSON (default) The scene is seen in 1st person (player is not displayed) 3RDPERSON The scene is seen in 3rd person (player is displayed) LOGOSRC (Optional) URL of the game logo. If the URL is without the “http://”...

Read More

2.0 DXW Reference – WORLD structure and attributes

2.0 DXW Reference – WORLD structure and attributes

This section shows what is the structure of a typical DXW file, the game description file for the DimensioneX game engine. A good starting point to write a game from scratch.

Read More

1.4 Developing a game

1.4 Developing a game

Overview of how you can develop games in localized language, deal with multi-area games, handle images and sounds to be used in the game. Also covering the admin panel, the Optimizer fuctionality and the Maintenance page to perform game profiles cleanup.

Read More