How to make scheduled sound.

Post » Sat May 17, 2014 11:59 pm

Hello i need help with something very simple. I want a sound marker to start making its sounds past midnight and to end at 6am. I haved tried copying other sound markers i thought would start at night like 'AMBrFrogsForestfallNightLP1' but they don't do anything ingame for me.

Also any chance anyone know a working script that would hide certain statics during the day?

I'm making a decent haunted house mod and i would rather the spooky stuff only happen at night.

And one got any ideas, im so tried from trying to figure these out.

Thanks

User avatar
Anna Watts
 
Posts: 3476
Joined: Sat Jun 17, 2006 8:31 pm

Post » Sat May 17, 2014 10:52 pm

Sounds can have conditions. Put a time condition on it so it will not play until it is nighttime.

User avatar
Robert
 
Posts: 3394
Joined: Sun Sep 02, 2007 5:58 am

Post » Sun May 18, 2014 3:22 am

Thanks, how would that condition look?

User avatar
Jason White
 
Posts: 3531
Joined: Fri Jul 27, 2007 12:54 pm

Post » Sun May 18, 2014 2:22 am

Ony between 6am and 6pm:

GetGlobalValue GameHour < 18.0 &&
GetGlobalValue GameHour > 6.0

User avatar
Cash n Class
 
Posts: 3430
Joined: Wed Jun 28, 2006 10:01 am

Post » Sun May 18, 2014 4:42 am


Amazing thanks,will check when I get home tonight. While im here... I have attached a script to a chair in the attic that activates an event when used. Is there a line I can add to my scripts that keeps them from running during the day? Also where on the script should I add it. Thanks!
User avatar
Sophie Miller
 
Posts: 3300
Joined: Sun Jun 18, 2006 12:35 am

Post » Sun May 18, 2014 2:04 am

You need the global property in your script (do not forget to fill it):

Global Property GameHour Auto

And then place this at the top of the script before the rest of the code:

If GameHour.getvalue() < 18.0 && GameHour.getvalue > 6.0

Return

endif

User avatar
Roanne Bardsley
 
Posts: 3414
Joined: Wed Nov 08, 2006 9:57 am

Post » Sun May 18, 2014 12:38 pm

Hi thanks for the help. I just tried this but the script failed to complie. Would you mind looking at the script for me? Its a script i use to activate an initially disabled object when used..... Do you know also.. what i could add to the script to make the object disable again after a few seconds (reset the effect of the script).

Spoiler
ScriptName _1test extends ObjectReference
{Controls a set of lights with a master enable parent
marker (EnableMarker) and a switch with this script
attached to turn on and off when the switch is activated}

ObjectReference Property EnableMarker auto
{The marker set as the enable parent of all the lights}

Event OnInit()

If (EnableMarker.IsDisabled())
GoToState("LightsOff")
Else
GoToState("LightsOn")
EndIf

EndEvent

State LightsOff

Event OnBeginState()
EnableMarker.Disable()
EndEvent

Event OnActivate(ObjectReference akActionRef)
GoToState("LightsOn")
EndEvent

EndState

State LightsOn

Event OnBeginState()
EnableMarker.Enable()
EndEvent

Event OnActivate(ObjectReference akActionRef)
GoToState("LightsOff")
EndEvent

EndState
User avatar
Dawn Farrell
 
Posts: 3522
Joined: Thu Aug 23, 2007 9:02 am

Post » Sun May 18, 2014 11:44 am

I still cant get the script to complie. All i have managed to do is add the word Variable to Global Property GameHour Auto.

Spoiler
ScriptName _1test extends ObjectReference
{Controls a set of lights with a master enable parent
marker (EnableMarker) and a switch with this script
attached to turn on and off when the switch is activated}

ObjectReference Property EnableMarker auto
{The marker set as the enable parent of all the lights}

GlobalVariable Property Globalhours auto

If GameHour.getvalue() < 18.0 && GameHour.getvalue > 6.0
Return

endif

Event OnInit()

If (EnableMarker.IsDisabled())
GoToState("LightsOff")
Else
GoToState("LightsOn")
EndIf

EndEvent

State LightsOff

Event OnBeginState()
EnableMarker.Disable()
EndEvent

Event OnActivate(ObjectReference akActionRef)
GoToState("LightsOn")
EndEvent

EndState

State LightsOn

Event OnBeginState()
EnableMarker.Enable()
EndEvent

Event OnActivate(ObjectReference akActionRef)
GoToState("LightsOff")
EndEvent

EndState



Starting 1 compile threads for 1 files...
Compiling "_1test"...
C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\_1test.psc(11,0): missing EOF at 'If'
No output generated for _1test, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on _1test


Reseting the script after period of time isnt working out either (disabling the object).. i know im asking alot but i this would be such an amazing script to have in my haunted house.
You walk into the attic at night, move towards an old crib, then a screaming rotted child appears inside of it but only for a few moments before dispearing. So far all i can do is
make the screaming child appear when you enter a trigger zone.
It would help me make hostile ghosts appear for a short period of time. I could have certain moments where ghosts would appear to simply to watch you while you sit/sleep and disapear but where and how depending on the time of night.
Maybe when you use the bed a ghost would appear under it.. I could do so much with the script, I can make models, skin and texture everything but its all pointless if i cant bring it life with the script.
User avatar
Cash n Class
 
