Adding Objects and Tasks

From XStoryPlayer Wiki
Jump to: navigation, search

THIS TUTORIAL IS DESIGNED FOR VERSION 3 WITH THE BETAPATCH AND WILL NOT WORK WITH 3.5(i think)

THIS TUTORIAL IS STILL VALID FOR LEARNING BUT THE FILES WILL NOT BE COMPATIBLE


This is my Tasks and Objects Tutorial

Files you will need for this tutorial are located here There are pdf files included for an offline version


Programs you will need

Maya(im using 2014)

XStoryPlayer v3 with betapatch

A program like notepad++ to make coding easier

The language we are going to be using is C++


This tutorial will focus on getting all of the tasks to work And I am assuming you have already done my first tutorial


First thing we need to do is unpack pack_tentacle_dreams http://wiki.xmoonproductions.org/index.php?title=Unpacking/packing_packs Or use the start.ini's provided


And rename it to “pack_task_tutorial”

Then delete the init folder and add the init, source and story.txt from the tutorial folder

These are just blank story files like the ones in my other tutorial but with some added code to Saiko and Monica


I have also changed the pack_task_tutorial\init\stories\tutorial\objects objects.dat


This object.dat is from the dungeon folder but will work well for this after I renamed all the sceneid's from DUNGEON1 to TUTORIAL1 (find and replace all is useful)

And the tutorial.dat pack_task_tutorial\init\stories\tutorial\scenes


Has got the bed and projector referenced in them


Now open up the maya file pack_task_tutorial\sources\scenes\tutorial scene.ma


This is an empty scene with just the basics and 2 added cubes The reason I added these cubes is because the scene is pure black until I add them in so im guessing its not rendering the world without out something else there


But for now the scene wont work anyway because we are missing a bunch of objects


Now open the pack_task_tutorial\init\stories\tutorial\objects objects.dat


And make a waypoint for every waypoint in the object.dat and place the objects away from the centre and the props on the tables around head hight feel free to check the completed Maya scene to have a look


And the tutorial.dat pack_task_tutorial\init\stories\tutorial\scenes


There will be a completed maya scene incase you don’t want to do this or want to check locations and rotations since I gotta do it anyway


RENAMEDWAYPOINTS.ma


Remember you have to use special duplicate and instance (Ctrl + Shift + D)


With the first name being what we want to call it and the second as “waypointShape”


But do all of them first then change the second name back


Then place them all where you want them


ESKWaypoints1.png


COOL now that we have all the props


Lets add in Saiko and Monica


In Maya add in 2 waypoints called “saikospawn” and “monicaspawn” to the enter of the map


Their init's have already been changed and I will only use Saiko for now


Next is to get Saiko to respond and do the correct action and add in the waypoints


So now run the fast sex dungeon scene and chose to start inside


Then press ctrl + d to see where the extra waypoints need to be


Roughly add these in with the correct names


Then run the filemaker and test the scene and move things around as needed



Now that we have the waypoints added we need to test and align them


I will be using Saiko for this tutorial but Monica will still be there watching so you can use her if you want


Now open Saiko's run0_state and run0_ref pack_task_tutorial\init\stories\tutorial\chars\saiko\brain\code


Lets do the bed first


We need the bed_wp1 to be along the flat part of the bed and a bit out but facing away from it

ESKBed.png

So add this into Saiko's run0_ref

bed.layon.you.set =
{
[state.dyn.me.do.curtask == FREE]//Im using this to check if the player is already doing an action if not do this one
 
state.dyn.me.do.tasks = BED;// do this task
state.dyn.me.do.curtask = BED1;// this is used to know what action to stop when we say stop
}
lay.you.set         = bed.layon.you.set;
bed.sleepon.you.set = bed.layon.you.set;
sleep.you.set       = bed.layon.you.set;
bed.in.go.you.set   = bed.layon.you.set;
bed.in.get.you.set  = bed.layon.you.set;
bed.layon.you.if    = bed.layon.you.set;
lay.you.if          = bed.layon.you.set;
bed.sleepon.you.if  = bed.layon.you.set;
sleep.you.if        = bed.layon.you.set;
bed.in.go.you.if    = bed.layon.you.set;
bed.in.get.you.if   = bed.layon.you.set;

now in run0_state add in

case (state.dyn.me.do.state2)
{
  [NONE]
 {
state.dyn.player.relation.sex = ALLOWED;// allow the player to do and say sex related things
state.dyn.me.do.curtask = FREE;//set the state to free so we can tell her to do actions
state.dyn.me.do.state2 = FREE;//go to a non existent state 
 }
}
case (state.dyn.me.do.tasks)
{
  [BED]
  {
		talk.s = "bed";//for debug purposes
	  loc.state.pose_type = STAND;
    loc.state.waypoint = "bed_wp1";//walk to the bed waypoint
		loc.state.exact = 1;//stand very close to the waypoint
		SetPose(loc.state);
	 do_set_timer(3);
			state.dyn.me.do.tasks = BEDACTION;
 
 
  }
 
    [BEDACTION]
  {
 loc.ts = GetTs();  
		[loc.ts < state.dyn.me.do.ts] return;
		[state.dyn.me.pose.result == NONE] return;
		talk.s = "do bed task";
	 start_task_orgasm(EAGER);
			state.dyn.me.do.tasks = WAIT;//go to a non existent state so we dont loop
 
  }
}

Save the files and run the filemaker if you have to then test it out

Tell Saiko to sleep and make sure she lays down on the bed if not correct it in the Maya scene and try until she does it


Next is the pole

ESKDildo.png

Add in the run0_ref

pole.fuck.you.set =
{
[state.dyn.me.do.curtask == FREE]
 
state.dyn.me.do.tasks = POLE;
state.dyn.me.do.curtask = POLE1;
}
pole.siton.you.set = pole.fuck.you.set;
pole.fuck.you.if   = pole.fuck.you.set;
pole.siton.you.if  = pole.fuck.you.set;

and in the run0_state case (state.dyn.me.do.tasks)


    [POLE]
  {
		talk.s = "pole";
	  loc.state.pose_type = STAND;
    loc.state.waypoint = "dildo_wp1";
		loc.state.exact = 2;//stand on the waypoint
		SetPose(loc.state);
	 do_set_timer(3);
			state.dyn.me.do.tasks = POLEACTION;
 
  }
 
    [POLEACTION]
  {
 loc.ts = GetTs();  
		[loc.ts < state.dyn.me.do.ts] return;
		[state.dyn.me.pose.result == NONE] return;
		talk.s = "do pole task";
	 start_task_pole(EAGER);
			state.dyn.me.do.tasks = WAIT;
 
  }

Then save everything run the file maker if you have to and test it out until she uses the pole correctly this one is a bit touchy so it might take a few attempts


Then the machine

ESKMachine.png


run0_ref

robot.fuck.you.set =
{
[state.dyn.me.do.curtask == FREE]
 
state.dyn.me.do.tasks = MACHINE;
state.dyn.me.do.curtask = MACHINE1;
}
robot.to.go.you.set = robot.fuck.you.set;
robot.siton.you.set = robot.fuck.you.set;
robot.use.you.set   = robot.fuck.you.set;
robot.fuck.you.if   = robot.fuck.you.set;
robot.to.go.you.if  = robot.fuck.you.set;
robot.siton.you.if  = robot.fuck.you.set;
robot.use.you.if    = robot.fuck.you.set;

run0_state case (state.dyn.me.do.tasks)

      [MACHINE]
  {
		talk.s = "machine";
	  loc.state.pose_type = STAND;
    loc.state.waypoint = "machine_wp1";
		loc.state.exact = 2;
		SetPose(loc.state);
	 do_set_timer(3);
			state.dyn.me.do.tasks = MACHINEACTION;
			state.dyn.me.do.curtask = MACHINE1;
  }
 
    [MACHINEACTION]
  {
 loc.ts = GetTs();  
		[loc.ts < state.dyn.me.do.ts] return;
		[state.dyn.me.pose.result == NONE] return;
		talk.s = "do machine task";
		    loc.tp.mood = SCARED;
    loc.tp.par = state.stat.game.machine_pose;//this uses the machine_pose locations in their stat.dat
		start_task_machine(loc.tp);
			state.dyn.me.do.tasks = WAIT;
  }

Save and run the file maker if you have to then test it out and don’t forget to add a dildo and use the black remote to turn it on and the handle on the machine to switch between vag and anal

Retry until they are both aligned

You can also change the machines pole position in

pack_task_tutorial\init\stories\tutorial\chars\saiko\brain\state pack_task_tutorial\init\stories\tutorial\chars\monica\brain\state

stat.dat under machine_pose


After that is done We have the stocks to do

ESKStocks.png

In run0_ref add

stocks.in.get.you.set = 
{
[state.dyn.me.do.curtask == FREE]
 
state.dyn.me.do.tasks = STOCKS;
state.dyn.me.do.curtask = STOCKS1;
}
stocks.use.you.set   = stocks.in.get.you.set;
stocks.siton.you.set = stocks.in.get.you.set;
stocks.in.go.you.set = stocks.in.get.you.set;
stocks.in.get.you.if = stocks.in.get.you.set;
stocks.use.you.if    = stocks.in.get.you.set;
stocks.siton.you.if  = stocks.in.get.you.set;
stocks.in.go.you.if  = stocks.in.get.you.set;

In run0_state add

        [STOCKS]
  {
		talk.s = "stock";
 
	  loc.state.pose_type = STAND;
    loc.state.waypoint = "stocks_wp1";
		loc.state.exact = 2;
		SetPose(loc.state);
	 do_set_timer(3);
 
			state.dyn.me.do.tasks = STOCKSACTION;
 
  }
 
    [STOCKSACTION]
  {
 loc.ts = GetTs();  
		[loc.ts < state.dyn.me.do.ts] return;
		[state.dyn.me.pose.result == NONE] return;
		talk.s = "do stocks task";
	 start_task_stocks(SCARED);
			state.dyn.me.do.tasks = WAIT;
 
  }

Save and run the file maker if you have to then unlock the stocks using the pin and open the stocks then tell Saiko to use stocks the waypoint has to be in the middle and a little bit back facing the stocks

These are all the ones that require aligning and the rest will just work so I will add in the rest of the code as a large chunk

In run0_ref add

dance.you.set =
{
[state.dyn.me.do.curtask == FREE]
 
state.dyn.me.do.tasks = DANCE;
state.dyn.me.do.curtask = DANCE1;
}
me.dance.you.set = dance.you.set;
dance.you.if     = dance.you.set;
me.dance.you.if  = dance.you.set;
 
 
tit.jiggle.you.set = 
{
[state.dyn.me.do.curtask == FREE]
 
state.dyn.me.do.tasks = JIGGLE;
state.dyn.me.do.curtask = JIGGLE1;
}
tit.bounce.you.set = tit.jiggle.you.set;
jiggle.you.set     = tit.jiggle.you.set;
bounce.you.set     = tit.jiggle.you.set;
tit.jiggle.you.if  = tit.jiggle.you.set;
tit.bounce.you.if  = tit.jiggle.you.set;
jiggle.you.if      = tit.jiggle.you.set;
bounce.you.if      = tit.jiggle.you.set;
 
 
anal.you.set = 
{
[state.dyn.me.do.curtask == FREE]
 
state.dyn.me.do.tasks = ASS;
state.dyn.me.do.curtask = ASS1;
 
}
ass.you.fuck.you.set = anal.you.set;
ass.fuck.you.set     = anal.you.set;
anal.you.if          = anal.you.set;
ass.you.fuck.you.if  = anal.you.set;
ass.fuck.me.if       = anal.you.set;
ass.fuck.you.if      = anal.you.set;
 
me.fuck.you.set =
{
[state.dyn.me.do.curtask == FREE]
 
state.dyn.me.do.tasks = VAG;
state.dyn.me.do.curtask = VAG1;
}
you.fuck.you.set = me.fuck.you.set;
me.fuck.you.if   = me.fuck.you.set;
you.fuck.me.if   = me.fuck.you.set;
you.fuck.you.if  = me.fuck.you.set;
 
 
 
