Project

General

Profile

Bug #3110

GetDetected doesn't work without a reference

Added by Chris Robinson almost 2 years ago. Updated 3 months ago.

Status:
Closed
Priority:
Normal
Category:
Scripting
Target version:
Start date:
12/30/2015
% Done:

100%

Reproducibility:
Always
Operating system:
Other
Severity:
Normal

Description

The mod Regionally Known Werewolves (http://mw.modhistory.com/download-47-9772) uses a global script that seems to use the GetDetected script function to detect if any NPC detects the player when they transform. The relevant snippet:

;------------------------------------------
; Remove the crime when the player change
;------------------------------------------
if ( player->IsWerewolf == 1 )
  if ( PlayerWasAWerewolf != 1 )
    if ( GetDetected, player == 1 )
      set PlayerWasAWerewolf to GetPCCrimeLevel - 1000
      SetPCCrimeLevel PlayerWasAWerewolf
    endif
    set PlayerWasAWerewolf to 1
  endif
else
  if ( PlayerWasAWerewolf == 1 )
    if ( GetDetected, player == 1 )
      set PlayerWasAWerewolf to LastBounty - 1000
      SetPCCrimeLevel PlayerWasAWerewolf
    else
      SetPCCrimeLevel LastBounty
    endif
    set PlayerWasAWerewolf to 0
  endif
  set LastBounty to GetPCCrimeLevel
endif

This is a global script, so there's no implicit reference. With OpenMW, when the player changes to cause that line to be reached, it causes the error:
Execution of script rkw_knownwerewolfcheck failed:
no implicit reference

Associated revisions

Revision 65d8e2ff (diff)
Added by Andrei Kortunov 3 months ago

Allow to use GetDetected without a reference (bug #3110)

History

#1 Updated by scrawl . almost 2 years ago

  • Status changed from New to Confirmed

I can confirm this. Testing with the console in vanilla MW, 'getDetected, player' without an implicit reference returns true if any NPC is detecting the player. The same thing happens when invoking the function with a non-NPC implicit reference (e.g. a creature).

#2 Updated by Andrei Kortunov 3 months ago

Also I'm not sure about how GetDetected works in vanilla game, but in OpenMW it uses MechanicsManager::awarenessCheck() function.
It means that result of GetDetected is random and does not show if a target was really detected.

#3 Updated by Andrei Kortunov 3 months ago

  • Status changed from Confirmed to Resolved
  • Assignee set to Andrei Kortunov
  • Target version set to openmw-0.43
  • % Done changed from 0 to 100
  • Operating system changed from Linux to Other

#4 Updated by scrawl . 3 months ago

Also I'm not sure about how GetDetected works in vanilla game, but in OpenMW it uses MechanicsManager::awarenessCheck() function. It means that result of GetDetected is random and does not show if a target was really detected.

According to the research page, detected state is updated once every second or something like that, so getDetected just returns that cached state (which solves the randomness issue). Anyway, new issue I guess.

#5 Updated by Andrei Kortunov 3 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF