Jump to content

Statics appear and disappear at a given hour


Recommended Posts

Hi everyone,

 

Need you again to point me out to the right direction.

 

Ok I have this Merchant and he has a stand and he sells fruit and vegetables (whatever). I would like his stand to be empty when he leaves the Marketplace to go home let's say from 8.00PM to 8.00AM all his statics (fruit & vegetable display) disappear and from 8.00AM to 8.00PM all his statics (fruit and vegetable display) appear. I gues it's an activate disactivate type of function but how do I go about the scheduling issue.

 

In advance thanks you

 

Cheers

Link to comment
Share on other sites

Edit: Ooops. Yes, do as QQuix suggested. The lamp post scripts should be a great example.

 

 

 

You could use either GetCurrentTime command or the GameHour global variable (I only learned of the variable now... hmm...): http://cs.elderscrolls.com/index.php?title=GetCurrentTime

 

Here is one untested example (might not even compile):

ScriptName YourVeggieQuestScript
 
float fQuestDelayTime ; approximate quest script update interval
 
Begin GameMode
 
    If ( YourVeggieEnableParent.GetDisabled )
        If ( GameHour > 8 && GameHour < 20 )
            YourVeggieEnableParent.Enable
        EndIf
    Else
        If ( GameHour < 8 || GameHour > 20 )
            YourVeggieEnableParent.Disable
        EndIf
    EndIf
 
End

And here is another untested one (this one uses OBSE):

 

ScriptName YourVeggieQuestScript
 
float fQuestDelayTime ; the approximate interval, in seconds, at which the quest script runs
short veggieState ; temporary
 
Begin _GameMode
 
    let veggieState := Eval ( GameHour < 8 || GameHour > 20 ) ; 0 = day, 1 = night
    let veggieState -= Eval ( YourVeggieEnabeParent.GetDisabled ) ; 0 = enabled, 1 = disabled
 
    If Eval ( veggieState == 0 )
        Return
    ElseIf Eval ( veggieState < 0 )
        YourVeggieEnableParent.Enable
    ElseIf Eval ( veggieState > 0 )
        YourVeggieEnableParent.Disable
    EndIf   
 
End
 

 

Where the YourVeggieEnableParent if the enable parent of all the fruits and vegetables. But that is just a basic idea of how it might be possible to make it happen. There could be better ways, too, and even dynamic ones.

 

 

 

Edited by Contrathetix
Link to comment
Share on other sites

Guys as usual thanks for the help. Did not think about the lamp post script. Thanks Contathetix for even providing me with a script I can work with and wrapp my head arround it.

 

Humm by the way the Global variable seems a good idea as well.

Edited by MasterAub
Link to comment
Share on other sites

Guys as usual thanks for the help. Did not think about the lamp post script. Thanks Contathetix for even providing me with a script I can work with and wrapp my head arround it.

 

Humm by the way the Global variable seems a good idea as well.

 

No problem. And I would also like to thank QQuix for mentioning the lamp post script. Pretty obvious yet I still did not think of it. :blush:

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...