Repository navigation
Conversation
|
Approach for the concentration pose: Queued |
…world-frame particles
A successful Control cast now hands the player over to the target NPC. Enter, the death of the target, or damage to the original caster hands control back. While casting, the target gets its ray ball and a ray funnel links it to the caster. Known gaps: the caster does not play the concentration pose, there is no distance limit yet, the controlled NPC's inventory is not blocked, and saving during Control is not handled.
000478a to
c7dcfd0
Compare
When Control is cast, ZS_PC_Controlling starts while the mage is still in the cast release transition (T_CONSHOOT_2_STAND), which cannot be interrupted. Npc_PlayAni tries once, gets rejected, and the concentration pose is never played. If Npc_PlayAni fails for the Control caster, queue the animation as AI_PlayAnim. The existing AI_PlayAnim case retries every tick until the animation is accepted. Other NPCs and scripts are not affected.
If the controlled NPC attacks the player, the player reacts, draws a weapon and leaves ZS_PC_Controlling. World::endControl only cleared the caster's state while it was in ZS_PC_Controlling, so after pressing Enter the player stayed in a script state, and PlayerControl ignores all movement input in such a state. The result looked like a stuck camera. Clear the caster's state and AI queue when it is in any script state.
|
Actually implemented: Added tests to test list in the first comment. |
While Control is active, check distance between player and controlled NPC every tick. There are two limit thresholds: Beyond 3500 units the screen pulses green (screen blend, once per second), beyond 4000 units Control ends instantly (same way as pressing Enter). The warning is removed as soon as the distance is back below 3500 or Control ends.
|
Added implementation for distance limit thresholds. Green strength: the pulse peaks at about 43% opacity (alpha 110/255). If it is too weak or too strong, it can be tweaked by the last three digits 110 in "0 255 0 110". Technically there is no proof this solution matches the original game behaviour but I have elaborated why I think we have a strong case still in this comment: |
While Control is active, the inventory key no longer opens the inventory of the controlled NPC. Closing an open inventory, chests and looting dead NPCs are not affected, matching vanilla behaviour. Without Control the behaviour is unchanged.
|
While Control is active, the inventory keys no longer open the inventory of the The handler checks world |
Closing braces, erase comments, declare World::tickControl with the other private methods. Also remove dead leftover code caster->transformBack() call in World::endControl. Kept "untidy" part because it matches with Pyrokinesis PR, to avoid trouble.
Killing (monster, NPC) with the controlled NPC now ends Control, as in the original game. XP and level-ups stay with the controlled NPC, as in the original game as well. Control ends two ticks after the kill instead of immediately, so the victim's ZS_Dead still sees the controlled NPC as the player and credits it. Knocking out a human does not end Control. Melee finishing kill move does.
Updated: Ready for review, please provide feedback!
This aims to include the missing Gothic I Control spell from issue #1061 Further references, where I also gathered learnings and information relevant for the implementation:
From 2024 #661, item 12.
Original tracking entry: #622, item 18.9.
Implemented
INTTOSTRINGas a transform instanceVerification
Gothic I
Test Results
Ending Control by:
Control is not interrupted by:
Inventory Access
Regression Testing: Transformation
Known Gaps
Reactions of NPCs to a controlled NPC's attacks work in general ( flee, nearby guards attack controlled NPC). In some cases an attacked NPC neither fights back nor flees. Without knowing the original behaviour, we have no real requirement to meet. Will stay as a gap deliberately for now.
Gothic II / Gothic II NotR
Not verified