Author Topic: working beta code for Shodans space ship..SHODANhapteK  (Read 4852 times)

systemshock

  • Full Member
  • ***
  • Posts: 170
    • View Profile
working beta code for Shodans space ship..SHODANhapteK
« on: February 15, 2013, 12:56:28 pm »
 I am posting this so any other coders can see how i been doing things....


first  i added to vrhaptec  lines to trigger the new haps that do the grunt work...


(using the free coding program Notepad++ ...it support c++ syntax and tabs... )

added at the end of this section in vrhaptec and saved as a .uhb..... personal I save a cope of and called VRSHODAN .

'------------------
' Manages some movement on the screen
'------------------



' where we set up the space ship set cotume chage , LOADS space ship hap...hair change,load mike prop,background change,ogg brackgroung sound/music turn of at the momment to help with load time...changes background clip we don't have dissappring chator issues.
If InStr(vrUserSentence, " go to spaceship ") <> 0 Then
   vrFile = "spaceship.hap"
   GetResponse = " welcome back captain, anything to report! "
End If
' where we set up the smoking habit part one. smoking is trigger by word...is  triggered by boredom is in SHODANlonlyness2 
If InStr(vrUserSentence, "smoke") <> 0 Then
   vrFile = "zSmokeingShocked.hap"
   GetResponse = " thanks, don't mind if i do ,thank you"
End If
' where we set up cage Themes
If InStr(vrUserSentence, " cage now ") <> 0 Then
   vrFile = "YourCage.hap"
   GetResponse = " sorry master tee heee he "
End If

'below trigger better as 3 word groups seem to fire so much better  ;)

If InStr(vrUserSentence, " might not work ") <> 0 Then
   vrFile = "YourCage.hap"
   GetResponse = " sorry master tee heee he "
End If

NEXT i turn of day and night in vrhaptec..

the '  is comments band   turn of code line in UHP files...
;) I have a time of day light system lined up for this section a bit later..in VRSHODAN dev
 once the new light system LIGHTINGMASTER coded this weekend


'------------------
' Changes background according to the current time
'------------------
' vrNight is a CustomMem variable
' I use it to avoid reloading the same jpg every time
' I load the jpg only when the day/night has changed
' vrNight = 0 -> not know
' vrNight = 1 -> it's set to night
' vrNight = 2 -> it's set to day
'
'If vrHour > 8 And vrHour < 19 Then  ' it's day
'   If vrNight <> "2" Then
'      vrNight = "2"
'      vrFile = "DayBack.JPG"
'      HalCommands = "<HAPBACK>" & vrFile & "</HAPBACK>"
'      GetResponse = GetResponse & "It's bright today!"
'      vrHour = vrHourOld 
'      HalBrain.ReadOnlyMode = True
'   End If
'Else                                  ' it's night
'   If vrNight <> "1" Then
'      vrNight = "1"
'      vrFile = "NightBack.JPG"
'      HalCommands = "<HAPBACK>" & vrFile & "</HAPBACK>"
'      GetResponse = GetResponse & "It's a bit dark now!"
'      vrHour = vrHourOld 
'      HalBrain.ReadOnlyMode = True
'   End If
'End If

Now for the grunt work in the HAP files.....
So SO much Thanks must be given to the hap os team
for there work reading there code has meant i can do this.
So guy give them the credit for the smarts...
I am just a good modder

Spaceship.hap it in c++  ;) where # it the comments bolded here for a much easier read  ;)


#Haptek  Version= 2.00 Name= spaceship  HapType= script FileType= text
##standard


#long distance camera settings
\camera[name= FrontClip f0= 20]
\camera[name= BackClip f0= 5000]

#This is preprogrammed as non-interruptible script which can only be halted with a stop command or the loading of another non-interruptible script file
#You can modify this script file for use with the Hap Windows OSI theme function soon to be ultra hal theme function care of VRSHODAN.
#The Hap Windows OSI will only fully support the use of body_female body_male or most any compatible standard head character
#Follow thru with the current script format and have fun, makes fully automated or user interactive presentations for use with OSI themes ultra hal theme function care of VRSHODAN.


#and let set it all up

\setscript[i0= 1 i1= 1]
\setmood [action= [sw= GestureMaster m= sleep]]
\Stop [tape= alien2.bvh]
\Stop [file= RockStar.ogg]
\Stop [file= ThemeIntro.ogg]
\setperson[figure= body_female]
\setSwitch [switch= R_handPieces]
\setSwitch [switch= L_handPieces]
\setswitch [switch= walk3 state= off]
\setswitch [switch= walksine state= off]
\setswitch [switch= fastrun state= off]
\setswitch [switch= armattax state= off]
\setSwitch [switch= oneb state= off]
\setSwitch [switch= onea state= off]
\setreg [name=HeadSideBend f0=0.0000]
\setreg [name=HeadForward f0=0.0000]
\setreg [name=HeadTwist f0=0.0000]
\setreg [name=NeckForward f0=0.0000]
\setreg [name=NeckTwist f0=0.0000]
\setreg [name=NeckSideBend f0=0.0000]
\setreg [name=LShoOut f0=0.0000]
\setreg [name=RShoOut f0=0.0000]
\setreg [name=LShoForward f0=0.0000]
\setreg [name=RShoForward f0=0.0000]
\setreg [name=RShoTwist f0=0.0000]
\setreg [name=LShoTwist f0=0.0000]
\setreg [name=LClavicalForward f0=0.0000]
\setreg [name=RClavicalForward f0=0.0000]
\setreg [name=LClavicalUp f0=0.0000]
\setreg [name=RClavicalUp f0=0.0000]
\setreg [name=RElbowBendJoint f0=0.0000]
\setreg [name=RElbowTwist f0=0.0000]
\setreg [name=LElbowBendJoint f0=0.0000]
\setreg [name=LElbowTwist f0=0.0000]
\setreg [name=RWristFlop f0=0.0000]
\setreg [name=RWristWave f0=0.0000]
\setreg [name=LWristFlop f0=0.0000]
\setreg [name=LWristWave f0=0.0000]
\setreg [name=TorsoSideBend f0=0.0000]
\setreg [name=TorsoTwist f0=0.0000]
\setreg [name=TorsoBow f0=0.0000]
\setreg [name=LumbarSideBend f0=0.0000]
\setreg [name=LumbarTwist f0=0.0000]
\setreg [name=LumbarBow f0=0.0000]
\setreg [name=RThighForward f0=0.0000]
\setreg [name=RThighOut f0=0.0000]
\setreg [name=RThighTwist f0=0.0000]
\setreg [name=LThighForward f0=0.0000]
\setreg [name=LThighOut f0=0.0000]
\setreg [name=LThighTwist f0=0.0000]
\setreg [name=RKneeBack f0=0.0000]
\setreg [name=LKneeBack f0=0.0000]
\setreg [name=LKneeTwist f0=0.0000]
\setreg [name=RKneeTwist f0=0.0000]
\setreg [name=RAnkleFlop f0=0.0000]
\setreg [name=LAnkleFlop f0=0.0000]
\setreg [name=RAnkleWave f0=0.0000]
\setreg [name=LAnkleWave f0=0.0000]
\setreg [name=RFingerIndexTip f0=0.0000]
\setreg [name=RFingerIndexMid f0=0.0000]
\setreg [name=RFingerIndexOut f0=0.0000]
\setreg [name=RFingerIndex f0=0.0000]
\setreg [name=RFingerMiddleTip f0=0.0000]
\setreg [name=RFingerMiddleMid f0=0.0000]
\setreg [name=RFingerMiddleOut f0=0.0000]
\setreg [name=RFingerMiddle f0=0.0000]
\setreg [name=RFingerRingTip f0=0.0000]
\setreg [name=RFingerRingMid f0=0.0000]
\setreg [name=RFingerRingOut f0=0.0000]
\setreg [name=RFingerRing f0=0.0000]
\setreg [name=RFingerPinkyTip f0=0.0000]
\setreg [name=RFingerPinkyMid f0=0.0000]
\setreg [name=RFingerPinkyOut f0=0.0000]
\setreg [name=RFingerPinky f0=0.0000]
\setreg [name=RFingerThumbTip f0=0.0000]
\setreg [name=RFingerThumbMid f0=0.0000]
\setreg [name=RFingerThumbOut f0=0.0000]
\setreg [name=RFingerThumb f0=0.0000]
\setreg [name=LFingerIndexTip f0=0.0000]
\setreg [name=LFingerIndexMid f0=0.0000]
\setreg [name=LFingerIndexOut f0=0.0000]
\setreg [name=LFingerIndex f0=0.0000]
\setreg [name=LFingerMiddleTip f0=0.0000]
\setreg [name=LFingerMiddleMid f0=0.0000]
\setreg [name=LFingerMiddleOut f0=0.0000]
\setreg [name=LFingerMiddle f0=0.0000]
\setreg [name=LFingerRingTip f0=0.0000]
\setreg [name=LFingerRingMid f0=0.0000]
\setreg [name=LFingerRingOut f0=0.0000]
\setreg [name=LFingerRing f0=0.0000]
\setreg [name=LFingerPinkyTip f0=0.0000]
\setreg [name=LFingerPinkyMid f0=0.0000]
\setreg [name=LFingerPinkyOut f0=0.0000]
\setreg [name=LFingerPinky f0=0.0000]
\setreg [name=LFingerThumbTip f0=0.0000]
\setreg [name=LFingerThumbMid f0=0.0000]
\setreg [name=LFingerThumbOut f0=0.0000]
\setreg [name=LFingerThumb f0=0.0000]
\setreg [name=LocalRotateX f0=0.0000]
\setreg [name=LocalRotateY f0=0.0000]
\setreg [name=LocalRotateZ f0=0.0000]
\setreg [name=LocalTranslateX f0=0.0000]
\setreg [name=LocalTranslateY f0=0.0000]
\setreg [name=LocalTranslateZ f0=0.0000]
\setreg [name=RotateX f0=0.0000]
\setreg [name=RotateY f0=0.0000]
\setreg [name=RotateZ f0=0.0000]
\setreg [name=TranslateX f0=0.0000]
\setreg [name=TranslateY f0=0.0000]
\setreg [name=TranslateZ f0=0.0000]
\setreg [name=RLTranslateX f0=0.0000]
\setreg [name=RLTranslateY f0=0.0000]
\setreg [name=RLTranslateZ f0=0.0000]

