LoG2 bug list

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Zo Kath Ra
Posts: 829
Joined: Sat Apr 21, 2012 9:57 am
Location: Germany

LoG2 bug list

Post by Zo Kath Ra » Fri Jan 26, 2018 12:52 am

Is there a list of bugs in LoG2 2.2.4 ?
( similar to https://github.com/JKos/log2doc/wiki )

I'm asking because I just (re)discovered a bug with
ItemComponent.onEquipItem(self, champion, slot)

If you pick up an item with the mouse cursor, and then click on a champion portrait, the item is inserted into the inventory, but onEquipItem() isn't called.

User avatar
akroma222
Posts: 1024
Joined: Thu Oct 04, 2012 10:08 am

Re: LoG2 bug list

Post by akroma222 » Fri Jan 26, 2018 11:43 am

Zo Kath Ra wrote:If you pick up an item with the mouse cursor, and then click on a champion portrait, the item is inserted into the inventory, but onEquipItem() isn't called.
If you manually drop the item into a backpack slot (or through the portrait) - the equip hooks are not called.
Pretty sure onEquipItem & onUnequipItem are only called if items are placed into the "equipped" item slots 1 - 12

... but definitely a great idea to list up known bugs (and provide possible solutions)

I know minmay has listed and detailed many bugs for a number of areas / components in his InfoDump
viewtopic.php?f=22&t=13948

Im trying to find work arounds for RunePanel & CastSpell components currently
(cut / pasted from minmays infoDump ...)
SpoilerShow

Code: Select all

CastSpellComponent

1. Repeat
Supports repeat...sort of. The actual repeating happens just fine; however, CastSpellComponent has the odd property of adding its cooldown to the user's existing cooldown on every repeat. 
So if your CastSpellComponent has a cooldown of 5 and a repeatCount of 4, it will effectively have a cooldown of 20. 
Changing the repeatDelay does not affect this; the new cooldown always adds to the existing cooldown, it doesn't replace it.
It is generally easy to bandage this by dividing the cooldown by the repeatCount - in the above example, a cooldown of 5/4 would give the desired 5 cooldown in practice. 
However, beware of the specific case where a player has enough cooldown modifiers to get a cooldown that is shorter than the repeatDelay, because in that case they could attack with the weapon in between the repeats.

2. onComputeCooldown
Currently (as of 2.2.4), suffers from a bug: onComputeCooldown hooks don't apply to CastSpellComponent cooldown.



RunePanelComponent

1. Repeat
Does not support repeat in a useful manner; repeating just reopens the rune panel, clearing any runes you entered if it was already open. And the item remains on cooldown once you cast one spell, even across repeats.

2. "aquatic"
Does not work with the "aquatic" trait. The rune panel will open, but you can't select any runes, and any existing runes will be cleared, just as if the item weren't aquatic.

3. onComputeCooldown
Currently (as of 2.2.4), suffers from a bug: onComputeCooldown hooks don't apply to RunePanelComponent cooldown,
The only way to modify the cooldown of spellcasting is with the champion's cooldown_rate stat.

4. EquipmentItem - Req not met
RunePanelComponent has a unique property with respect to requirements: if an item has a RunePanelComponent as its primary action, and that RunePanelComponent's requirements are not met, 
then that item's EquipmentItemComponent (if any) will not confer any of its bonuses to the wearer. 
No other Component does this. I discuss the implications of this, and a potential use, here: http://www.grimrock.net/forum/viewtopic.php?f=22&t=9273&p=89582#p89582 
(I know I once said that dual wielding works with RunePanelComponent; I was completely mistaken. It does not.)]]

User avatar
Isaac
Posts: 2949
Joined: Fri Mar 02, 2012 10:02 pm

Re: LoG2 bug list

Post by Isaac » Fri Jan 26, 2018 6:27 pm

One would think that the equipItem hooks would only fire if the item was equipped, but in practice, they fire when the item occupies any of the 32 inventory slots... except if they were dropped on the portrait; as mentioned in the OP. This is a bit of a pain.

It is possible to place an if condition in the hook, that detects if the slot is not one of the on-body inventory slots. This could effectively make the hook only act when the item is on the body.

There is another bug with these hooks that happens when a connector is attached to either hook for a spawned object. When equipped, or unequipped, the game crashes for not finding the object's map component.

User avatar
akroma222
Posts: 1024
Joined: Thu Oct 04, 2012 10:08 am

Re: LoG2 bug list

Post by akroma222 » Fri Jan 26, 2018 7:43 pm

Isaac wrote:One would think that the equipItem hooks would only fire if the item was equipped, but in practice, they fire when the item occupies any of the 32 inventory slots... except if they were dropped on the portrait; as mentioned in the OP. This is a bit of a pain.
It is possible to place an if condition in the hook, that detects if the slot is not one of the on-body inventory slots. This could effectively make the hook only act when the item is on the body.
There is another bug with these hooks that happens when a connector is attached to either hook for a spawned object. When equipped, or unequipped, the game crashes for not finding the object's map component.
Ah yup totally my bad guys - I rushed a test without reading what my onEquipItem hook actually did...
it starts out with an if condition checking for the handslots 1 and 2 - just as Isaac mentioned

Code: Select all

onEquipItem = function(self, champion, slot)
				if slot == 1 or slot == 2 then 
That connector bug does sound annoying
Again, I think its a great idea to create a reference list for known bugs/solutions :ugeek:

minmay
Posts: 2656
Joined: Mon Sep 23, 2013 2:24 am

Re: LoG2 bug list

Post by minmay » Fri Jan 26, 2018 10:35 pm

- MonsterChargeComponent accumulates errors in its movement whenever it changes animations (up to the frame delay each time), making it a little slower than it should be.
- FrozenMonsterComponent resets the monster's materials when it ends, without applying material overrides again, so monsters with material overrides will appear to lose them when they freeze/unfreeze
- Destroying a SurfaceComponent that contains items will leave the items in a broken state
- The scripting interface sandbox can be escaped by various methods
- Odd values of stats and base power give you a smaller damage increase than even values of stats and base power (going from 10 to 11 strength is not as good as going from 11 to 12 strength)
- HealthComponents immune to the "physical" damage type are also completely immune to all melee, projectile, and firearm attacks
- On levels containing a WaterSurfaceComponent, various debugDraw features are only drawn to the upper left quadrant of the screen and the reflections
- An object that triggers one of its connectors while not on a map will crash
- Zhandul's Orb still claims to provide a bonus to fire spells, but doesn't
- The Assassin's Dagger still claims to have life leech, but doesn't
- Setting a monster's level to above 1 will give a bigger max health bonus than its current health bonus (so e.g. a monster at 100/100 health might end up at 200/400)
- In Isle of Nex, there is a script_entity that changes the world position of a turtle nest, but as turtle nests have minimalSaveState, this world position change does not persist across save/load
- I've encountered a very rare null pointer dereference at instruction 0x004b43af when creating entities.
- convertToItemOnImpact converts stacks to a single item, and if the item hits an obstacle, it can spawn the new item on the other side of the obstacle
- ItemComponent:getFuel() crashes
- onComputeCooldown doesn't work for RunePanelComponent or CastSpellComponent
- Editor copy and paste can delete existing objects or even crash if the pasted objects have replacesWall/replacesFloor
- If an entity id collision occurs in the editor, connectors will no longer display actions until the dungeon is reloaded (even after the collision is fixed)
- While using a camera other than the default one, saving will result in a bogus warning message
- The miniature dungeon editor preview window reports its size incorrectly (but the fullscreen preview is fine)
- ButtonComponent still triggers its onActivate hook when disabled
- Music cuts off samples when it loops
- math.chromacity() doesn't work from the user scripting interface
- string.count() and string.split() enter infinite loops if their second argument is the empty string
- If there is a pedestal behind the party, casting Meteor Storm will strike the pedestal with one of the projectiles, hurting the party
- ModelComponent:getReflection() and ModelComponent:setReflection() don't work
- The alchemy panel crashes if it attempts to create an item with a custom gfxAtlas
- The expRate property of EquipmentItemComponent always reports itself as 25% in the tooltip, even when it isn't
- TimerComponent:getTimerInterval() requires a number argument, even though it doesn't use it
- Connectors with invalid targets can taint savegames when activated
- SurfaceComponents with a normal not pointing straight up (because of rotation) will not correctly compute the place an item should go when placed on the surface with the mouse
- Double-sided materials are only lit properly on one side
- Refraction buffer doesn't include particles, leading to particles under water or behind portals being invisible
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.

User avatar
Isaac
Posts: 2949
Joined: Fri Mar 02, 2012 10:02 pm

Re: LoG2 bug list

Post by Isaac » Sat Jan 27, 2018 2:20 am

@minmay
That is a handy list to have.
- HealthComponents immune to the "physical" damage type are also completely immune to all melee, projectile, and firearm attacks
There seems to be a logic to this one, as all of these attacks are usually physical; are there any that aren't?

minmay
Posts: 2656
Joined: Mon Sep 23, 2013 2:24 am

Re: LoG2 bug list

Post by minmay » Sat Jan 27, 2018 3:59 am

Yes, those attacks can have any damage type. See torch, ethereal_blade, venomfang_pick's secondary attack, meteor_hammer, lightning_bow's secondary attack, lightning_blade, fire_blade, ancient_claymore.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.

User avatar
akroma222
Posts: 1024
Joined: Thu Oct 04, 2012 10:08 am

Re: LoG2 bug list

Post by akroma222 » Sat Jan 27, 2018 9:37 am

Now THAT is a list !! :lol: :shock:

Some of those bugs already have work arounds / fixes (eg - ButtonComponent still triggers its onActivate hook when disabled ) ...
These we could post as they are discussed.... and then for others there would be no fix other than implementing entire
reworkings (eg - The alchemy panel crashes if it attempts to create an item with a custom gfxAtlas) ...
for which we can provide links to other threads with the relevent mod files / asset packs
And I guess there would be some we can mark off the list easily as: No chance of fixing/preventing

minmay
Posts: 2656
Joined: Mon Sep 23, 2013 2:24 am

Re: LoG2 bug list

Post by minmay » Sat Jan 27, 2018 12:14 pm

Most of these are not that difficult to fix. The music looping bug, refraction buffer limitation, and null pointer dereference are probably things we are stuck with forever, however, since Lua can't get anywhere near the relevant code. The refraction buffer thing isn't a total deal breaker because you can use sortOffset to force particles to appear in front of refractive materials when necessary, and the null pointer crash is extremely rare (I haven't tried to reverse engineer the executable because that would be insane, but my guess is that a library is doing something dumb).
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.

User avatar
AndakRainor
Posts: 673
Joined: Thu Nov 20, 2014 5:18 pm

Re: LoG2 bug list

Post by AndakRainor » Tue Feb 13, 2018 9:05 pm

I found a very weird bug yesterday when testing the preview of Eternal Recurrence. On reloading the saved game, the game crashed with an error saying an object was referencing another object and it could not find it. I inspected the save file with my save editor tool and found the objects with the logged ids. It was a chest and a lock pick, the lock pick was in my inventory and the chest still had it listed as inside the chest... What the hell ??? I spawned randomly 2 to 4 items in chests in the previous version, I reduced it to 2 to 3 and I did not get any similar error so far... Is this a bug of the game engine ?

Post Reply