me.blowjob.you.set =
{
[state.dyn.me.do.curtask == FREE]
 
state.dyn.me.do.tasks = BLOW;
state.dyn.me.do.curtask = BLOW1;
}
me.suck.you.set    = me.blowjob.you.set;
penis.suck.you.set = me.blowjob.you.set;
suck.you.set       = me.blowjob.you.set;
me.blowjob.you.if  = me.blowjob.you.set;
me.suck.you.if     = me.blowjob.you.set;
penis.suck.you.if  = me.blowjob.you.set;
suck.you.if        = me.blowjob.you.set;

And the run0_state

 [DANCE]
  {
		talk.s = "dance";
 
	  loc.state.pose_type = STAND;
    loc.state.waypoint = "dance_wp1";
		loc.state.exact = 0;
		SetPose(loc.state);
	 do_set_timer(3);
 
			state.dyn.me.do.tasks = DANCEACTION;
 
  }
 
    [DANCEACTION]
  {
 loc.ts = GetTs();  
		[loc.ts < state.dyn.me.do.ts] return;
		[state.dyn.me.pose.result == NONE] return;
		talk.s = "do dance";
			  loc.state.pose_type = DANCE;
    loc.state.waypoint = "dance_wp1";
		loc.state.exact = 0;
		SetPose(loc.state);
			state.dyn.me.do.tasks = WAIT;
 
  }
 
            [JIGGLE]
  {
		talk.s = "jiggle";
	 do_set_timer(3);
 
			state.dyn.me.do.tasks = JIGGLEACTION;
 
  }
 
    [JIGGLEACTION]
  {
 loc.ts = GetTs();  
		[loc.ts < state.dyn.me.do.ts] return;
		[state.dyn.me.pose.result == NONE] return;
		talk.s = "do jiggle";
			  loc.state.pose_type = JIGGLE;
    loc.state.waypoint = "#front:MAIN";//walk to the player and face them
		loc.state.exact = 0;
		SetPose(loc.state);
			state.dyn.me.do.tasks = WAIT;
 
  }
 
          [VAG]
  {
		talk.s = "backvag";
 
	  loc.state.pose_type = STAND;
    loc.state.waypoint = "#back:MAIN";//walk to the player and turn around
		loc.state.exact = 0;
		SetPose(loc.state);
	 do_set_timer(3);
			state.dyn.me.do.tasks = VAGACTION;
 
  }
 
    [VAGACTION]
  {
 loc.ts = GetTs();  
		[loc.ts < state.dyn.me.do.ts] return;
		[state.dyn.me.pose.result == NONE] return;
		talk.s = "do backvag task";
	 start_task_backvag(HAPPY);
			state.dyn.me.do.tasks = WAIT;
 
  }
 
            [ASS]
  {
		talk.s = "backass";
 
	  loc.state.pose_type = STAND;
    loc.state.waypoint = "#back:MAIN";
		loc.state.exact = 0;
		SetPose(loc.state);
	 do_set_timer(3);
			state.dyn.me.do.tasks = ASSACTION;			
  }
 
    [ASSACTION]
  {
 loc.ts = GetTs();  
		[loc.ts < state.dyn.me.do.ts] return;
		[state.dyn.me.pose.result == NONE] return;
		talk.s = "do backass task";
	 start_task_backass(HAPPY);
			state.dyn.me.do.tasks = WAIT;
 
  }
 
              [BLOW]
  {
		talk.s = "blow";
 
	  loc.state.pose_type = STAND;
    loc.state.waypoint = "#front:MAIN";
		loc.state.exact = 0;
		SetPose(loc.state);
	 do_set_timer(3);
 
			state.dyn.me.do.tasks = BLOWACTION;			
  }
 
    [BLOWACTION]
  {
 loc.ts = GetTs();  
		[loc.ts < state.dyn.me.do.ts] return;
		[state.dyn.me.pose.result == NONE] return;
		talk.s = "do blow task";
	 start_task_blowjob(EAGER);
			state.dyn.me.do.tasks = WAIT;
 
  }

Save and test the rest of the commands out

Now to add the ability to stop these commands


run0_ref

stand.you.set =
{
 
state.dyn.me.do.state2 = state.dyn.me.do.curtask;//state2 is now the task set above so it will stop the correct task
 
}
stand.you.if = stand.you.set;
stop.you.get = stand.you.set;

run0_state case (state.dyn.me.do.state2)

[BED1]
 {
state.dyn.me.do.curtask = FREE;
state.dyn.me.do.state2 = FREE;
	 stop_task_orgasm();//stop the task
	   	  loc.state.pose_type = STAND;
	      loc.state.waypoint = "#front:MAIN";//then walk to the player to reset the pose
		loc.state.exact = 0;
		SetPose(loc.state);
 }
 
 
     [POLE1]
 {
state.dyn.me.do.curtask = FREE;
state.dyn.me.do.state2 = FREE;
stop_task_pole();
  	  loc.state.pose_type = STAND;
	      loc.state.waypoint = "#front:MAIN";
		loc.state.exact = 0;
		SetPose(loc.state);
 }
      [MACHINE1]
 {
state.dyn.me.do.curtask = FREE;
state.dyn.me.do.state2 = FREE;
stop_task_machine();
  	  loc.state.pose_type = STAND;
	      loc.state.waypoint = "#front:MAIN";
		loc.state.exact = 0;
		SetPose(loc.state);
 }
  [STOCKS1]
 {
state.dyn.me.do.curtask = FREE;
state.dyn.me.do.state2 = FREE;
stop_task_stocks();
  	  loc.state.pose_type = STAND;
	      loc.state.waypoint = "#front:MAIN";
		loc.state.exact = 0;
		SetPose(loc.state);
 }
            [DANCE1]
 {
state.dyn.me.do.curtask = FREE;
state.dyn.me.do.state2 = FREE;
  	  loc.state.pose_type = STAND;
	      loc.state.waypoint = "#front:MAIN";
		loc.state.exact = 0;
		SetPose(loc.state);
 }
              [JIGGLE1]
 {
state.dyn.me.do.curtask = FREE;
state.dyn.me.do.state2 = FREE;
  	  loc.state.pose_type = STAND;
	      loc.state.waypoint = "#front:MAIN";
		loc.state.exact = 0;
		SetPose(loc.state);
}
 
  [VAG1]
  {
  state.dyn.me.do.curtask = FREE;
state.dyn.me.do.state2 = FREE;
  stop_task_backvag();
  	  loc.state.pose_type = STAND;
	      loc.state.waypoint = "#front:MAIN";
		loc.state.exact = 0;
		SetPose(loc.state);
 
  }
 
              [ASS1]
  {
state.dyn.me.do.curtask = FREE;
state.dyn.me.do.state2 = FREE;
stop_task_backass();
  	  loc.state.pose_type = STAND;
	      loc.state.waypoint = "#front:MAIN";
		loc.state.exact = 0;
		SetPose(loc.state);
  }
 
                [BLOW1]
  {
state.dyn.me.do.curtask = FREE;
state.dyn.me.do.state2 = FREE;
stop_task_blowjob();
  	  loc.state.pose_type = STAND;
	      loc.state.waypoint = "#front:MAIN";
		loc.state.exact = 0;
		SetPose(loc.state);
  }

Save and test it out ask Saiko to do a task then stop then another task


But if you do this too quickly she will break and hop around


See if you can figure out how to get her to come to you when called This part will be in the completed code in the FINAL folder


Anyway this is the basic way to add in all the toys and props you will need and to be able to tell them when to use them You can also string this together in a story


I will also add an example scene a bit later to show how you can use both Saiko and Monica in a story using the props together This will be an example only so you can see how I do it by now you should know how to read and structure code to do what you need it to


The dungeon code is a lot more advanced and uses more checks and references to make sure things are where they need to be I would advise to unpack the dungeon and go have a look


Also pack_task_tutorial\init\std\base\object Is where the objects we are using are located