First start

For the following descriptions you need at least a room and one character to put in. If not make anything you can work with, no matter how stupid it looks. Make a circle with eyes! Use the "Equalize" Button in the characterwindow to make all actions look the same. Done!
Make a simple room in the same way. Setup the walkmap for it so your character can walk through the room.

Now you have to create a cutscene with the two commands setfocus (yourCharacter) and loadroom (yourRaum), use the name of the cutscene as the startscript in the gamesetup!
If you now choose a mainfont and disable the taskbar you can create your first game.


Creating a clickable object

First you need any kind of object and put it into your room. Don't forget to decide the viewstyle.
Click on your object in the room and open the scriptwindow. Now you have to add the following lines :

on (mouse)
  showinfo (text ; true)

on (click)
  walkto (self ; 12 ; 21 ; 3)

The first part displays your description text for your object in the actionline AND, if you have entered TRUE as second entry, also next to the mouseicon. The command showinfo is nessecary to let your object can react on commands like use or open!

The "Click"-Part is for letting your character walk to the object. The word "self" is always used when you want to use the currently focused character. The next to numbers are the coordinates for the targetposition in the room your character should walk to. The fourth entry is to let your character look into a specific direction after reaching his target. 1 = Down, 2 = Upn, 3 = Right, 4 = Left.

Notice : To let a character walk to ANOTHER character you can use follow (self ; character2) instead of walkto.


Creating a Taskbar Button

First you will have to create a room that will be used as your taskbar. Enter the name of this room in the Gamesetup-Taskbarroom field. Don't forget to enable the taskbar also.
Now create an object that will be your button. If you want to you can also add another state to this object for letting the button glow when the mouse runs over it. This is an examplescript for a button :

on (mouse)
  instobj (button1 ; 2)
on (click)
  {
    setobj (button1 ; 3) "Optional"
    command (look)
  }

Because a button does not have to react on commands like "use", "look" ect. we don't have to add a showinfo command. Instead we are using here instobj.
This command causes an object to change his state BUT ONLY as long as the mouse is over it! This gives you the possibility of letting a button glow. Remember this is just optional.

The "click"-part now contains the line command (your Gamecommand). In this example the used command is "look".
Also you can make another animation for a pushed button which you could use with the setobj command. Setobj changes the state of an object permanently.


Look at an object

First : Every Gamecommand like "look" will first be processed when the target, given by the walkto command in the on (click)-part, is reached by your character, except no character is selected.
Add the following lines to the script of your first object :

on (look)
  speech (self ; Add here the "look"-description of the object ; speechsample)

Instead of a characterinstance you can enter "self" as the first entry which defines your focused character. The second entry is the text your character will speech. The third entry is the name of a soundfile that contains the speech, this entry is only nessecary if you make a game with speech.

Notice : To look at a character or at an item works in just the same way.


To Pickup something

Important : The object in a room that you can pickup and the item you will have in your inventory after that are 2 DIFFERENT things.

Now you need an item. I suggest a key. If you want you can add the PRESET for items to the itemscript, but at the moment we don't need it.

Add a second object to your room and make it also "lookable". Append this to the script of this object :

on (pickup)
  if_obj (key ; 1)
  {
    setobj (key ; 0)
    pickup (self)
    playsound (pickupeffect)
    additem (self ; key)
  }

Notice : The object in the room and the inventory item are both names with "key", this works.

