Skip to content
This repository has been archived by the owner on Jan 23, 2024. It is now read-only.

Create SkipCutsceneON.js #57

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

Poshwosh
Copy link
Contributor

@Poshwosh Poshwosh commented Sep 4, 2016

Another restored script part of #46. Originally created by Step29.

This script causes any cutscene to break, automatically skipping it as a result. This might not be fitting for some people, so this should go to disabled.txt.

When I used cutscene skip before, it was mostly for grinding purposes (farming for a pass, doing tournament), and afterwards I would turn cutscenes back on. With that in mind, I created an OFF file to revert the changes without having to restart the client.

However, this is very savvy. I propose that Kanan should have a switch function, a way to patch a variable to a different value through the CMD console.
For example, this is I would have wanted the file to work:

var pattern = scan('?? ?? ?? 75 05 39 ?? ?? ?? ?? ?? ?? E0');
patch(pattern.add(3), 0x75);
patch.on{pattern.add(3), 0xEB);
patch.off{pattern.add(3), 0x75);

By default, the script would be off. In the console, you would type "SkipCutscene.js on" to execute the script again on the switch titled "on". If I ever find a way to change default ranged attack, could make multiple switches for each one of them (ex DefaultRangedAttack.js Magnum)

I understand this might take a while, so I decide to go with this ON and OFF thing for the time being. If you don't like it, reject the OFF file.

Another restored script part of cursey#46.

This script causes any cutscene to break, automatically skipping it as a result. This might not be fitting for some people, so this should go to disabled.txt.

When I used cutscene skip before, it was mostly for grinding purposes (farming for a pass, doing tournament), and afterwards I would turn cutscenes back on. With that in mind, I created an OFF file to revert the changes without having to restart the client.

However, this is very savvy. I propose that Kanan should have a switch function, a way to patch a variable to a different value through the CMD console.
For example, this is I would have wanted the file to work:
var pattern = scan('?? ?? ?? 75 05 39 ?? ?? ?? ?? ?? ?? E0');
patch(pattern.add(3), 0x75);
patch.on{pattern.add(3), 0xEB);
patch.off{pattern.add(3), 0x75);

By default, the script would be off. In the console, you would type "SkipCutscene.js on" to execute the script again on the switch titled "on". If I ever find a way to change default ranged attack, could make multiple switches for everyone of them (ex DefaultRangedAttack.js Magnum)

I understand this might take a while, so I decide to go with this ON and OFF thing for the time being. If you don't like it, reject the OFF file.
Poshwosh added a commit to Poshwosh/Kanan-plus-Prime that referenced this pull request Sep 4, 2016
@Poshwosh Poshwosh mentioned this pull request Sep 4, 2016
@cursey
Copy link
Owner

cursey commented Sep 5, 2016

Hmm, yeah I am still deciding the best way to handle enabling/disabling scripts during run-time. It's been requested in issue #28 . I've already made it so scripts send back the patch information to kanan.py so really the hard work is already done. I'll finish it soon.

As for merging this request, I would prefer if it was just SkipCutscene.js.

@cursey
Copy link
Owner

cursey commented Sep 6, 2016

I'm actually not able to get this to work the way you have it. Can you double check? The pattern works in CE although the patch seems to just break cut scenes (tested in Alby dungeon). Kanan gives an error when searching for the pattern, probably because it starts with wildcards.

@Poshwosh
Copy link
Contributor Author

Poshwosh commented Sep 6, 2016

You've thoroughly tested it, its all exactly as you said.

I tested this on CE, I've done the test in the Dunbarton library with those fortune teller orbs and it worked just fine. However, now that I cleared Alby with it, I see what you mean... it completely broke it.

I'll try to fix this tomorrow. I'm sorry for not properly checking it.

P.S. I didn't know about the wildcards in the beginning rule, thank you.

@cursey
Copy link
Owner

cursey commented Sep 6, 2016

No worries. I check all PR's before I merge because I know this kinda thing can happen.

@Poshwosh
Copy link
Contributor Author

Poshwosh commented Sep 6, 2016

From my understanding there seems a unique trigger when it comes to boss rooms, the world disappears then reappears again. Breaking the cutscene leaves the impression on the client you're still watching it therefore the world is not loading again.

I can't seem to figure it out (I'm really bad at assembly), and I'm getting tired of Alby, so you can close this request unless somebody else wants to give it a go.

mod_sharker
;Autoskip any cutscene (even skips mainstream quest ones)
[AutoSkipAnyCutscene]
SEARCH1= 39 ?? ?? 75 05 39 ?? ?? 74 ?? FF 75 E0
REPLACE1=39 ?? ?? EB 05 39 ?? ?? 74 ?? FF 75 E0

r234:
01565F7C
00 3B D1 75 05 39 45 E0 74 5E 8B 45 E0
Client.esl::IIMEEventHandler::OnSentenceModeUpdated+14486AF - 75 05 - jne Client.esl::IIMEEventHandler::OnSentenceModeUpdated+14486B6
Client.esl::IIMEEventHandler::OnSentenceModeUpdated+14486B1 - 39 45 E0 - cmp [ebp-20],eax
Client.esl::IIMEEventHandler::OnSentenceModeUpdated+14486B4 - 74 5E - je Client.esl::IIMEEventHandler::OnSentenceModeUpdated+1448714
Client.esl::IIMEEventHandler::OnSentenceModeUpdated+14486B6 - 8B 45 E0 - mov eax,[ebp-20]

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants