Try / OpenGothic

Reimplementation of Gothic 2 Notr
MIT License
1.07k stars 78 forks source link

Add attributes for triggers #593

Closed thokkat closed 1 month ago

thokkat commented 2 months ago

Of the two triggers that open the gate to get to the 4 rooms with switch riddles in Irdorath only one is enabled. Both are activated at the same time and their enable status is toggled afterwards.

Setting both to enabled on first load lead to the bug that both gate up and down animations were played on first activation but none on second. This change fixes those cases. https://github.com/Try/OpenGothic/commit/20af3701522cf0141f37e8f6d1a707d0b06dc48e had a fix for first case but second one was still open.

Also added a missing clear command reported by static analyzer for deferred triggers.

thokkat commented 1 month ago

Looked into other attributes. I removed T_Activate special handling by defaulting maxActivationCount to infinite and now check this property for all onTrigger events.

Try commented 1 month ago

LGTM - I need to test(might not have time today/tommorow) it, then will be merged

Try commented 1 month ago

Tested today. There is a regressing with pillars in Halls of Idorath: изображение

thokkat commented 1 month ago

Ok problem found. Apparently movers can be triggered indefinitely if maxActivationCount is non-zero. While at it I added autoUntrigger attribute for cscamera. Otherwise there is a non-cscamera gap between door circle spinning and pillar up movement. I excluded timedemo though for convenience.

Irdorath cscamera overlapping should now be resolved because one of them is always disabled and workaround is no longer needed. Gate up cscamera is triggered a few ticks earlier than spinning gear csamera is untriggered which isn't a problem in this case. But for general case it's worth to keep current logic and end old cscamera if a new one is triggered. Vanilla testing showed same behavior and timedemo became buggy or crashed the game.

Try commented 1 month ago

Merged, thanks!