Difference between revisions of "Create story script"

From XStoryPlayer Wiki
Jump to: navigation, search
Line 12: Line 12:
 
   q_min    = 0.0;  // Min height
 
   q_min    = 0.0;  // Min height
 
   q_max    = 6.0;  // Max height
 
   q_max    = 6.0;  // Max height
   q_spring = 20.0; // Spring used for opening door
+
   q_spring = 30.0; // Spring used for opening door
  
 
   open = true; // Door status
 
   open = true; // Door status
Line 26: Line 26:
 
   q_min    = 0.0;
 
   q_min    = 0.0;
 
   q_max    = 6.0;
 
   q_max    = 6.0;
   q_spring = 20.0;
+
   q_spring = 30.0;
  
 
   open = false;
 
   open = false;

Revision as of 15:24, 12 January 2015

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.