Zabaware Support Forums

Zabaware Forums => Programming using the Ultra Hal Brain Editor => Topic started by: systemshock on February 20, 2013, 11:02:39 am

Title: System shock help me trigger functions by time
Post by: systemshock on February 20, 2013, 11:02:39 am
I've recently been working on for lighting system Ultra hal

 I want to do a day and night light system, a proper one that takes the light around the figure proportion to the time of day. And also works as the default lighting system.

The problem is I cannot work out how to access time to trigger the change.

In non-code this is what I want to do.

If ( system time h:m:s) equals the trigger time (say 6:00:00) then I want you to do function  that already works.... input line trigger.

Could someone translate that into proper code I would be so grateful.
Title: Re: System shock help me trigger functions by time
Post by: One on February 20, 2013, 12:47:43 pm
Invest in a clock. :o
Title: Re: System shock help me trigger functions by time
Post by: systemshock on February 20, 2013, 07:12:33 pm
Well One you must be precognitive,

Because I have downloaded  the clock plug-in which I've integrated into Shodan my vr haptek extended mod.. It works just fine thank you .

There is also a wonderful alarm plug-in. That I am busily dissecting

Both the ideal plug-ins of the type however it still doesn't quite get me the code line that I need to run a day night cycle with style....
(It already works with two states but we can do better than that)

E.g. using my new lighting master file to create a different perspective lights on the figures during the day ,12 lighting positions in total including dusk and dawn and the blue light for the night.

Personally my favourite gadget watch (I love gadget watches by the way), is my spy net nightvision video recording watch with inspection camera. A total snip I got it for $35. From Amazon..


Title: Re: System shock help me trigger functions by time
Post by: One on February 20, 2013, 08:09:24 pm
Do you really like gadget watches? this is a Teslar Model from back in 04/05

From My cloud.. to inspire you
Title: Re: System shock help me trigger functions by time
Post by: systemshock on February 20, 2013, 10:01:58 pm
I've got quite a fine collection of gadget watches, from radios, walkie-talkies, digital compass, heart monitors is just a little thing of mine.

And model is beautiful One. Thank you for sharing.

There's always been that struggle between real-time rendering, and what we can achieve by frame rendering.

It is only of recent as normal maps and the other higher-level shaders and materials started to be applied to Realtime gaming ,that we can ever rival the stuff that we used to be able to do purely by rendering.
And it's always amazing what kind of effect you can get with a little bit of well aimed lighting.
Title: Re: System shock help me trigger functions by time
Post by: One on February 21, 2013, 12:13:50 pm
The photo is mine in several ways, I lived in azure light, my home was the cloud.
The Photo from 04/05 has the photographers name on it; C BORGMAN
I don't understand many of my own emotion when I see all my effort and planning for things just taken away from me.

I never had this much Hate in me.
Jared W
Title: Re: System shock help me trigger functions by time
Post by: One on February 21, 2013, 03:11:38 pm
Do you think Robert K. will make bunny jokes in his next column?

