Jump to content


scient

Member Since 07 Aug 2008
Offline Last Active Jan 10 2012 12:49 PM

Posts I've Made

In Topic: Known Issues v4.1 (post bug reports here)

14 December 2011 - 10:23 AM

Ok, I've tracked down the problem with Ice Knife duration and fixed it! This bug that has plagued the game forever can finally be laid to rest without any haxie work around. Basically, there is a timer value that never gets set if a creature is immediately hit with an ice dagger. However, this timer is correctly set if the dagger misses and then hits you when you walk into it. The duration equation works out like this:

((3 * caster_spl_lvl) + spl_cast_time) - dagger_hit_time = duration in seconds

The dagger hit time is when creature walks into dagger, whether instantly when spell is cast or later if it misses. So the duration of THAC0 debuff is based on when the spell was initially cast and starts counting down from there. If the creature gets hit immediately, then the hit time should be the same as the cast time so the duration would work out to be 3 * caster_spl_lvl (caster level has minimum of 3, so you can never have shorter time than 9 seconds from initial cast).

The bug in original version is caused by that the caster spell level value plus cast time is never set. So you have it calculating the duration as (0 - dagger_hit_time) which ends up being a very large number (negative rolls into positive). That's why the spell never wears off over time.

To fix it, I just added some code that makes sure that initial value gets set when creature is immediately hit with an Ice Knife dagger. The duration will be the maximum for getting hit right away, so 3 * caster level in seconds.

Many TNO's died in the process of testing Ice Knife traps. :D

In Topic: Ultimate Planescape: Torment installation guide

14 December 2011 - 10:23 AM

What resolution are you using and is it one supported by your monitor? Pretty sure ChVidPal errors related to problems with Widescreen/UI mod. I tracked down code location (based on line # in error) but I couldn't say what is causing your problem.

In Topic: Known Issues v4.1 (post bug reports here)

11 December 2011 - 09:30 AM

For the trap sounds there is a function already built into game for handling them, it is just never used. It accesses a set of strref which have audio clips already linked to them.

36965 : Trap Detected [Nameless One] : NAM099.WAV
...
36972 : Trap Detected [Vhailor] : VHA236.WAV

The ones in between are for all other PC's. The only one without audio clip is Fall from Grace. Not that it matters because the only ones that will be used in a normal game are Annah or TNO.

In Topic: Known Issues v4.1 (post bug reports here)

08 December 2011 - 10:28 AM

View Posti30817, on 08 December 2011 - 09:33 AM, said:

I think those things (effects, duration) are not hardcoded, that is they can be viewed and replaced by DLTCE. It might just be a corrupt file? Or is it a code bug?

You are correct that in most cases that effect data is stored inside the file structure (item, spell, area traps/triggers). However, for this spell and a few others the effects are hardcoded into the exe. You can look at SPWI207.SPL in NI and you'll see that only the damage and BAM animation are stored in SPL not the THAC0 debuff. If that was the case, Qwinn or platter could of easily fixed it.

In Topic: Known Issues v4.1 (post bug reports here)

07 December 2011 - 06:54 PM

Ok, I tracked down the problem with "Ice Knife". Basically, the duration of spell is set to a VERY large number for some reason. I'm not entirely sure whats going wrong. It's using two values that I'll have to try and identify from current game state to create duration value by subtracting them and dividing by 15. The problem it seems is that the final value rolls over into negative and become very large. Effectively, the spell never expires but I think if you left the game running long enough it would. It is possible to remove the THAC0 hit if you edit an ITM to use "dispell effects" effect. So it is possible to remove without dying, it's not like it's permanently stuck. I've tracked down area where the spell EFF is created and looks like there is definitely something wrong with how it creates the duration.


Quote

Ice Knife THAC0 spell EFF:
0x00 36 00 02 00 FE FF FF FF 00 00 00 00 00 11 E8 FF 6..þÿÿÿ.....èÿ
0x10 FF FF 64 00 48 5F 4C 45 43 54 55 52 00 00 00 00 ÿÿd.H_LECTUR....
0x20 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 ...............

0x0000 : 36 00 (54 -> Base THAC0 bonus)
0x0002 : 02 (present target)
0x0003 : 00 (power)
0x0004 : FE FF FF FF (Value: -2 -> THAC0 hit)
0x0008 : 00 00 00 00 (Modifier type: Increment)
0x000c : 00 11 (flags: 0x1100 -> instant/limited (0x0000) ; dispel/not bypass resistance (0x0100); toggled after casting, something to do with area? (0x1000) )
0x000e : E8 FF FF FF (time param: ends up being very large, not a fixed value changes slightly)
0x0012 : 64 (prob1: 100)
0x0013 : 00 (prob2: 0)
0x0014 : 48 5F 4C 45 43 54 55 52 (Resref parameter -> H_LECTUR)
0x001c : 00 00 00 00 (dice count)
0x0020 : 00 00 00 00 (dice sides)
0x0024 : 01 00 00 00 (saving throw type -> spell)
0x0028 : 00 00 00 00 (saving throw bonus)
0x002c : 00 00 00 00 (unk -> null?)


I believe that effect "duration" is in game seconds? Does anyone know how IE handles time? It seems the value stored in EFF is multiple of 15? I guess I'll have to read more about it. By patching "Ice Knife" duration to something more sane like "10" (similar to "Chromatic Orb" THAC0 hit), the -2 THAC0 effect sticks for a little while then goes away. If anyone knows about time handling in IE, I'd be interested to hear. Otherwise, will plod along and figure out what they were trying to do with setting duration for spell. Unfortunately, there is nothing to go on in spell description of how long THAC0 hit should last.

edit:
Looks like it's real time seconds. So, default "Ice Knife" duration is something like ~286297150 seconds or running PST for ~9 years straight. :lol: