Author Topic: Stop or stall the IG clock ... on purpose  (Read 798 times)

Legacy_kalbaern

  • Hero Member
  • *****
  • Posts: 1531
  • Karma: +0/-0
Stop or stall the IG clock ... on purpose
« on: January 24, 2011, 05:35:41 pm »


               Is there a way I can stop or pause the IG clock so DMs can have prolonged daylight or night times, but not screw up spell durations?

Thanks in advance. '<img'>
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Stop or stall the IG clock ... on purpose
« Reply #1 on: January 24, 2011, 07:19:38 pm »


               Don't think so. NWNX could help, but you must persuade some NWNX coder to hook minute per hour settings. Guess this won't be so hard, I remember I found these values too when debugging, maybe not minutes per hour but certainly starting hour,month,year...



Try Baaleos '<img'>
               
               

               
            

Legacy_Blue Totoro

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
Stop or stall the IG clock ... on purpose
« Reply #2 on: January 25, 2011, 04:28:18 am »


               Is there a script to actually reset the clock to an earlier time and date, preferably an exact time but perhaps not?
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Stop or stall the IG clock ... on purpose
« Reply #3 on: January 25, 2011, 06:19:52 am »


               No since, you cant go into history in date/hour, if you have 6AM and you set hour to 5AM, day gets aoutomatically advanced. Date/hour resets when restart only.
               
               

               
            

Legacy_Blue Totoro

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
Stop or stall the IG clock ... on purpose
« Reply #4 on: January 25, 2011, 06:35:38 am »


               Huh. So is there a way to get an endless looping script that happens once every 7 days at a specific time?
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Stop or stall the IG clock ... on purpose
« Reply #5 on: January 25, 2011, 06:37:43 am »


               ?
               
               

               
            

Legacy_Blue Totoro

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
Stop or stall the IG clock ... on purpose
« Reply #6 on: January 25, 2011, 06:44:15 am »


               I'm trying to make a conversation-starting script that starts once every 7 days and when the conversation ends, I can hopefully get a script that skips directly forward to morning. Apparently that last bit is possible, so if I can get that looping script, that will be grand. Maybe I could exploit the month system and say that if the day of any month at all is 7, 14, 21, or 28, it goes off?
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Stop or stall the IG clock ... on purpose
« Reply #7 on: January 25, 2011, 07:22:31 am »


               Either that or start with some day and then count in OnHeartbeat next sixs like this.

void main()
{
int daysPassed = GetLocalInt(OBJECT_SELF,"DAYS_PASSED");
int previousDay = GetLocalInt(OBJECT_SELF,"PREVIOUS_DAY");
int currentDay = GetCalendarDay();
 if(currentDay != previousDay)
 {
 SetLocalInt(OBJECT_SELF,"PREVIOUS_DAY",currentDay);
   if(daysPassed > 5)
   {
   SetLocalInt(OBJECT_SELF,"DAYS_PASSED",0);
   //start a conversation there, but on whom???
  }
  else
   {
  SetLocalInt(OBJECT_SELF,"DAYS_PASSED",daysPassed+1);
  }
 }
}


I wroted it here, so I don't garantee it will work.
               
               

               


                     Modifié par ShaDoOoW, 25 janvier 2011 - 07:23 .
                     
                  


            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
Stop or stall the IG clock ... on purpose
« Reply #8 on: January 25, 2011, 01:29:44 pm »


               Note - Altering the time via SetHour etc can also screw up DelayCommand scripts.

Eg - If you have a command delayed by for instance, 500 seconds, and tell nwn to go to the next Day via SetCalendarDay, it will advance the DelayCommand Timer forward as well, potentially making the delayed command fire early.
               
               

               
            

Legacy_kalbaern

  • Hero Member
  • *****
  • Posts: 1531
  • Karma: +0/-0
Stop or stall the IG clock ... on purpose
« Reply #9 on: January 25, 2011, 04:39:56 pm »


               

Baaleos wrote...

Note - Altering the time via SetHour etc can also screw up DelayCommand scripts.
Eg - If you have a command delayed by for instance, 500 seconds, and tell nwn to go to the next Day via SetCalendarDay, it will advance the DelayCommand Timer forward as well, potentially making the delayed command fire early.


Exactly. I was just hoping I'd missed a way not to affect delays is all. I think I'll just go with my Plan B which is making a DM wand to set lighting and skyboxes in areas on the fly from a preset list. Thanks though.
               
               

               
            

Legacy_Greyfort

  • Sr. Member
  • ****
  • Posts: 442
  • Karma: +0/-0
Stop or stall the IG clock ... on purpose
« Reply #10 on: January 26, 2011, 06:55:55 pm »


               if you want control over the clock and callander

Go in the toolset module properties advanced tab set the day month year starting hour to 1



this means every time mod reloaded it starts back at one, you will need a DB to store your module world time and then set it. down side is as shadow spoke if your db vaue is 0 and mod starts at one it will skip that zero hour and start at 1 wich isn't a big issue so players gain an hour sometimes if mod resets/reloads.



If ya give me a bit more detail IE another post you said single player mod not multiplayer the logic works just about the same for both, the issue being multiplayer PW adds the more variable factor, sigle player not so much
               
               

               
            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