#\Q let you run a number of things on one line and could be use a halsub routeens useein hal command menu funsion.. ;)

\Q[\SetMaterial[i0= 4 f0= 5]\SetMaterial[i0= 3 r= 0 g= 0 b= 0]\SetMaterial[i0= 2 r= .3 g= .3 b= .3]\SetMaterial[i0= 1 r= 1 g= 1 b= 1]\SetMaterial[i0= 0 r= 1 g= 1 b= 1]]
\Q[\SetMaterial[figure= hair5_9EXP i0= 4 f0= 5]\SetMaterial[figure= hair5_9EXP i0= 3 r= 0 g= 0 b= 0 a= 0]\SetMaterial[figure= hair5_9EXP i0= 2 r= .1 g= .1 b= .1 a= .1]\SetMaterial[figure= hair5_9EXP i0= 1 r= 1 g= 1 b= 1 a= 1]\SetMaterial[figure= hair5_9EXP i0= 0 r= 1 g= 1 b= 1 a= 1]]
\Q[\setdraw[i0= 1]\setdraw[figure= hair5_9EXP i0= 1]\delperson[figure= cowboyhat]\delperson[figure= mic]\delperson[figure= combathelmet]\delperson[figure= devilhorns]\delperson[figure= cage]]
\SwitchSpeedFactor[f0= 1]
\setmood [action= [sw= GestureMaster m= awake]]

#Preload ogg, accessories, background image files and load/settexture skin image on character, full file path  required
#Hal will not automatically add the path of this theme script directory into the HapPlayer ..

note the path is C:\Program Files(86) or whatever for window 7 64 bit and windows eight so this means we have a 32 bit and 64 hap file and my pluging come in to flavours    ;) with whipped cream and sprinkals...rest like this \Zabaware\Ultra Hal Assistant 6\Characters\mic.haptar