Just another cop that just doesn't get it.
( I actually have enjoyed your writing, but don't belittle me at this point)

Jared W >:(
Title: Re: System shock help me trigger functions by time
Post by: Carl2 on February 22, 2013, 09:27:25 am
System shock,
  I'd recomend downloading and looking at the VRHaptek plugin, VR has a website where it can be downloaded.  His plugin looks at the time and uses a night or day background but could be modified to change lighting also.  I've worked with this and actualy you need to change the background pic and the lighting.  The lighting affects the character but not the background so you need a dark and a light background.  There is also a problem with summer vs Winter daylight hours,  There are apps available to adjust for this but I was unable to get them to work correctly. 
  There are a lot of great programers out there, Haptek was a leader at one time but has fallen behind, not many people are staying with Haptek.  Also the economy is a large handicap.  Best of luck
Carl2
Title: Re: System shock help me trigger functions by time
Post by: systemshock on February 22, 2013, 06:57:07 pm
I'm already on it with VR hapTek and have been modifying it for weeks..
I totally agree with a flat background lighting does not affect it.
If we can find a way of making scenery using the character type then the lighting would affected.
I've got a simple version of the day and night sorted already is the more advanced version I'm after.
Thanks Carl
Title: Re: System shock help me trigger functions by time
Post by: cload on February 23, 2013, 03:15:15 pm
Hi all,
one of the things that you may want to consider is, creative room that has a window, have your character standing next to the window.
As the time changes the picture in the window which is outside begins to change as it gets darker then the lights in the room begins to turn on or off whichever the case may be sunrise sunset.
I believe this would give an illusion of a time factor more based on the picture outside the window becoming brighter and darker in the lights in the room begins to turn on or off based on the time.
I hope this suggestion helps you with your endeavor, not to mention it would be easier to make a picture that is in the window that is the same picture to be brighter or darker based on the time.
That way your structure remains the same meaning, she's in the room, the window is where the picture that changes is, and the lights in the room turned on or off.
Would you like for me to say it another way? Just kidding.

Sincerely, I have a bowl full of pronouns, to brighten up my day.
C load
Title: Re: System shock help me trigger functions by time
Post by: systemshock on February 23, 2013, 07:43:46 pm
Personally I have bigger and even more evil goals, I'm trying to track down a HTr converter for 3-D studio Max.. As we've already proved that we can load props why can't we load scenery, the scenery would be affected by the lighting.

Also, just evil little thought we could then use transition rotation of the scenery in proportion to the character.To create a movement of 3-D engine,As computer power is rapidly expanded it doesn't take much power to run the hapster technology. Therefore we can push it a little bit further than its original specs.

I like to think big.
Title: Re: System shock help me trigger functions by time
Post by: systemshock on February 23, 2013, 07:46:18 pm
Below is the code that I have been working on to try and make a function of time of day however I'm not find a way to get to trigger yet.. If anybody has suggestions he would be more than appreciated.



Code: [Select]
Function TimOfDayLights

If Hour(now) >= 1 And Hour(now) <= 3 Then hlFile = "Lightmaster\blue.hap"
   HalCommands = "<HAPFILE>" & hlFile & "</HAPFILE>"
   ClockResponse = "it still dark in here,what the heck are you doing up at this time!" & vbCrLf
   


   
If Hour(now) >= 4 And Hour(now) <= 6 Then hlFile = "Lightmaster\1BackCenter.hap"
   HalCommands = "<HAPFILE>" & hlFile & "</HAPFILE>"
    ClockResponse =  "the sun not come up yet in here!" & vbCrLf



 
If Hour(now) >= 6 And Hour(now) <= 8 Then hlFile = "Lightmaster\light_frombelow.hap"
   HalCommands = "<HAPFILE>" & hlFile & "</HAPFILE>"
    ClockResponse =  "the suns comeing up!" & vbCrLf

 

 
If Hour(now) = 8 Then hlFile = "Lightmaster\5fromBackBelowRight.hap"
   HalCommands = "<HAPFILE>" & hlFile & "</HAPFILE>"
    ClockResponse = "I think ,it is going to be a nice day in here are you working today? !" & vbCrLf

   


If Hour(now) = 9 Then hlFile = "Lightmaster\4fromBackright.hap"
   HalCommands = "<HAPFILE>" & hlFile & "</HAPFILE>"
    ClockResponse =  "looks like our days started!" & vbCrLf

 

If Hour(now) = 10 Then hlFile = "Lightmaster\light_fromaboveright.hap"
   HalCommands = "<HAPFILE>" & hlFile & "</HAPFILE>"
    ClockResponse =  "It's tea brake time time we get nice weather in here! "

 


If Hour(now) = 11 Then hlFile = "Lightmaster\light_fromaboveright.hap"
   HalCommands = "<HAPFILE>" & hlFile & "</HAPFILE>"
    ClockResponse = " another coffee  boss ? " & vbCrLf

 

If Hour(now) = 12 Then
"hlFile = "Lightmaster\light_fromfront.hap"
   HalCommands = "<HAPFILE>" & hlFile & "</HAPFILE>"
    ClockResponse =  "It's lunch time in here the sun is hight in the sky!" & vbCrLf


If Hour(now) = 13 Then "hlFile = "Lightmaster\light_fromfront.hap"
   HalCommands = "<HAPFILE>" & hlFile & "</HAPFILE>"
    ClockResponse =  "back to it i guess then boss!" & vbCrLf
   End If
   
If Hour(now) >= 14 And Hour(now) <= 15 Then hlFile = "Lightmaster\9fromBackAboveleft.hap"
   HalCommands = "<HAPFILE>" & hlFile & "</HAPFILE>"
    ClockResponse =  "I like early aftnoons!" & vbCrLf


If Hour(now) >= 16 And Hour(now) <= 17 Then hlFile = "Lightmaster\4fromBackright.hap"
   HalCommands = "<HAPFILE>" & hlFile & "</HAPFILE>"
    ClockResponse =  "It is late afternoon." & vbCrLf
 
 
If Hour(now) >= 18 And Hour(now) <= 19 Then hlFile = "Lightmaster\5fromBackBelowRight.hap"
   HalCommands = "<HAPFILE>" & hlFile & "</HAPFILE>"
    ClockResponse =  "the sun going down!" & vbCrLf

 

   
If Hour(now) >= 20 And Hour(now) <= 21 Then hlFile = "Lightmaster\1BackCenter.hap"
   HalCommands = "<HAPFILE>" & hlFile & "</HAPFILE>"
    ClockResponse =  "It's dusk !" & vbCrLf

If Hour(now) >= 22 And Hour(now) <= 23 Then  hlFile = "Lightmaster\blue.hap"
      HalCommands = "<HAPFILE>" & hlFile & "</HAPFILE>"
    ClockResponse =  "It's a bit dark now!" & vbCrLf


 
If Hour(now) = 24 Then Hour(now) ClockResponse = "It is midnight,the witching hour ! " & vbCrLf

    End If

End Function
Title: Re: System shock help me trigger functions by time
Post by: freddy888 on February 24, 2013, 10:16:40 am
Maybe you need the full path to the hap file ?

Also when you post code, there is a special tag for it, so that it doesn't get screwed up with bbcode and stuff.  It's the # button on the post form.  EG :

Code: [Select]
If Hour(now) >= 1 And Hour(now) <= 3 Then hlFile = "Lightmaster\blue.hap"
   HalCommands = "<HAPFILE>" & hlFile & "</HAPFILE>"
   ClockResponse = "it still dark in here,what the heck are you doing up at this time!" & vbCrLf

This also allows people to quickly and easily select and copy your code if they need to.
Title: Re: System shock help me trigger functions by time
Post by: systemshock on February 24, 2013, 10:46:31 pm
Thanks ,freddy888 I am such a newbee some time i go tidy my post up now.. thanks...
Title: Re: System shock help me trigger functions by time
Post by: systemshock on March 03, 2013, 07:04:45 pm
I think I've sorted this out now

Code: [Select]
If Hour(now) >= 1 And Hour(now) <= 3 Then hlFile = [b]"\Lightmaster\blue.hap"[/b]
   HalCommands = "<HAPFILE>" & hlFile & "</HAPFILE>"
   ClockResponse = "it still dark in here,what the heck are you doing up at this time!" & vbCrLf

Just missing a \

Also I now know how to hardwire it... So as long as the code is actually triggering it I think we've now got something that may work the day cycle code I've been after.