Jump to content

Rest on long trips


Recommended Posts

All right, another round of code ... here's my version.

IF
	!Global("AreaCode","GLOBAL",%thisareacode%)
	GlobalTimerExpired("TravelTimer","GLOBAL")
THEN
	RESPONSE #100
		ActionOverride(Player1,Rest())
		ActionOverride(Player2,Rest())
		ActionOverride(Player3,Rest())
		ActionOverride(Player4,Rest())
		ActionOverride(Player5,Rest())
		ActionOverride(Player6,Rest())
		Continue()
END

IF
	True()
THEN
	RESPONSE #100
		SetGlobal("AreaCode","GLOBAL",%thisareacode%)
		SetGlobalTimer("TravelTimer","GLOBAL",TWENTYTHREE_HOURS)
		Continue()
END		

Go through the wmp files to compile a list of areas on the world map, and build an array associating each of those areas with a unique code. Patch each of those area's scripts (iterating through the array) by adding this to the top, evaluating that variable to the area's unique code.

The second block constantly refreshes the timer if you're in any of the areas on the map, so it'll count the timer down from when you leave. You only expire the timer if you take a day or more in travel without stopping. Areas that aren't on the world map, such as dungeons and ambush areas, don't reset the timer. But if you lose track of time and spend a full day in the dungeon before coming back up to the same area you entered it from, no free rest for you. That's what the area code is for, checking to see if you actually left from somewhere else.

The first block grants the actual free rest, and it's nice and simple. That script action applies the full benefits of a proper rest, while not advancing time. Exactly what we want here.

If I put this in the next version of my tweak mod - which is feeling pretty likely at this point - slight edits will be made. Like modder prefixes for the new global variables it adds.

On second thought, maybe "unique" isn't quite right here for the area codes. You can travel between sectors of Baldur's Gate through the sewers, for example, and that opens up some weird possibilities. Having areas with zero-time links between them share the same area code makes sense to me.

Link to comment

Constantly refreshing a timer ... I don't know how much overhead that is, actually, to just set two variables and not affect anything else.. But I could reduce that overhead with a second timer, and only reset the main timer once every few minutes. Probably will, too - I've already used that technique for my "variable drow MR" component.

Your version, by caring only about accumulated fatigue, allows for that free rest on short trips in some cases. To take an example from the BG1 map ... rest at the xvart village, clear the area. Travel west (16 hours, 4 pts fatigue) to the river area. Get in some fights, spend a haste spell. Fatigue increased by 4 again. No you're over the threshold and your party is fatigued. Instead of resting there and risking ogre berserkers spawning as a rest encounter, you travel again south to the gnoll fortress. Four hours travel, with a free instant rest on arrival.

Link to comment
  • Technically, you can come out on the other side of the dungeon. Not sure if that happens in original games at least, my memories are vague. Underdark, SoD starting dungeon? Isn't the shadow dragon area replaced after its defeat?
  • Various mod added content may not add areas to worldmap, and induce travel by other means.
  • Fatique can go up and down with various spells and effects, which may wear off before or after script block is run.
  • Pretty sure there's a mod that allows teleport to known areas.

Have fun!

Link to comment
28 minutes ago, Magus said:
  • Technically, you can come out on the other side of the dungeon. Not sure if that happens in original games at least, my memories are vague. Underdark, SoD starting dungeon? Isn't the shadow dragon area replaced after its defeat?
  • Various mod added content may not add areas to worldmap, and induce travel by other means.
  • Fatique can go up and down with various spells and effects, which may wear off before or after script block is run.
  • Pretty sure there's a mod that allows teleport to known areas.

The script would only run once, immediately upon entering an area, and either give you the implied rest or not. Any time you spend in and around the area would not matter. It would only reset after going to a different overland area.

Link to comment

And effects would only wear off once too, don't see how that's relevant.

Although coming to think of it, fatique itself is a better indicator. It makes sense for the party to rest when some characters are tired, even if it hasn't been a full day, and/or spells are not depleted.

But then giving it some more thought, maybe it's one of those ideas that sound nice in theory, but in practice aren't so great. Supposedly it would be cool to have fresh, rested party after travel, but what does it mean in terms of gameplay? Almost entirely removing outdoor rest from BG1, since one rest is enough to cover an area. And BG1 is mostly outdoor. Too much towards casualization for my taste.

I have a few tweaks of my own that I thought would be so great when I was writing them, but some years later, I find myself skipping them.

Edited by Magus
Link to comment
3 hours ago, Magus said:

I have a few tweaks of my own that I thought would be so great when I was writing them, but some years later, I find myself skipping them.

Why wait years? I've written plenty of tweaks that I'll never use myself outside of testing. Silencing all battle music, for one. I did that for a request, though I won't ever use it myself (I prefer randomizing the battle music, or sometimes just turning off the in-game music). This is one that ... yeah, I'll probably not use it. But it's a neat idea anyway, and likely worth having for the people that want it.

Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...