Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
Joined: May 2017
enthusiast
OP Offline
enthusiast
Joined: May 2017
Toggle Sprint is a simple mod which adds a sprint ability that can be toggled.
You move slightly more than 50% faster - It's a speed I tweaked until it felt right. Fast enough to feel like you're not slow, but not too fast to feel unnatural.

Sprinting is automatically disabled in combat, and re-enabled once you leave combat. This "auto-sprint after combat" feature can be toggled with an item you get once you use sprint.

Links:
Github
Nexus
Steam Workshop

The Nexus version contains an optional "loose" version, which are the unpackaged files that can be placed in your Data folder to use the mod with achievements enabled.

I also released my full source on Github, so I encourage you to peruse it if you're interested in seeing how a basic scripting mod is done.

Edit: This mod is incompatible with other mods that modify Player.charScript. Using multiple mods that both include their own scripts inside Player.charScript will require a manual merge.

Merging mods in this way isn't too daunting, as all that's really happening is you're making sure the scripts both mods include are being included in the same base file.

Where the merging needs to happen: Player.charScript

Ultimately, we need a way to dynamically attach scripts to things. That way we wouldn't have to override base scripts, and could instead just add our script to players.
That would allow better mod compatibility too.

Last edited by LaughingLeader; 29/09/17 10:12 PM. Reason: Update
Joined: Aug 2014
old hand
Offline
old hand
Joined: Aug 2014
Noice. Looks like we got a race for the best fast run speed mod wink

Joined: Jul 2017
W
enthusiast
Offline
enthusiast
W
Joined: Jul 2017
Awesome

Joined: Jan 2011
old hand
Offline
old hand
Joined: Jan 2011
Originally Posted by Baardvark
Noice. Looks like we got a race for the best fast run speed mod wink


The best one is whichever is fastest! To me anyway. I use the Very Fast one now, could be faster! smile

Joined: May 2017
enthusiast
OP Offline
enthusiast
Joined: May 2017
Good news - I got this working with pre-existing saves.

Bad news - The loose version seems broken. I'm figuring it out, but it's been strange, to say the least. First it started with my custom icons being white squares, then the script wasn't working at all. Not sure what's up just yet.

Joined: May 2017
enthusiast
OP Offline
enthusiast
Joined: May 2017
Update: I got the loose version working. Required some renaming and file moving shenanigans. Here's what I discovered for turning your mod into a "loose" version that can be played with achievements enabled: [Guide] Making Your Mod Achievement-Friendly

Joined: Dec 2013
old hand
Offline
old hand
Joined: Dec 2013
Thanks for releasing this in a way to help see how it's implemented. Really thorough and well packaged, very nice!


DOS2 Mods: Happily Emmie After and The Noisy Crypt

Steam Workshop
Nexus Mods
Joined: Oct 2017
S
stranger
Offline
stranger
S
Joined: Oct 2017
Thanks for making your source available. I've been playing around with scripting and it has been super helpful.

Having to override Player.charScript to inject our own scripts seems like a wonky workaround. Is this really the intended solution for running player-centric scripts? I couldn't get my test .charScript to work until I found your code because it seems so counter intuitive.

Joined: May 2017
enthusiast
OP Offline
enthusiast
Joined: May 2017
Originally Posted by stevosaurus
Thanks for making your source available. I've been playing around with scripting and it has been super helpful.

No problem. I learn faster with a source available, so I enjoy passing it on. smile

Originally Posted by stevosaurus
Having to override Player.charScript to inject our own scripts seems like a wonky workaround. Is this really the intended solution for running player-centric scripts? I couldn't get my test .charScript to work until I found your code because it seems so counter intuitive.

Yeah, it's a little strange. You can override any of the base scripts that way: Base.charScript for including scripts to include in all charScripts, DefaultCharacter.charScript for characters, and of course Player.charScript for player-only code. The only other way to include scripts on things you want, that I know if, is to attach it to a root template.

Personally I wish we had a way to dynamically attach scripts to things through other scripts (or story editor scripts), in a way that supports mod compatibility. Something like, "OnLoad -> If players don't have MyScript.charScript attached -> Attach it.".

Currently, if you override Player.charScript, and a second mod's does as well, I believe it will go with the mod lower in the load order. So you would need a "compatibility patch" that has a merged script that includes the scripts from both mods. It's a bit of a headache.

Joined: May 2017
enthusiast
OP Offline
enthusiast
Joined: May 2017
Would it be possible to move this to the released projects forum? Not sure who to contact about that.


Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.5