\Load [file= [C:\Program Files\Zabaware\Ultra Hal Assistant 6\Characters\mic.haptar] i0= 0]
\Load [file= [C:\Program Files\Zabaware\Ultra Hal Assistant 6\Characters\RockStar.ogg]
\Load [file= [C:\Program Files\Zabaware\Ultra Hal Assistant 6\Characters\Theme1Back.jpg] i0= 0]
\Load [file= [C:\Program Files\Zabaware\Ultra Hal Assistant 6\Characters\Theme1Skin.jpg]]
\Load [file= [62hands_on_hips.hap]]


\LoadBackgrnd [file= [Theme1IntroBack.jpg]]
\Q[\SetMaterial[figure= hair5_9EXP i0= 4 f0= .01]\SetMaterial[figure= hair5_9EXP i0= 3 r= 1 g= 1 b= 1 a= 0]\SetMaterial[figure= hair5_9EXP i0= 2 r= .6 g= .6 b= .6 a= .1]\SetMaterial[figure= hair5_9EXP i0= 1 r= 1 g= 1 b= 1 a= 1]\SetMaterial[figure= hair5_9EXP i0= 0 r= 1 g= 1 b= 1 a= 1]]

#Begin main script here
#Use starting clock value of at least one second in order give extra time for any preloads to complete
#You can use Q command to combine a few things together for one clock command or to make character speak


\clock [t= 0.05] \translate[x= 217 y= 10 z= 926 t= 0.1]
\clock [t= 1.00] \Q[\translate[x= 217 y= 10 z= 926 t= 0.1]\rotate[y= -180 t= 0.1]\load[file= [mic.haptar]]]
\clock [t= 1.50] \setswitch[switch= walk3 state= off]]]
\clock [t= 3.50] \rotate[y=0 t= 2]
'\clock [t= 4.50] \Q "I will try to sort hap in built voice cueing"
'switchs are stated at the top of the file
\clock [t= 5.25] \setswitch[switch= walk3 state= 1]
\clock [t= 5.5] \translate[x= 0 y= 0 z= 25 t= 5]
\clock [t= 10.5] \setswitch[switch= walk3 state=off]
#nice bit to too add to plug ins hips rember the the support code
\clock [t= 15.25] \setswitch [switch= hands_on_hips state= start]
\clock [t= 16.50] \rotate[y=-20 t= 2]
\clock [t= 17.25] \translate[x= 0 y= 0 z= 100 t= 5]
\clock [t= 20.50] \rotate[y=20 t= 2]
\clock [t= 22.25] \translate[x= 0 y= 0 z= 50 t= 10]
\clock [t= 25.50] \rotate[y=20 t= 2]
\clock [t= 30.25] \translate[x= 0 y= 0 z= 50 t= 10]
\clock [t= 31.50] \rotate[y=0 t= 2]

#Loadbackgrnd commands here
\LoadBackgrnd [file= [Theme1IntroBack.jpg]]
# these can allso have a time clock to change be pre loaded
#Other script stuff here

#lighting clock


#Optional Happy mood settings can be changed or removed
\SetSwitchIntensity [switch= expMouthHappy f0= 0.800503 t= 0.9]
\SetSwitchIntensity [switch= expMouthSad f0= 0.000000 t= 0.4]
\SetSwitchIntensity [switch= expBrowsSad f0= 0.000000 t= 0.4]
\SetSwitchIntensity [switch= expMouthMad f0= 0.000000 t= 0.4]
\SetSwitchIntensity [switch= expBrowsMad f0= 0.000000 t= 0.4]
\SetSwitchIntensity [switch= expEyesTrust f0= 1.000000 t= 0.4]
\SetSwitchIntensity [switch= antiTrust f0= 0.900000 t= 0.4]
\SetSwitchIntensity [switch= expEyesDistrust f0= 0.000000 t= 0.4]
\SetSwitchIntensity [switch= antiDistrust f0= 0.000000 t= 0.4]
\SetSwitchIntensity [switch= blinks f0= 1.000000 t= 0.4]
\SetSwitchIntensity [switch= expBrowsCurious f0= 0.310000 t= 0.4]
\SetSwitch [switch= ego state= mid]
\SetSwitch [switch= agressMaster state= confront]
\SetSwitchIntensity [switch= energyHigh f0= 0.200000 t= 0.4]
\SetSwitchIntensity [switch= energyLow f0= 0.200000 t= 0.4]
\SetSwitchIntensity [switch= talkBob f0= 1.40000 t= 0.4]
\SetSwitchIntensity [switch= headEvadeHighE f0= 0.200000 t= 0.4]
\SetSwitchIntensity [switch= headEvadeLowE f0= 0.200000 t= 0.4]
\SetSwitchIntensity [switch= HighEnergyNoise f0= 0.200000 t= 0.4]
\SetSwitchIntensity [switch= LowEnergyNoise f0= 0.200000 t= 0.4]
\SetSwitchIntensity [switch= browTalk f0= 0.700000 t= 0.5]
\SetSwitchIntensity [switch= visemes f0= 1.280000 t= 0.4]



