Create story script

From XStoryPlayer Wiki
Revision as of 15:24, 12 January 2015 by Xwikip (Talk | contribs)

Jump to: navigation, search

In this tutorial we will add some scripting: Give feedback to player, make the doors open when a specific event occurs, let female alien walk by.

  1. We don't want the doors to open automatically. We need to make the doors objects that can be driven by the script.
    Open the /init/story/scenes.dat file and add under data {...} :
    door_objecti CELL1
    {
      rotate   = false; // Door translates
     
      q        = 4.5;  // Open height
      q_min    = 0.0;  // Min height
      q_max    = 6.0;  // Max height
      q_spring = 30.0; // Spring used for opening door
     
      open = true; // Door status
     
      obj_name = "cell1"; // Object in scene that is the door
    }
     
    door_objecti CELL2
    {
      rotate   = false;
     
      q        = 4.5;
      q_min    = 0.0;
      q_max    = 6.0;
      q_spring = 30.0;
     
      open = false;
     
      obj_name = "cell2";
    }

    This will make a door object from the scene object. Now we can also open the door using a script.