Posts: 3430
Joined: Wed Jun 28, 2006 10:01 am

Post » Sun May 18, 2014 12:25 am

Try:
ScriptName _1test Extends ObjectReferenceBool bLightsOnObjectReference Property EnableMarker AutoGlobalVariable Property GameHour AutoEvent OnInit()	bLightsOn = !EnableMarker.IsDisabled()	OnUpdate()EndEventEvent OnUpdate()	Float fTime = GameHour.GetValue()	If bLightsOn == (fTime > 6.0 && fTime < 18.0)		bLightsOn = !bLightsOn		If bLightsOn			EnableMarker.Enable()		Else			EnableMarker.Disable()		EndIf	EndIf	RegisterForSingleUpdate(60.0)EndEvent
User avatar
Charlotte Lloyd-Jones
 
Posts: 3345
Joined: Fri Jun 30, 2006 4:53 pm

Post » Sat May 17, 2014 11:53 pm

Thanks for your help I really appreciate it. I tried ingame the and could not get any thing to appear regardless of the time of day, have you used this script yourself? I will test it further when I get back from work. I hate 15 hour shifts when I have something like this I'd rather do.
User avatar
kyle pinchen
 
Posts: 3475
Joined: Thu May 17, 2007 9:01 pm

Post » Sun May 18, 2014 4:31 am

Yes, it does work. Make sure you're testing with a clean save or new reference so OnInit is sure to fire? Is the scripted object persistent/loaded when testing? Properties filled?
ScriptName _1test Extends ObjectReferenceBool bLightsOnObjectReference Property EnableMarker AutoGlobalVariable Property GameHour AutoEvent OnInit()	Debug.Notification("OnInit")	bLightsOn = !EnableMarker.IsDisabled()	OnUpdate()EndEventEvent OnUpdate()	Debug.Notification("OnUpdate")	Float fTime = GameHour.GetValue()	If bLightsOn == (fTime > 6.0 && fTime < 18.0)		bLightsOn = !bLightsOn		If bLightsOn			EnableMarker.Enable()		Else			EnableMarker.Disable()		EndIf	EndIf	RegisterForSingleUpdate(15.0)EndEvent
Do you see "OnInit" and/or "OnUpdate"?

Also dropped the update interval as it was set to check once a minute.
User avatar
Mason Nevitt
 
Posts: 3346
Joined: Fri May 11, 2007 8:49 pm

Post » Sun May 18, 2014 1:34 am

Amazing thanks again, when i get home from work i will let you know how i get on.

I know ive asked so much already but I just realised that if and ghostly event was activated and it spooked you, it wouldnt be very immersive if you triggered the event again straight afterwards. Is there a line i can add to the script so it has a cool down period? Then its all ready, i have a few days off and i will spend it using the script to make a stupid scary mod, like the horror mod for morrowind, i loved that mod. If ever need a model or something skinned please ask cause i owe you.

User avatar
Ezekiel Macallister
 
Posts: 3493
Joined: Fri Jun 22, 2007 12:08 pm

Post » Sat May 17, 2014 9:36 pm

Hey, just tested the script. I see "OnInir and Onupdate" alot without touching my trigger, does this imply the script constantly runs and will this effect game performance?
I attached the script to a bed, linked to a initally disabled creature in the enablemarker properties and selected the creature in the linked ref tab in the beds reference box.
I started up a clean save and used the bed every hour of the day but the creature never appeared. I tried with other objects also.
What am i doing wrong? Thanks

User avatar
Adrian Powers
 
Posts: 3368
Joined: Fri Oct 26, 2007 4:44 pm

Post » Sat May 17, 2014 10:56 pm

Hey, i just finished work on my first ghost

http://fc01.deviantart.net/fs71/f/2013/130/a/b/smur_by_sinius26-d64toex.jpg

what do you think?

User avatar
R.I.p MOmmy
 
Posts: 3463
Joined: Wed Sep 06, 2006 8:40 pm

Post » Sat May 17, 2014 11:24 pm

By using both an altered version of the script i started with and and a script that disables objects\actors depending on the time one object i am able to get the desired effect i have been looking for.

Its not as convenient as the script posted by justinother would be but i cant get that to work. I would really appreciate it if anyone knows something i can add to a script to keep it from being used twice right away. Anything from an hour to a day. Thanks

User avatar
Amanda Furtado
 
Posts: 3454
Joined: Fri Dec 15, 2006 4:22 pm

Post » Sun May 18, 2014 5:02 am

What you can do here is use an Xmarker as your EnableMarker (ie fill EnableMaker property with your Xmarker), set the Xmarker as initially disabled, forget about linked Ref's you want the enable parents tab instead for any extra objects you want enabled at the same time, set each one in turn to use your Xmarker as the one enabling parent for everthing.

Don't worry about the script constantly running it's hardly resource taxing, there are plenty of scripts much more intensive than this banging away all the time in game.

I like your ghost, PM me if your looking for other ideas.

User avatar
Genocidal Cry
 
Posts: 3357
Joined: Fri Jun 22, 2007 10:02 pm


Return to V - Skyrim