most recent and proper topic on point.Who is for it is rather moot on this topic as if you look at the topic then, almost everyone is for it by default. That surely has not changed and is not the issue, but if this is possible. What I would interrested in is the opinion of Selmak, as he is back on the team unlike back then and could actually do it.
So voila, the actual useful excerpts concerning the mechanics:
Terra_777 wrote:
60 RL mins per nwn hour:
30 Hours To Seconds = 108000 seconds
30 Turns To Seconds = 1800 seconds
30 Rounds To Seconds = 180 seconds
2 RL mins per nwn hour:
30 Hours To Seconds = 3600 seconds
30 Turns To Seconds = 1800 seconds
30 Rounds To Seconds = 180 seconds
Selmak wrote:
It could cause a lot of problems if it wasn't approached in the right way.
The minor benefit at the end is not so minor. Being able to adjust the length of the day to suit everyone without throwing all game-hours-based timing out of whack, that's pretty handy.
I counted 61 scripts that use the HoursToMinutes() function in the HOTU script base (bear in mind, a number of scripts from the original NWN are superseded). At least some of these are spell scripts. Edit: Comparing to the lists for base NWN and SoU and eliminating duplicates, I ended up with a total of 75 scripts. Click
here for list.
Obviously this doesn't cover the entirety of scripts used by Amia, and it wouldn't cover scripts that have not used that function to convert hours into seconds (but then, they wouldn't change duration unexpectedly anyway). But it does mean that the scope of this change isn't quite as big as digging through 400 scripts.
Selmak wrote:
It's time-consuming, but not necessarily tricky.
1. Add a new included fucntion which sets the right duration for hours-based spells. To retain the current duration (two RL minutes per hour for spells) we just do:
Code:
float SpellHourToSeconds(int nCasterLevel){
int nMultiplier = 2;
// N.B. The multiplier can also be retrieved from a local int set on the module, saves rebuilding!
return TurnsToSeconds(nMultiplier * nCasterLevel);
}
2. Then replace HoursToSeconds() with SpellHourToSeconds() in any scripts which use that fucntion, and recompile.
3. Set
Minutes per Hour in Module Properties to a greater number.
4. Days and nights should now last longer without stretching spells and other timed events out.
Selmak wrote:
I've been messing around in toolset and a couple of things have occurred to me.
Lengthening the game hour will probably affect hardcoded things like poison and disease resolution.
Not all the scripts are spells, so there are a few that don't have the x2_inc_spellhook include, which ought to inherit the time-fiddling include (so, include in an include). So they'll need to have that line added. The majority of the spell scripts will however inherit the function from the spellhook, so adding it there will save you the hassle of adding a new include clause to every hours=based spell script.
There are a few scripts (for creature auras mainly) where the value supplied to HoursToSeconds is 100. 100 game hours is 3 hours and 20 minutes real life presently. There's probably very little chance you need to change these scripts because those auras were probably meant to last until the creature dies.
Opening all the necessary files (or a big batch of them) allows you to make best use of Find in Files, and if you have Automatically Compile on Save checked, you can jump from one file to the next using the search results, highlight HoursToSeconds, hit Ctrl-V, and move on to the next occurrence. Unfortunately hitting F3 (Find next) doesn't allow you to Ctrl-V on top, although you can right-click and Paste on top. Then when you have made all the edits, Save All will compile and save what you have open (and obviously if something isn't quite right, it'll stop compiling).
It's still quite mouse-intensive work, of course.
Dev Disco wrote:
No, but I wouldn't mind just changing the settings for a day and see what's broken.
TormakSaber wrote:
I and several others will break everything that's broken in manners that you cannot conceive of until it's too late. You do not want to go about changing the game's timescale without fixing spell duration, ability duration, and rest timers accordingly.
That's really super doomsayer-y, I know, but... I mean... it'd break things really badly here.
Dev Disco wrote:
Proper scripts should use the TurnsToSeconds or RoundsToSeconds functions instead of fixed seconds. Those spells should work OK, I think. It's the ones that have alternative ways of dealing with this (ie. custom stuff) that might be a pain in the ass.
Not sure, though. Only way to try this out without doing a lot of work is by changing the setting for a while and try to break it.
TormakSaber wrote:
I guess. I'm most worried about spells that are rounds breaking and becoming absurdly long, I suppose.
Selmak wrote:
75 spell script changes for sure, unless any hours-based spells have been changed to turns already.
Plus supporting scripts, plus changes to scripts that aren't spells but use hours-based timing.
This has of course already been said, but everyone seems to have forgotten how much work was involved.
Dev Disco wrote:
Well, 75 is less than I expected to be honest.
TormakSaber wrote:
That's not counting the amount of custom stuff you'll need to dork with, though.
Selmak wrote:
Thing is, making one particular change to 75 scripts is something you could do as a batch search-replace process rather than by hand. The script source is after all just text, meaning you can change the affected scripts outwith the module and then import them, saving the clunky hassle of opening each one in Toolset.