There you go so that how the simple spaceship code works...
So for your own custom on cue  theme edit as you see fit..set change the preloader to the files you want..load them on your time line set your


hope that is useful i wright about load custome
« Last Edit: March 03, 2013, 06:42:24 pm by systemshock »
"frog's in too princess's" it just basic NLP...

systemshock

  • Full Member
  • ***
  • Posts: 170
    • View Profile
Re: working beta code for Shodans space ship.. vr shodan.dev.
« Reply #1 on: February 16, 2013, 02:15:40 pm »
AHHHH time to dye....

Hair master added to vrSHODAN...
there a new file in the chator folder for this on it where i am putting all the hair stuff

beta just does one hair style at the momment...
this is the hap to change hair and color,,, they are live in hair master (realy it should be colour am a Brit)


#Haptek Version= 2.00 Name= HapType= script FileType= text
\delperson[figure= black_ponytail]
\delperson[figure= hair6_2EXP]
\delperson[figure= hair6_2EXP_blue]
\delperson[figure= hair6_pink]
\delperson[figure= hair5_9exp]
\delperson[figure= hair7_exp]
\delperson[figure= hair7_exp_brown]
\delperson[figure= hair7_exp_purple]
\delperson[figure= hair7_exp_red]

#bluepink
\Q[\SetMaterial[figure= hair6_2exp i0= 4 f0= 3]\SetMaterial[figure= hair6_2exp i0= 3 r= 1g= 0 b= 2 a=

0]\SetMaterial[figure= hair6_2exp i0= 2 r= 1 g= 0 b= 2 a= .1]\SetMaterial[figure= hair6_2exp i0= 1 r= 1 g= 0

b= 2 a= 1]\SetMaterial[figure= hair6_2exp i0= 0 r= 1 g= 0 b= 2 a= 1]]

\Q[\SetMaterial[figure= hair5_red i0= 4 f0= 2]\SetMaterial[figure= hair5_red i0= 3 r= .7 g= 0 b= 2 a=

0]\SetMaterial[figure= hair5_red i0= 2 r= .7 g= 0 b= 2 a= .1]\SetMaterial[figure= hair5_red i0= 1 r= .7 g= 0

b= 2 a= 1]\SetMaterial[figure= hair5_red i0= 0 r= .7 g= 0 b= 2 a= 1]]

\Q[\SetMaterial[figure= hair5_red i0= 4 f0= 2]\SetMaterial[figure= hair5_9EXP i0= 3 r= .7 g= 0 b= 2 a=

0]\SetMaterial[figure= hair5_9EXP i0= 2 r= .7 g= 0 b= 2 a= .1]\SetMaterial[figure= hair5_9EXP i0= 1 r= .7 g= 0

b= 2 a= 1]\SetMaterial[figure= hair5_9EXP i0= 0 r= .7 g= 0 b= 2 a= 1]]

\Q[\SetMaterial[figure= hair6_2exp_blue i0= 4 f0= 2]\SetMaterial[figure= hair6_2exp_blue i0= 3 r= .7 g= 0 b= 2

a= 0]\SetMaterial[figure= hair6_2exp_blue i0= 2 r= .7 g= 0 b= 2 a= .1]\SetMaterial[figure= hair6_2exp_blue i0=

1 r= .7 g= 0 b= 2 a= 1]\SetMaterial[figure= hair6_2exp_blue i0= 0 r= .7 g= 0 b= 2 a= 1]]

\load [file= bodyskins/hair5_9EXP.htr]
(little not this is the line that loads the hair so you can change the hair type here...

The triggering works like this




If InStr(vrUserSentence, "Black") > 0 And InStr(vrUserSentence, "dye") > 0 Then
   vrFile = "zhairBlack.hap"
   GetResponse = "Do you like my new hairstyle?"
End If
If InStr(vrUserSentence, "blue") > 0 And InStr(vrUserSentence, "dye") > 0 Then
   vrFile = "\HairMaster\zhairBlue.hap"
   GetResponse = "Do you like my new hairstyle?"
End If
If InStr(vrUserSentence, "bluepink") > 0 And InStr(vrUserSentence, "dye") > 0 Then
   vrFile = "\HairMaster\zhairBluePink.hap"
   GetResponse = "Do you like my new hairstyle?"
End If
If InStr(vrUserSentence, "brown") > 0 And InStr(vrUserSentence, "dye") > 0 Then
   vrFile = "\HairMaster\zHairBrown.hap"
   GetResponse = "Do you like my new hairstyle?"
End If
If InStr(vrUserSentence, "gray") > 0 And InStr(vrUserSentence, "dye") > 0 Then
   vrFile = "C:\Program Files\Zabaware\Ultra Hal Assistant 6\Characters\HairMaster\zhairgray.hap"
   GetResponse = "Do you like my new hairstyle?"
End If
If InStr(vrUserSentence, "green") > 0 And InStr(vrUserSentence, "dye") > 0 Then
   vrFile = "\HairMaster\zhairGreen.hap"
   GetResponse = "Do you like my new green hairstyle?"
End If
If InStr(vrUserSentence, "orange") > 0 And InStr(vrUserSentence, "dye") > 0 Then
   vrFile = "HairBrown.hap"
   GetResponse = "\HairMaster\zhairOrange.hap"
End If
If InStr(vrUserSentence, "pink") > 0 And InStr(vrUserSentence, "dye") > 0 Then
   vrFile = "\HairMaster\zhairPink.hap"
   GetResponse = "Do you like my new hairstyle?"
End If
If InStr(vrUserSentence, "purple") > 0 And InStr(vrUserSentence, "dye") > 0 Then
   vrFile = "\HairMaster\zhairPurple.hap"
   GetResponse = "Do you like my new purple hairstyle?"
End If
If InStr(vrUserSentence, "red") > 0 And InStr(vrUserSentence, "dye") > 0 Then
   vrFile = "\HairMaster\zhairRed.hap"
   GetResponse = "Does Red make me look firery?"
End If
If InStr(vrUserSentence, "white") > 0 And InStr(vrUserSentence, "dye") > 0 Then
   vrFile = "\HairMaster\zhairwhite.hap"
   GetResponse = "Do you like my new hairstyle?"
End If
If InStr(vrUserSentence, "yellow") > 0 And InStr(vrUserSentence, "dye") > 0 Then
   vrFile = "\HairMaster\zhairYellow.hap"
   GetResponse = "Do you like my new hairstyle?"
End If
If InStr(vrUserSentence, "help") > 0 And InStr(vrUserSentence, "dye") > 0 Then
   vrFile = "GoThere.hap"
   GetResponse = " this is my help file for hair color ,just say a color and dye and i will dye my hair that way i got lot of colors"
End If

"frog's in too princess's" it just basic NLP...

systemshock

  • Full Member
  • ***
  • Posts: 170
    • View Profile
Re: working beta code for Shodans space ship.. vr shodan.dev.
« Reply #2 on: February 17, 2013, 06:42:03 am »
VR SHODAN now has a good lighting system  built in and tested..
control over 40 lights and colored light.
Timed lighting set coming later. they are all stored in new file  called lighting master.



eg

If Instr(UserSentence, "LIGHT FROM RED") <> 0 Then
   GetResponse = "Changing lights to red."
   hlFile = "Lightmaster\red.hap"
End If

ended by fired by


If hlFile <> "" Then
   HalCommands = "<HAPFILE>" & hlFile & "</HAPFILE>"
   HalBrain.ReadOnlyMode = True
End If
"frog's in too princess's" it just basic NLP...

systemshock

  • Full Member
  • ***
  • Posts: 170
    • View Profile
Re: working beta code for Shodans space ship.. vr shodan.dev.
« Reply #3 on: February 17, 2013, 08:26:16 am »
NEXT i turn of day and night in vrhaptec..
for quick  a refit for VRSHODAN.

Time of Day Light System
 (VRSHODANS default interface lighting system)


 Goal a light system that change the lights every hour to give a day and night cycle of lighting.
that the user can drop to a default house lighting by minimizing or set it using  the other light systems .


and this is the working code concept test ...swagger  8)