First we have to check if the object wasn't picked up previously with if_obj.
If it was not the following stuff happens :
  • The state of object "key" will be set to "0", which means it will disappear of the screen and cannot be picked up again.
  • The character makes his "pickup" animation.
  • A soundeffect for "pickup" is played.
  • The item "key" will be added to your inventory.


    Use the inventory

    For scrolling an inventory in your taskbar or in a subroom you need 2 objects that will be used as Arrowbuttons. With these buttons you call the comamnds : inv_up (amount) and inv_down (amount). The amount should be the width of your inventoryfield.


    Reaction of your character if he can't do something

    Of course you cannot handle all possible combinations of objects and commands in your game. For that you have to create an event that is being called when another event does not exist.
    This happens in the characterscript. Click on your character in the roomwindow and open the scriptwindow.
    To create a specific "anti"-event add these lines :

    on (cantpickup)
      speech (self ; I cannot pick that up. ; speech_cantpickup)

    If you try to pickup an object that does not contain an on (pickup)-event, the event on (cantpickup) in the characterscript will be processed, if possible.
    For a generell "anti"-event to any gamecommand you can use this:

    on (cantall)
      speech (self ; That doesn't work. ; speech_cant)

    Notice : In the PRESET for itemscripts the following part is included :

    on (pickup)
      break()

    This prevents your character from saying "I cant pick that up" which would be stupid because you already have it.


    Creating a door

    First we need a doorobject with two states : "Door closed" and "Door opened". Set the state to "closed"
    The script for the door begins with :

    on (mouse)
      showinfo (door ; false)

    on (click)
      {
        walkto (self; 8; 16; 4)
        if_obj (door ; 2)
          if_command ()
            walkto(self; 5 ; 15)
      }

    The first walkto command leads your character to a point in the room from where he should open and close the door. The second walkto command is the point where he walks to when exiting the room. Later more.
    For the second point two things are nessecary : The door must be open (state 2) and the current gamecommand must be "walk to". If the door is closed or the current gamecommand is something like "use" or "open" the first point will be the characters target.

    To be able to open and close the door you will have to add the following lines :

    on (open)
      if_obj (door ; 1)
        {
          playsound (opendoor)
          setobj (door ; 2)
        }

    on (close)
      if_obj (door ; 2)
        {
          setobj (door ; 1)
          playsound (closedoor)
        }

    In both parts the current state is checked and first then the state will be changed and a soundfile will be played.


    Combine something

    To combine an object/item with another you can use the command Link (linkname)
    The PRESET for items contains the following part :

    on (use)
      link (key)

    The linkname "key" will be cached for later use. Also the current gamecommand will be changed to "link".
    The object or character or item that is now used as second part must have these scriptlines :

    on (link)
      {
        if_link (key)
          {
            *Enter here the things that happens when combining these two things.*
            break()
          }
        speech (self ; I cannot use this with that thing. ; speech_cantuse)
      }

    With if_link the cached linkname will be checked. Is it the right linkname the follwing lines will be processed and end up with the command break()
    This last command causes the rest of the on (link) event to be cut off, which then prevents the last command speech. Only if if_link was false the last speechcommand is recognized.


    Creating an unlockable door

    Create a Boolean in the Editor named "doorlocked" for example. Check this Boolean in the editor as true. With this variable we will know if the door is locked or not.

    To unlock a door you have to use a key. Add the following lines to the doorobject :

    on (link)
      {
        if_link (key)
          {
            if_bool (doorlocked ; true)
              playsound (usekey)
            setbool (doorlocked ; false)
            break()
          }
        speech (self ; I cannot use this with that thing.. ; speech_cantuse)
      }

    The Boolean is set to "false" and a soundeffect is played. Now you have to make sure that you can only open the door when its unlocked. For that append the following lines to the on (open) event :

    on (open)
      {
      if_bool (doorlocked; false)
        {
          if_obj (door ; 1)
            {
              playsound (opendoor)
              setobj (door ; 2)
            }
          break ()
        }
      speech (self ; The door is locked. ; speech_doorlocked)
      }

    Is the door is unlocked it will be opened, a soundeffect is played and the rest of the script will be cut off. If its locked your character speaks "The door is locked".


    How to give an Item

    To give an item to another character you have to prepare the item with the command givelink(). This command is included in the PRESET for items :

    on (give)
      givelink ()

    With givelink the itemname is cached that called the command.
    The preset for Characters already contains the second part for giving an item. "Self" is the character that gives and Char2 is the one that receives :

    on (givelink)
      {
        delitem (self ; givelink)
        additem (char2 ; givelink)
        lookto (char2 ; self)
        playsound (pickup)
        pickup (self)
        pickup (char2)
      }

    First the item that was previously cached with givelink will be deleted from the inventory of the giving character and add to the one from the receiving character. If the second entry in additem is "givelink" the cached item will be used.
    lookto causes the characters to look at each other.
    Last both characters perform their "Pickup"-Animation and a sound is played.


    Music and Loopsounds

    Music can be played with the command playmusic (yourMusic) and stopped with stopmusic(). In most cases you can start and stop Musicfiles in the on (enter) and on (exit) events of the roomscript.
    You can add a second entry to the playmusic command which sets the startpattern in modules. With that you can create little intros for specific characters before the maintheme of a room is played.. just like in DOTT.

    To use a soundeffect as a looping sound you have the commands loopsound (yoursound) and loopstop (yoursound). These should also be called when entering and exiting a room.

    You can play up to 3 looping sounds at the same time.


    Play Videos and Flashmovies

    With the commands playvideo (video ; true/false) and playswf (Flashmovie) you can play movies in the game.
    These movies will always be in the foreground. They are not a part of objects or rooms, so they are not infected by lighteffects and the roomposition.
    Video Files autostop when they finish, Flashmovies MUST BE stopped manually with stopswf()

    Although Movies are running always on the top there is a way to use them as a gameelement. You can enter values for the Position and the Size of a movie (See Scriptreference)
    Take a TV for example. To play a movie on it you have to run a cutscene, fix the roomposition and get sure that no characters are standing in front of the TV.

    This movie may only be played in a cutscene, not in a normal game situation.

    Important : SWF Files do not work with PaC-DK on 64bit OS so they are not recommended anymore! Use WMV instead.


    Creating a textscene

    A textscene is a typical gamesituation of classic point&click adventure. In the lower screenpart you have a multiple choice of sentences your character can say, which you can also modify during your game.

    To create a textscene in the editor you have to use scripts. So create a script and fill it with the PRESET for a textscene level with 3 rows.
    Which would look like this :

    level ( )
      {
        row (1 ; ; true)
          {

          }
        row (2 ; ; true)
          {

          }
        row (3 ; ; true)
          {

          }
      }

    A textscene has a maximum of 9 levels and each level has a maximum of 9 rows. When starting a textscene with the command textscene (nameofcutscene) the selected level is "1".
    So you have to fill in a "1" in the Level identifier above. The second entry of the line Row, after the number, is the text that will be shown in the lowerscreen. The third entry "TRUE" defines that this row is activ when starting the game. If you would like it to be inactiv enter "FALSE". The area after Row contains your commands that should happen when the player selects this row. Normally there are two speech commands for creating a dialoge. But you can enter anything else.

    To increase and decrease the choices the player has you can use the commands activate and deactivate. These commands will be used like this :

    activate (textscene3 ; 2 ; 5)
    deactivate (self ; 1 ; 3)

    The first entry is the textscene that shall be changed. If you want to change a row of the current activ textscene you can also enter self.
    The second one is the level and the third one the row that you wanna activate or deactivate.

    With gotolevel (number) you can change the current level of a textscene.
    With endscene() you exit a running textscene.

    Tip 1: You don't have to use a textscene only for a character dialoge. Use it for anything where you could need a multiple choice. For Example a Console with 3 Buttons.
    Tip 2 : Its possible to use symbols instead of textlines in a textscene. Go into the project setup and into the tab "Textscene". There you can change it from "Text" to "Symbols". For symbols items are used. In the Row-Instruction you have to enter the name of an item then, instead of a textline, thats it. If you want to use both forms of textscene in one game, you can use the instruction textscenestyle to change the current mode.
    Tip 3 : You can personalize the look of a textscene by using a background image for the dialog box and defining Position and Width of the dialog box for example like this : textscene (name ; 200 ; 100 ; 250). The Dialogbox will be displayed at the pixelposition 200/100 with a width of 250 pixels.


    How to change a room

    If the game is in a cutscene or you have no player selected you can use the loadroom (yourroom) command. Is a character focused the current room is always the room where this character is, so we have to get a character into another room.

    For that you need a point of the walkmap where your exit is. The script for this walkmappoint contains the command : beamto (self ; NewRoom ; 13 ; 23 ; 2)
    This command works like walkto, but that the character can be set into another room and he will be instantly there without walking.
    13 and 23 are the roomcoordinates and 2 is the viewdirection.