Aller au contenu

Photo

Stop or stall the IG clock ... on purpose


  • Veuillez vous connecter pour répondre
15 réponses à ce sujet

#1
kalbaern

kalbaern
  • Members
  • 824 messages
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. :)

#2
Shadooow

Shadooow
  • Members
  • 4 471 messages
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 ;)

#3
Blue Totoro

Blue Totoro
  • Members
  • 7 messages
Is there a script to actually reset the clock to an earlier time and date, preferably an exact time but perhaps not?

#4
Shadooow

Shadooow
  • Members
  • 4 471 messages
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.

#5
Blue Totoro

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

#6
Shadooow

Shadooow
  • Members
  • 4 471 messages
?

#7
Blue Totoro

Blue Totoro
  • Members
  • 7 messages
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?

#8
Shadooow

Shadooow
  • Members
  • 4 471 messages
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 .


#9
Baaleos

Baaleos
  • Members
  • 1 330 messages
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.

#10
kalbaern

kalbaern
  • Members
  • 824 messages

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.

#11
Greyfort

Greyfort
  • Members
  • 234 messages
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

#12
FunkySwerve

FunkySwerve
  • Members
  • 1 308 messages

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

#13
Greyfort

Greyfort
  • Members
  • 234 messages
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.

#14
FunkySwerve

FunkySwerve
  • Members
  • 1 308 messages
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 .


#15
Greyfort

Greyfort
  • Members
  • 234 messages
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

#16
FunkySwerve

FunkySwerve
  • Members
  • 1 308 messages
Ok, I'll make one more try to explain this.

Greyfort wrote...

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.

It's not 'a problem', it's the only problem. Setting time ahead is trivially easy. Fixing durations is the hard part, and there are no hooks to 'have those scripts fired' - the duration of all temporary effects in the mod is affected, no matter what applied them and when. This is the case whether the mod is single player or not (his isn't, note the reference to DMs) - multiplayer/singleplayer has nothing to do with this.

One option would be to scan all creatures in the mod and all their items, using nwnx_structs to check durations of temporary effects and itemprops, and reapply them with the same duration plus the amount you're setting time ahead. Compared to simply adjusting day/night appearance, that's an absurd amount of zots to invest for a difference players are unlikely to even notice.

I admire the spirit in which you're posting - the notion that anything can be accomplished with enough determination and cleverness. Unfortunately, doing so is sometimes just not worth the cost.

Funky