View unanswered posts | View active topics * FAQ    * Search
* Login 




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Pony
 
PostPosted: Thu, Feb 17 2011, 17:16 PM 



Player

Joined: 07 May 2005

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.


Last edited by Pony on Thu, Feb 17 2011, 17:24 PM, edited 1 time in total.

 
      
Pony
 
PostPosted: Thu, Feb 17 2011, 17:21 PM 



Player

Joined: 07 May 2005

Idea that was suggested but failed because it was impossible. To make sure it does not repeat itself:


Selmak wrote:
There might be a way to narrow down the list of scripts that need to be checked.

If you were to export all the default scripts and the module scripts to one directory (NWN Explorer could provide a handy way to do this, I've tried it for this purpose) you could run a search for a regular expression in all of those. Which would be "HoursToSeconds(" to locate that particular function.

As I may have mentioned before, Windows doesn't always search files that aren't recognised as text files, so you may need to hop into the command prompt and give a command like:

/find /N "HoursToSeconds(" *.nss > spellscriptsearch.txt

Which will dump the results into a handy text file for you to read. In particular it shows the exact line number of the occurrence and the context on that line for example:

---------- NWSCRIPT.NSS
[5673]float HoursToSeconds(int nHours);

---------- NW_S0_CRUNDEAD.NSS
[68] ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eSummon, GetSpellTargetLocation(), HoursToSeconds(nDuration));

I hope this is helpful in estimating just how involved the changes would be. At the very least, you wouldn't be flying blind if you do edit those scripts.

There are also functions called DayToNight and NightToDay that could be used as players enter an area, to override the day/night cycle completely and as Xenos suggested, just make the server light one reset and dark teh next.




Dev Disco wrote:
What happens if you set it to Night and the usual timers decides it's day again?




Terra_777 wrote:
DayToNight/NightToDay only applies on one player:

Player A: "Nice, its night *has complete darkness*."
Player B: "lololololo u stupid is r day *has complete lightness*"

Even if the PC list is looped and NightDay applied new PCs will miss the transition and it'll become unsynced and even more so since the clock ticks on with its own day/night circle.


 
      
Yossarin
 
PostPosted: Thu, Feb 17 2011, 17:29 PM 



Player

Joined: 23 Jan 2006

I don't really like this. You players already have a hard enough time grasping that we DMs have control over time, and this is really like you putting your stamp on the clock to see, "We want it running the way we want it to run, to hell with your speed of plot notions."


 
      
Pony
 
PostPosted: Thu, Feb 17 2011, 17:32 PM 



Player

Joined: 07 May 2005

Yossarin wrote:
I don't really like this. You players already have a hard enough time grasping that we DMs have control over time, and this is really like you putting your stamp on the clock to see, "We want it running the way we want it to run, to hell with your speed of plot notions."


A portion of the DMs currently state when it is day and when it is night and you think would become impossible/harder in a plot if a dm does it then, because of this change? Can not imagine the amount of players who would be such twits would rise because of it, but I never encountered someone like that. In addition DMs could actually use daylight/nighttime in their plots to a greater extend, as in rp currently it is impossible due to the speed and from what I read in the old topic most were for it.


 
      
TormakSaber
 
PostPosted: Thu, Feb 17 2011, 18:40 PM 

User avatar

Player

Joined: 16 Dec 2004
Location: Somewhere

I'm locking this because you can say nothing that hasn't been ahshed over adozen times, we're aware of what needs to be done, and we will do it on our time, and our schedule.

_________________
Davion Telemos - Monk of the Four Winds
Korthan Isharnos - Dragon Shaman of Thunder Spirit Zamasham


 
      
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 


Who is online

Users browsing this forum: No registered users and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group