Stop or stall the IG clock ... on purpose
« Reply #11 on: January 26, 2011, 08:04:25 pm »


               

Greyfort wrote...

if you want control over the clock and callander
Go in the toolset module properties advanced tab set the day month year starting hour to 1

this means every time mod reloaded it starts back at one, you will need a DB to store your module world time and then set it. down side is as shadow spoke if your db vaue is 0 and mod starts at one it will skip that zero hour and start at 1 wich isn't a big issue so players gain an hour sometimes if mod resets/reloads.

If ya give me a bit more detail IE another post you said single player mod not multiplayer the logic works just about the same for both, the issue being multiplayer PW adds the more variable factor, sigle player not so much

He's not asking how to make time persistent, he's asking how to prolong daylight/nighttime while the mod is running. The issue is that bioware's time setting always sets it forward, causing durations to run out, breaking immersion and causing other unwanted effects.

Funky
               
               

               
            

Legacy_Greyfort

  • Sr. Member
  • ****
  • Posts: 442
  • Karma: +0/-0
Stop or stall the IG clock ... on purpose
« Reply #12 on: January 26, 2011, 08:29:21 pm »


               oh then adjusting the time between dusk and dawn can make night larger smaller, using persistence will allow you to track days ie. dawn 6 dusk 10 gives 4 hours of day 20hours night calendar will progress 1 day after 24 hours expire, this is ware storing in db allows you to track or count days.



once again we have to use programing to create what we want within the limits of the toolset 90% of the things we think of are possible we just have to try.



so please Let me know i will try to help.
               
               

               
            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
Stop or stall the IG clock ... on purpose
« Reply #13 on: January 26, 2011, 09:26:42 pm »


               Again, the issue is that there is no function to do what he wants. He's already settled on the closest approximate workaround, setting of day/night appearance. The next step would be to write a function in nwnx to set time backwards as well as forwards, but that would likely be extremely involved, given the interaction between durations and clock.

Funky
               
               

               


                     Modifié par FunkySwerve, 26 janvier 2011 - 09:26 .
                     
                  


            

Legacy_Greyfort

  • Sr. Member
  • ****
  • Posts: 442
  • Karma: +0/-0
Stop or stall the IG clock ... on purpose
« Reply #14 on: January 26, 2011, 11:20:39 pm »


               kalbaern :

Is there a way I can stop or pause the IG clock so DMs can have prolonged daylight or night times, but not screw up spell durations?





Blue Totoro :

I'm trying to make a conversation-starting script that starts once every 7 days and when the conversation ends, I can hopefully get a script that skips directly forward to morning. Apparently that last bit is possible, so if I can get that looping script, that will be grand. Maybe I could exploit the month system and say that if the day of any month at all is 7, 14, 21, or 28, it goes off?



kalbaern :

Exactly. I was just hoping I'd missed a way not to affect delays is all. I think I'll just go with my Plan B which is making a DM wand to set lighting and skyboxes in areas on the fly from a preset list. Thanks though.



//---------------------------------------

npc conversation:

advance every 7 days, and set effects accordingly note( effect day/night.)

keep integrity of spells (little harder but possible)



1)Single Player module: Being a single play module allows us to do alot with toolset because we are oly having to keep that one players issues persistant and matching what npc is trying to do...set year1,month1,day0,hour0

if year important set a year through scripting



advance 7 days get current day add 7 gives you next day 7

advance hour to 23 making it night time depending on how many RT minuets =1 game hour the wait for 0 hour small if 1 min=1gt hour this is enough time to is what spell effect set on pc save them to db then do all other things you want with code maybe a cut sceen to let time go by....and now its 0 hour you can set the hour from 1-23 and not worry about the higher number issue allowing you to set the hour to what you want wich would give the day night effect if not. you can use a variable set in areas and based on database will set the effect of day night in area when pc enters.



Note: The issue with the delay command still a problem...Yet... since single player mod you can have those scripts fired after you adjust everything calander wise, then its hard coded to check calander which has already ben changed and no issue that is how i got around it.  

In doing this we ask ourselfs Logicly can we do this correctlty. we can we just have to know what we want to do and script accordingly.



DM prolonged Night:  Once again it seems strange to have it lets say hour 16dusk dawn6 and we want to prolong the  night, we cant realy make the IGCalander/Clock stop so Emulation as stated in your post will work so it will look like night when clock says daytime but that ware the DB var comes in and regaurdless of the clock time you use a variable to stop time...This is ware the persistance comes in it emulates it and although calander is off you can get it back to your persistant time after the DM event ...side effect player spell duration expired, otther module delays fired.. but this can be over come by earlier statement.



We just have to try our ideas and see how they work.  Thats the enjoyment i get from programing with the aurora toolset.  I offer my help if you would like, whats the worst that can happen we cant do it right.



I still think we arnt just limmeted to a function although a function would be most practicle and easy.  Like the issue im haveing with item properties, we have a linux function but not a windows function so I'm trying to work around that.  I see and feel its possible Just have to keep trying.



i will work on something from the information above, was just asking for a bit more detail so I might be able to better do it.  I can work with what was stated I guess the exact changes are not important, especialy if ya dont want to give away in forums.  if thats the case send me a pm.  I'm a Old Programer and free source with honor and credit is all any Good programer can ask for after all we all program here for no money just good code and fun play.



God bless