Author Topic: Being Forgetful - How to change Day to Night/ Night to Day  (Read 320 times)

Legacy_Wall3T

  • Hero Member
  • *****
  • Posts: 748
  • Karma: +0/-0
Being Forgetful - How to change Day to Night/ Night to Day
« on: October 08, 2015, 08:45:59 pm »


               

Hi


 


im working on this idea of making a wand that can turn day to night and night to day. I know its relatively simple to do, but i completely forgot how to do this! lol ':unsure:'


 


Would anyone be willing to help out and tell me what id need (runs on a conversation dialogue) how to turn day to night/ night to day?



               
               

               
            

Legacy_Fester Pot

  • Hero Member
  • *****
  • Posts: 1698
  • Karma: +0/-0
Being Forgetful - How to change Day to Night/ Night to Day
« Reply #1 on: October 08, 2015, 08:47:17 pm »


               

Use SetTime() and change the hour to the start of your night or day time set in the module properties.


FP!



               
               

               
            

Legacy_Wall3T

  • Hero Member
  • *****
  • Posts: 748
  • Karma: +0/-0
Being Forgetful - How to change Day to Night/ Night to Day
« Reply #2 on: October 09, 2015, 03:42:56 am »


               

ok im a little lost at that. im pretty sure im not even close. this is what i made:


 


void main()

{

   SetTime(20);

}



               
               

               
            

Legacy_meaglyn

  • Hero Member
  • *****
  • Posts: 1451
  • Karma: +0/-0
Being Forgetful - How to change Day to Night/ Night to Day
« Reply #3 on: October 09, 2015, 01:20:32 pm »


               

That will set the time to 20h, which is usually night... but is the for a PW? You may not want to do allow a PC to do that as it will be global. And it will cause delayed commands and temporary effects to expire more quickly.  In a single player mod this can work. But remember it will move days the calendar day forward.  Generally things like resting advancing the clock for 8 hours etc are not used in multiplayer.



               
               

               
            

Legacy_Wall3T

  • Hero Member
  • *****
  • Posts: 748
  • Karma: +0/-0
Being Forgetful - How to change Day to Night/ Night to Day
« Reply #4 on: October 09, 2015, 08:53:41 pm »


               

remember this is a question i had asked in regards to a wand im building. im not sure where the idea of giving it to a player (other than myself as a PC) came  from or if it was for multiplayer. I'm simply building a wand that can change day to night, and thats it ':lol:'


 


so if resting would allow this to happen, how would i construct the script? because the one i gave above, doesnt work for me ':wacko:'



               
               

               
            

Legacy_meaglyn

  • Hero Member
  • *****
  • Posts: 1451
  • Karma: +0/-0
Being Forgetful - How to change Day to Night/ Night to Day
« Reply #5 on: October 09, 2015, 09:10:50 pm »


               

Usually wands are used by players. If it's for a DM that will also likely be multiplayer, no?  I think you work on a PW so I was just making an observation. Feel free to ignore what I said, friend.


 


Resting would only move the clock if you had it scripted to do so. Some SP mods do that so that game time passes when you rest.


 


Saying "It doesn't work" is really not that helpful.  Did your script fire at all (I think it didn't since it should work)? How are you hooking it up?  What's making your script execute?


 


Do you have the module settings set such that 20hours _is_ night?


               
               

               
            

Legacy_Wall3T

  • Hero Member
  • *****
  • Posts: 748
  • Karma: +0/-0
Being Forgetful - How to change Day to Night/ Night to Day
« Reply #6 on: October 09, 2015, 09:32:56 pm »


               


Usually wands are used by players. If it's for a DM that will also likely be multiplayer, no?  I think you work on a PW so I was just making an observation. Feel free to ignore what I said, friend.




ehhh? now im confused lol! i'm just building a wand that can change day to night, as a command (or function?) to be used by a PC. and thats it '<img'>  there is no harm in that


 



Saying "It doesn't work" is really not that helpful.  Did your script fire at all (I think it didn't since it should work)? How are you hooking it up?  What's making your script execute?

 


Do you have the module settings set such that 20hours _is_ night?




I'm entirely not sure how to answer these questions ':huh:'


 


I get an error at line 3 saying


 


10/9/2015 4:15:43 PM: Error. 'timer' did not compile.

timer.nss(3): ERROR: DECLARATION DOES NOT MATCH PARAMETERS


 


And this is the same code ive used as above '<img'>


 


void main()

{

   SetTime(20);

}

 


 


its fired from a conversation (or dialogue). and meant to go straight into the "Actions Taken" Line of the dialogue (since the idea is to fire the script when clicking on a specific word Ex: "Turn Day on" would be used as the line and the script would be fired from that line") did i do that right?


 


and i don't think the script is executing at all.


 


and yes 20 is the night hour (or hour 20 is night) for the module in question '<img'>



               
               

               
            

Legacy_meaglyn

  • Hero Member
  • *****
  • Posts: 1451
  • Karma: +0/-0
Being Forgetful - How to change Day to Night/ Night to Day
« Reply #7 on: October 09, 2015, 09:50:50 pm »


               

"It won't compile" is not really the same as "it doesn't work" '<img'>


 


Do you have access to the lexicon?  SetTime takes 4 parameters.  I had forgotten that the last ones were not defaulted.


You can put 0s there if you want (SetTime(20, 0, 0, 0)).


 


I don't care what you do with the wand. As I said I was making an observation that may or may not have been helpful. Do with it what you will.


               
               

               
            

Legacy_Wall3T

  • Hero Member
  • *****
  • Posts: 748
  • Karma: +0/-0
Being Forgetful - How to change Day to Night/ Night to Day
« Reply #8 on: October 10, 2015, 12:19:09 am »


               

ok ive set the script to


 


void main()

{

   (SetTime(20, 0, 0, 0));

}


 


which does compile successfully! yaaay (w00t!). So now when i try to initiate the script in the dialogue..... nothing happens ':huh:'


 


i'm not sure what im missing here. Or should this work??? ':mellow:' ':blink:'



               
               

               
            

Legacy_meaglyn

  • Hero Member
  • *****
  • Posts: 1451
  • Karma: +0/-0
Being Forgetful - How to change Day to Night/ Night to Day
« Reply #9 on: October 10, 2015, 01:32:43 am »


               

Take out the extra parentheses, that was just to set it apart from the text.  But that should still work.   You've attached it as an action taken script in the conversation, yes?  So put in a line like: SendMessageToPC(GetPCSpeaker(), "SetTime script runs");    and see if it's getting executed.