Time periodic trigger how to ?

Post » Mon Nov 19, 2012 11:03 pm

Hi I wanted to make a trigger that is activated every year at a specific day , month etc and untriggered every other day of year .. is that possible if so how?
User avatar
alyssa ALYSSA
 
Posts: 3382
Joined: Mon Sep 25, 2006 8:36 pm

Post » Mon Nov 19, 2012 9:56 am

Maybe http://www.creationkit.com/GameTimeToString_-_Utility function will help? I would try something like this:

Spoiler
Event OnTrackedStatsEvent(string asStatFilter, int aiStatValue)   If asStatFilter=="Days Passed"	  If Utility.GameTimeToString(Utility.GetCurrentGameTime())=="MM/DD/YYYY HH:MM" ;Insert relevant date in this format.		  ;Activate trigger code here	  EndIf   EndIfEndEvent

Edit: Don't forget to http://www.creationkit.com/RegisterForTrackedStatsEvent_-_Form for the tracked stat event.
User avatar
Ashley Tamen
 
Posts: 3477
Joined: Sun Apr 08, 2007 6:17 am

Post » Mon Nov 19, 2012 1:25 pm

What do u mean register? It would cause a severe lag?

Also how I kmow year etc?


Basically I need to have some items appear in winter and be removed at end of it ...
User avatar
He got the
 
Posts: 3399
Joined: Sat Nov 17, 2007 12:19 pm

Post » Mon Nov 19, 2012 10:33 am

Ya, it would probably be better to start a single update chain:

Spoiler
[/s]Event OnInit()   RegisterForSingleUpdate(1.0)EndEventEvent OnUpdate()   If Utility.GameTimeToString(Utility.GetCurrentGameTime())=="MM/DD/YYYY HH:MM"   ;Insert relevant starting date in this format.			  ;Activate trigger code here (Enable references?)	  	  RegisterForSingleUpdate(?)	;Find the time in seconds it takes for winter to pass and use it as the parameter for this function.     ElseIf Utility.GameTimeToString(Utility.GetCurrentGameTime())=="MM/DD/YYYY HH:MM"	;Insert relevant end date in this format.	  ;Disable references...   Else	  RegisterForSingleUpdate(?)   ;Find the time in seconds it takes for one day to pass and use it as the parameter for this function.     EndIf[s]EndEvent

The date at the start of Skyrim is Morndas, the 17th of Last Seed, 4E201. So I think the format for the exact date at the start of the game would be 08/17/4201.

Here is the calender explained (http://www.uesp.net/wiki/Lore%3aCalendar).


Edit: Actually that code probably won't work (requires immaculate timing), not to sure about the first method either. If there was a way to "trim" the string to get rid of the HH:MM before a comparison...
User avatar
Nichola Haynes
 
Posts: 3457
Joined: Tue Aug 01, 2006 4:54 pm

Post » Mon Nov 19, 2012 3:46 pm

So not working way ?
User avatar
Baby K(:
 
Posts: 3395
Joined: Thu Nov 09, 2006 9:07 pm

Post » Mon Nov 19, 2012 6:56 pm

Can you be more specific? What is to happen on the given day, like is the activator to just not do anything when activated on any other day or?

If that's the case:
GlobalVariable Property GameDay AutoGlobalVariable Property GameMonth AutoEvent OnActivate(ObjectReference akActionRef)	If GameDay.GetValue() != 25 ; 25'th Day	ElseIf GameMonth.GetValue() == 11 ; Evening Star		Debug.Trace("It's Christmas Day!")	EndIfEndEvent
User avatar
carla
 
Posts: 3345
Joined: Wed Aug 23, 2006 8:36 am

Post » Mon Nov 19, 2012 9:05 am

You could try getting the month day hour when the script starts then RegisterForSingleUpdateGameTime(hours). Where hours is the calculated time to the event. Then onupdate do what you need to do and again RegisterForSingleUpdateGameTime(hours) for the next event. And so on.
User avatar
trisha punch
 
Posts: 3410
Joined: Thu Jul 13, 2006 5:38 am

Post » Mon Nov 19, 2012 9:33 pm

Can you be more specific? What is to happen on the given day, like is the activator to just not do anything when activated on any other day or?

If that's the case:
GlobalVariable Property GameDay AutoGlobalVariable Property GameMonth AutoEvent OnActivate(ObjectReference akActionRef)	If GameDay.GetValue() != 25 ; 25'th Day	ElseIf GameMonth.GetValue() == 11 ; Evening Star		Debug.Trace("It's Christmas Day!")	EndIfEndEvent


I need to make a box ( invisible X ) that will trigger to appear a List of linked items and disappear when needed ..

To be more detailed I want to simulate the pack melting and freezing for winter creating so the access to atmora from my land only in the winter days ...
User avatar
Mizz.Jayy
 
Posts: 3483
Joined: Sat Mar 03, 2007 5:56 pm

Post » Mon Nov 19, 2012 10:56 am

I would use a trigger zone to check the month and day, and do your enable or disable on the pack ice based on that. And have the trigger zone in the path to the pass, where you cannot see the pack ice, so it can appear or disappear when triggered.
User avatar
Causon-Chambers
 
Posts: 3503
Joined: Sun Oct 15, 2006 11:47 pm

Post » Mon Nov 19, 2012 9:41 pm

thats not working as is a vast area and visible at distance ...
User avatar
Lillian Cawfield
 
Posts: 3387
Joined: Thu Nov 30, 2006 6:22 pm

Post » Mon Nov 19, 2012 2:42 pm

Try checking the GameMonth Global OnLoad then (mass enable parentage)?
User avatar
Kate Murrell
 
Posts: 3537
Joined: Mon Oct 16, 2006 4:02 am

Post » Mon Nov 19, 2012 9:19 pm

but how I do to enable this script ? and also do it inorder that doesn't impct in anyway on the game with lag or so ?
User avatar
Joey Bel
 
Posts: 3487
Joined: Sun Jan 07, 2007 9:44 am

Post » Mon Nov 19, 2012 10:20 am

So it's an ice bridge? If so, add the below to two hidden activators, one at each end and set all the pieces up with IceBridgeEnableParent as their parent.


Spoiler
ScriptName IceBridgeToggleScript Extends ObjectReferenceGlobalVariable Property GameMonth AutoObjectReference Property IceBridgeEnableParent AutoEvent OnLoad()	ToggleIceBridge()EndEventEvent OnUnload()	ToggleIceBridge()EndEventFunction ToggleIceBrigde()	If (GameMonth.GetValue() > 10.0 || GameMonth.GetValue() < 2.0) == IceBridgeEnableParent.IsDisabled()		If IceBridgeEnableParent.IsDisabled()			IceBridgeEnableParent.Enable()		Else			IceBridgeEnableParent.Disable()		EndIf	EndIfEndIf
User avatar
Ruben Bernal
 
Posts: 3364
Joined: Sun Nov 18, 2007 5:58 pm

Post » Mon Nov 19, 2012 4:59 pm

this would enable the bridge in a specific month and remove when the time passed? will it run all time making the game slow?why two pieces and not just a xmarker thing?
User avatar
Ria dell
 
Posts: 3430
Joined: Sun Jun 25, 2006 4:03 pm

Post » Mon Nov 19, 2012 10:40 pm

this would enable the bridge in a specific month and remove when the time passed? will it run all time making the game slow?why two pieces and not just a xmarker thing?
When approaching either end of the bridge, it would evaluate the time of month and enable/disable itself. You could add an OnPlayerLoadGame event to check each save load to increase the likelihood of it being in the proper state preemptively. This won't slow down the game as it's all event based.
User avatar
vicki kitterman
 
Posts: 3494
Joined: Mon Aug 07, 2006 11:58 am

Post » Mon Nov 19, 2012 9:25 am

actually is not a bridge , but a large flat plain north of the island , so imagine this ... http://upload.wikimedia.org/wikipedia/commons/7/72/Open_water_within_the_sea_ice_pack._-_NOAA.jpg
User avatar
TOYA toys
 
Posts: 3455
Joined: Sat Jan 13, 2007 4:22 am

Post » Mon Nov 19, 2012 11:24 am

Should work with mass enable parentage at little 'cost' just the same.
User avatar
Kara Payne
 
Posts: 3415
Joined: Thu Oct 26, 2006 12:47 am

Post » Mon Nov 19, 2012 8:06 pm

So I should attach this script to a Xmarker and link to it all the ice pieces?

ScriptName IceBridgeToggleScript Extends ObjectReferenceGlobalVariable Property GameMonth AutoObjectReference Property IceBridgeEnableParent AutoEvent OnPlayerLoadGame()        ToggleIceBridge()EndEventEvent OnUnload()        ToggleIceBridge()EndEventFunction ToggleIceBrigde()        If (GameMonth.GetValue() > 10.0 || GameMonth.GetValue() < 2.0) == IceBridgeEnableParent.IsDisabled()                If IceBridgeEnableParent.IsDisabled()                        IceBridgeEnableParent.Enable()                Else                        IceBridgeEnableParent.Disable()                EndIf        EndIfEndIf
User avatar
Spooky Angel
 
Posts: 3500
Joined: Thu Aug 10, 2006 5:41 pm

Post » Mon Nov 19, 2012 8:25 am

I'd put the script on two XMarkers/Trigger Zones, or however many you need to ensure it'll load before you're too close to it. Make the enable parent an iceberg or piece of ice though so the trigger won't be disabled.
User avatar
Shannon Lockwood
 
Posts: 3373
Joined: Wed Aug 08, 2007 12:38 pm

Post » Mon Nov 19, 2012 2:40 pm

can it enable and disable lods as well?its something that nees to be seen from distance .... but why two ? there is only one direction of approaching it ... shoudl it check every day ingame to see if is right day to trigger?
User avatar
Dominic Vaughan
 
Posts: 3531
Joined: Mon May 14, 2007 1:47 pm

Post » Mon Nov 19, 2012 7:41 pm

I don't think the OnPlayerLoadGame() event in the above script example will work. From the wiki:

Event called when the player loads a save game. This event is only sent to the player actor.

For that event to fire you'd need to have a script attached to an alias filled by the player with that event in it.
User avatar
Vahpie
 
Posts: 3447
Joined: Sat Aug 26, 2006 5:07 pm

Post » Mon Nov 19, 2012 10:14 am

I don't think the OnPlayerLoadGame() event in the above script example will work. From the wiki:



For that event to fire you'd need to have a script attached to an alias filled by the player with that event in it.
Yeah. It'd need to be in a separate ActiveMagicEffect or ReferenceAlias script, either way glued to the player.
User avatar
GLOW...
 
Posts: 3472
Joined: Thu Aug 03, 2006 10:40 am

Post » Mon Nov 19, 2012 8:49 am

now I am confused , what shoul dI do ?
User avatar
Dalley hussain
 
Posts: 3480
Joined: Sun Jun 18, 2006 2:45 am

Post » Mon Nov 19, 2012 10:05 am

Replace the OnPlayerLoadGame event with an OnLoad event and test it and see what doesn't work.
User avatar
Greg Cavaliere
 
Posts: 3514
Joined: Thu Nov 01, 2007 6:31 am


Return to V - Skyrim