Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A7!EQMA.ITM value of extended header offset #2

Closed
mleduque opened this issue Aug 23, 2021 · 2 comments
Closed

A7!EQMA.ITM value of extended header offset #2

mleduque opened this issue Aug 23, 2021 · 2 comments

Comments

@mleduque
Copy link

Hi @Argent77
I tried installing a mod called "klatu fixes and tweaks" (http://www.shsforums.net/topic/57873-mod-klatu-tweaks-and-fixes/) over GolemConstruction.
This mod has some components that batch edit items/spells/creatures, and before doing so, uses a process it calls "sanitizing".
I didn't llok in the detail what it does exactly (I'm not a modder and as a developer, I find the weidu language... kind of baroque), but it is described as

	/*	f10
		Sanitizes the current SPL or ITM resource. If the resource is corrupt, 
		this function will attempt to repair it. This can entail resolving
		overlapping ability effects and removal of junk data.
		It ensures that abilities precede effects and that global effects 
		precede ability effects. 
		This function does not perform any type checks. The user must
		take care to only run it on appropriate resources with appropriate
		arguments.
		Arguments: 
			- abilLen	the length in bytes of the resource's abilities. 
						ITM resources have an ability length of 0x38 (56)
						SPL resources have an ability length of 0x28 (40)
		Return values:
			- ok		A value of 1 signifies that the resource can be 
						safely edited. A value of 0 means that the resource
						is not in a recoverable format and should not be
						edited. 
	*/
	DEFINE_PATCH_FUNCTION SANITIZE_ITM_OR_SPL

Whatever it is, when I install only Golems and this mod (for example the component "2060 Standardize Poison Immunity", it fails like this

Installing [Standardize Poison Immunity] [1.7]
Copying and patching 1845 files ...
Copying and patching 2966 files ...
DELETE_BYTES out of bounds - file is long 1314, point given is 1986, bytes were 0
ERROR: [A7!EQMA.ITM] -> [override/A7!EQMA.ITM] Patching Failed (COPY) (Failure("DELETE_BYTES out of bounds"))
Stopping installation because of error.
Stopping installation because of error.

ERROR Installing [Standardize Poison Immunity], rolling back to previous state
Will uninstall  20 files for [klatu/setup-klatu.tp2] component 2060.
Uninstalled     20 files for [klatu/setup-klatu.tp2] component 2060.
ERROR: Failure("DELETE_BYTES out of bounds")

In a bigger (dozen mods) EET install, I only have 2 items with the same failure (A7!EQMA.ITM was the easiest one to identify the provenance of ;) )
Now, I checked the item in NI and the value "Abilities offset" (had to read from ITM description for 0x64=100 in IESDP) has the value 0x7c2 = 1986. It also show "# abilities" = 0 so I guess there are none?

Is the bug in Golem or klatu? (as klatu's author seems inactive, I came here first)
Other items with no abilities (for ex. A7!EQIC.ITM) have the 0x72 value.
Could 0x7c2 be a typo ?

@Argent77
Copy link
Owner

The item ability offset points behind the global effects list. That's a less common but valid offset definition from a technical standpoint. I can certainly fix it on my side, but it would be more advisable to improve klatu's function to handle that particular offset configuration correctly because there a many instances, even in the unmodified game, which define the same order of offsets.

@mleduque
Copy link
Author

Thank you for you answer.
The other mod author is inactive so I don't think it will happen. Anyway, most of the changes are more "nice to have" so that's not really a blocker!

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

No branches or pull requests

2 participants