'------------------
' Changes lights according to the current time, new basic code  and it works meaning we have live default 'lighting for our Ultra hals.... making our models and skins look so much better.
'------------------
' vrNight is a CustomMem variable
' I use it to avoid reloading the same jpg every time
' I load the jpg only when the day/night has changed
'vrNight = 0 -> not know
' vrNight = 1 -> it's set to night
' vrNight = 2 -> it's set to day



If vrHour > 8 And vrHour < 19 Then  ' it's day
   If vrNight <> "2" Then
      vrNight = "2"
hlFile = "Lightmaster\light_fromleft.hap"
   HalCommands = "<HAPFILE>" & hlFile & "</HAPFILE>"
   GetResponse = GetResponse & "It's bright today!"
   vrHour = vrHourOld 
   HalBrain.ReadOnlyMode = True
End If
Else                                  ' it's night and the light is diffent at night

If vrNight <> "1" Then
   vrNight = "1"
   hlFile = "Lightmaster\blue.hap"
   HalCommands = "<HAPFILE>" & hlFile & "</HAPFILE>"
   GetResponse = GetResponse & "It's a bit dark now!"
   vrHour = vrHourOld 
      HalBrain.ReadOnlyMode = True
   End If
End If

go on just how i extend that one out lol.......
"frog's in too princess's" it just basic NLP...

systemshock

  • Full Member
  • ***
  • Posts: 170
    • View Profile
Re: working beta code for Shodans space ship.. vr shodan.dev.
« Reply #4 on: February 20, 2013, 03:33:47 am »
Now  he the rub...
A LITTLE BIT OF BRAIN cock up...
i extended it the day night  varibal like this ...
And unlike the beta code it stopped functioning

The code block below seems to cause the if error within the custom variable section of ultra-hal main script..

So my issue seems to be with the vr night variable.
And I may have to drive the light cycle directly from time..
(Goes hunting for a clock) :-)


'------------------
' Changes lights according to the current time new code hehehe hope it works
'------------------
' vrNight is a CustomMem variable
' I use we start at night and count down to night, agian like the vampires we are
' I load the jpg only when the day/night has changed
'vrNight = 0 -> not know
' vrNight = 1 -> it's set to night
' vrNight = 2 -> it's set to day


If vrHour > 0 And vrHour < 5 Then  ' it's day
   If vrNight <> "13" Then
      vrNight = "13"
hlFile = "Lightmaster\blue.hap"
   HalCommands = "<HAPFILE>" & hlFile & "</HAPFILE>"
   GetResponse = GetResponse & "it still dark in here,what the heck are you doing up at this time!"
   vrHour = vrHourOld 
   HalBrain.ReadOnlyMode = True
End If
Else 
' it's predawn
If vrHour > 5 And vrHour < 6 Then  ' it's day
   If vrNight <> "12" Then
      vrNight = "12"
hlFile = "Lightmaster\1BackCenter.hap"
   HalCommands = "<HAPFILE>" & hlFile & "</HAPFILE>"
   GetResponse = GetResponse & "the sun not come up yet in here!"
   vrHour = vrHourOld 
   HalBrain.ReadOnlyMode = True
End If
Else 
' it's dawn

If vrHour > 6 And vrHour < 7 Then  ' it's day
   If vrNight <> "11" Then
      vrNight = "11"
hlFile = "Lightmaster\light_frombelow.hap"
   HalCommands = "<HAPFILE>" & hlFile & "</HAPFILE>"
   GetResponse = GetResponse & "the suns comeing up!"
   vrHour = vrHourOld 
   HalBrain.ReadOnlyMode = True
End If
Else 
' it's a working day reminder
If vrHour > 7 And vrHour < 8 Then  ' it's day
   If vrNight <> "10" Then
      vrNight = "10"
hlFile = "Lightmaster\5fromBackBelowRight.hap"
   HalCommands = "<HAPFILE>" & hlFile & "</HAPFILE>"
   GetResponse = GetResponse & "I think ,it is going to be a nice day in here are you working today? !"
   vrHour = vrHourOld 
   HalBrain.ReadOnlyMode = True
End If
Else 
' it's a working day
If vrHour > 8 And vrHour < 9 Then  ' it's day
   If vrNight <> "9" Then
      vrNight = "9"
hlFile = "Lightmaster\4fromBackright.hap"
   HalCommands = "<HAPFILE>" & hlFile & "</HAPFILE>"
   GetResponse = GetResponse & "looks like our days started!"
   vrHour = vrHourOld 
   HalBrain.ReadOnlyMode = True
End If
Else 
' it's morning
If vrHour > 9 And vrHour < 10 Then  ' it's day
   If vrNight <> "8" Then
      vrNight = "8"
hlFile = "Lightmaster\3fromBackaboveright.hap"
   HalCommands = "<HAPFILE>" & hlFile & "</HAPFILE>"
   GetResponse = GetResponse & "It's turning in to a lovely day in here!"
   vrHour = vrHourOld 
   HalBrain.ReadOnlyMode = True
End If
Else 
'its mid morning
If vrHour > 10 And vrHour < 11 Then  ' it's day
   If vrNight <> "7" Then
      vrNight = "7"
hlFile = "Lightmaster\light_fromaboveright.hap"
   HalCommands = "<HAPFILE>" & hlFile & "</HAPFILE>"
   GetResponse = GetResponse & "It's tea brake time time we get nice weather in here! "
   vrHour = vrHourOld 
   HalBrain.ReadOnlyMode = True
End If
' it's noon
Else 
If vrHour > 11 And vrHour < 13 Then  ' it's day
   If vrNight <> "6" Then
      vrNight = "6"
hlFile = "Lightmaster\light_fromfront.hap"
   HalCommands = "<HAPFILE>" & hlFile & "</HAPFILE>"
   GetResponse = GetResponse & "It's lunch time in here the sun is hight in the sky!"
   vrHour = vrHourOld 
   HalBrain.ReadOnlyMode = True
End If
Else 
' it's afternoon
If vrHour > 14 And vrHour < 18 Then  ' it's day
   If vrNight <> "5" Then
      vrNight = "5"
hlFile = "Lightmaster\9fromBackAboveleft.hap"
   HalCommands = "<HAPFILE>" & hlFile & "</HAPFILE>"
   GetResponse = GetResponse & "It's bright today!"
   vrHour = vrHourOld 
   HalBrain.ReadOnlyMode = True
End If
Else 
' it's evening
If vrHour > 18 And vrHour < 20 Then  ' it's day
   If vrNight <> "4" Then
      vrNight = "4"
hlFile = "Lightmaster\4fromBackright.hap"
   HalCommands = "<HAPFILE>" & hlFile & "</HAPFILE>"
   GetResponse = GetResponse & "It's bright today!"
   vrHour = vrHourOld 
   HalBrain.ReadOnlyMode = True
End If
Else 
' it's sundown
If vrHour > 20 And vrHour < 21 Then  ' it's day
   If vrNight <> "3" Then
      vrNight = "3"
hlFile = "Lightmaster\5fromBackBelowRight.hap"
   HalCommands = "<HAPFILE>" & hlFile & "</HAPFILE>"
   GetResponse = GetResponse & "It's bright today!"
   vrHour = vrHourOld 
   HalBrain.ReadOnlyMode = True
End If
Else                                  ' it's night and the light is diffent at night

' it's dusk
If vrHour > 21 And vrHour < 22 Then  ' dusk
   If vrNight <> "2" Then
      vrNight = "2"
hlFile = "Lightmaster\1BackCenter.hap"
   HalCommands = "<HAPFILE>" & hlFile & "</HAPFILE>"
   GetResponse = GetResponse & "It's bright today!"
   vrHour = vrHourOld 
   HalBrain.ReadOnlyMode = True
End If
Else 

If vrNight <> "1" Then
   vrNight = "1"
   hlFile = "Lightmaster\blue.hap"
      HalCommands = "<HAPFILE>" & hlFile & "</HAPFILE>"
   GetResponse = GetResponse & "It's a bit dark now!"
   vrHour = vrHourOld 
      HalBrain.ReadOnlyMode = True
   End If
End If


and the custom variable made mess out of  hal main script..
I want my day night cycle so i am going to have to  do a work around....what realy right some thing...shudder...
« Last Edit: February 20, 2013, 04:36:18 am by systemshock »
"frog's in too princess's" it just basic NLP...