Basic code scripting

From XStoryPlayer Wiki
Revision as of 11:46, 6 January 2015 by Xwikip (Talk | contribs)

Jump to: navigation, search

All the scripts for the dungeon pack directory can be found in the ./pack/pack_dungeon/init directory.

Init sub-directories

The /init directory contains the following sub-directories:

  • /std : These files are the same for all stories (like .dll files in windows)
  • /stories : These files are story specific.

Stories sub-directories

The /init/stories/dungeon directory contains the following sub-directories:

  • /scenes : Scene settings
  • /chars : Character code
  • /mains : Main player code
  • /objects : Object settings
  • /lib : Defines used in code
  • /gamestate : Global gamestate
  • /settings : Settings for custom fastsex menu

Playtime

For now we like to play around with some settings/code that are easy to do and have quick visual effect.
We assume you are in the ./pack/pack_dungeon/init/stories/dungeon directory.

Changing Saiko character

  1. Make sure there are no save files in the ./save directory
  2. Open the /chars/saiko/init.dat file.
  3. Change the skin color to:
    pose
    {
      ...
     
      skin_color      = (240,300,300,255); // <<-- Bright silver
      skin_spec_shiny = 2.0;               // <<-- Very shiny
      skin_spec_power = 100.0;             // <<-- Sharp shiny
     
      ...
    }
  4. Now start XStoryPlayer, select the fastsex dungeon mod, the Saiko character and start it. Saiko should now appear somewhat silver plastic like.

Changing Saiko cloth

  1. Open the ./pack/pack_dungeon/init/std/base/char/char_base.dat' file. In it you will see all the settings that can be done for a character.
    We will not edit this file because the Saiko character is derived from the CHAR_BASE object.
  2. Open the /chars/saiko/init.dat file. You will see that at the top it says: char_objecti:CHAR_BASE SAIKO.
    This means that the character Saiko is derived from the based character CHAR_BASE. We can override the settings for this character by adding them. We will do this for the cloth settings in this small tutorial.
  3. Change the skin color to:
    pose
    {
      ...
     
      skin_color      = (240,300,300,255); // <<-- Bright silver
      skin_spec_shiny = 2.0;               // <<-- Very shiny
      skin_spec_power = 100.0;             // <<-- Sharp shiny
     
      ...
    }
  4. Now start XStoryPlayer, select the fastsex dungeon mod, the Saiko character and start it. Saiko should now appear somewhat silver plastic like.

Changing scene color

Open the /scenes/dungeon1.dat file. It contains the settings for the dungeon scene.

Change the light object to:

data
{
  ...
  light_ambient = (0.25,0,0.25,1); // <<-- Change this to make the global ambient light purple
  ...
}
 
light_objecti:LIGHT LIGHT1
{
  group = 0;
 
  ambient = (0.75,0.75,0.75,0); // This is how much diffuse light is added to the scene by this light
 
  color = (1,0.25,1,1); // <<-- Add this to change the color of this light to purple
}


Now start XStoryPlayer, select the fastsex dungeon mod and start it.

The scene has now an purple lighting applied to it.


Changing object size

Open the /scenes/dungeon1.dat file.

Change the light object to:

tv_objecti:PSCREEN PSCREEN1
{	  
  obj_name = "pscreen:pscreen";
 
  enabled = true;
 
  channel = 1;
 
  channels {file = "VIDEO_PATH/*.*";}
 
  scale = (2,2,2);  // <<-- Add this to resize projection screen
}


Now start XStoryPlayer, select the fastsex dungeon mod and start it.

The projection screen is now very big.