Phasmophobia

Ask about cheats/tables for single player games here
zephirot
Noobzor
Noobzor
Posts: 12
Joined: Wed Oct 28, 2020 8:48 pm
Reputation: 12

Re: Phasmophobia

Post by zephirot »

PorcelainCobra wrote:
Fri Jan 08, 2021 8:28 pm
Are you able to update to it work with the Beta update from today?
I can check, usually beta have many updates and so it's not great to change all scripts each time..
But I will see! ;)

PorcelainCobra
Noobzor
Noobzor
Posts: 5
Joined: Fri Jan 08, 2021 8:21 pm
Reputation: 0

Re: Phasmophobia

Post by PorcelainCobra »

Much appreciated. Thanks for all your work on this table thus far.

zephirot
Noobzor
Noobzor
Posts: 12
Joined: Wed Oct 28, 2020 8:48 pm
Reputation: 12

Re: Phasmophobia

Post by zephirot »

PorcelainCobra wrote:
Fri Jan 08, 2021 9:47 pm
Much appreciated. Thanks for all your work on this table thus far.
It's a pleasure.
Please find attached the table (contains both release and beta versions)
Attachments
Phasmophobia_Zv22_Release_and_Beta.CT
(1.3 MiB) Downloaded 85 times

PorcelainCobra
Noobzor
Noobzor
Posts: 5
Joined: Fri Jan 08, 2021 8:21 pm
Reputation: 0

Re: Phasmophobia

Post by PorcelainCobra »

Works great, any plans to add a stronger flashlight?

zephirot
Noobzor
Noobzor
Posts: 12
Joined: Wed Oct 28, 2020 8:48 pm
Reputation: 12

Re: Phasmophobia

Post by zephirot »

PorcelainCobra wrote:
Sat Jan 09, 2021 4:40 pm
Works great, any plans to add a stronger flashlight?
Something I wanted to do long ago but it doesn't work.
I know that intensity of the flashlight is 0.8, the strong one is 1.0
I know the range, the angle... where to look at in the code
But changing the values has absolutely no impact... :mellow:
Also tried to check the Photon part
So it seems that if we want a better light, only way is to use the Glowstick for now.

Code: Select all

Assembly-CSharp
	PCFlashlight
		static fields
		fields
			18 : headLight (type: UnityEngine.Light)
			20 : pcPropGrab (type: PCPropGrab)
			28 : player (type: Player)
			30 : source (type: UnityEngine.AudioSource)
			38 : view (type: PhotonView)
			40 : isOn (type: System.Boolean)
			48 : inventoryLight (type: UnityEngine.Light)
			50 : isBlinking (type: System.Boolean)
			54 : lightIntensity (type: System.Single)
			58 : blinkTimer (type: System.Single)
		methods
			.ctor ():System.Void
			Awake ():System.Void
			EnableOrDisableLight (_active: bool; _isSwapping: bool):System.Void
			EnableOrDisableLightNetworked (_active: bool; _isSwapping: bool):System.Void
			GrabbedOrDroppedFlashlight (torch: Torch; grabbed: bool):System.Void
			GrabbedOrDroppedFlashlightNetworked (_intensity: single; _range: single; _angle: single):System.Void
			OnTorchUse (context: UnityEngine.InputSystem.InputAction/CallbackContext):System.Void
			TurnBlinkOnOrOff (active: bool):System.Void
			Update ():System.Void

User avatar
Cake-san
Table Makers
Table Makers
Posts: 322
Joined: Sun Mar 26, 2017 4:32 pm
Reputation: 431

Re: Phasmophobia

Post by Cake-san »

Don't know if this will work for anyone though... :sleep:
Improved Flashlight (GrabbedOrReGrabbedFlashlight)

Code: Select all

{$lua}
function getInsForJump(address,registername,destination,allocsize,SharedMemoryName)
  address = getAddressSafe(address)
  if not address then error('getInsForJump address nil') return end
  if not allocsize then allocsize=4096 end
  destination=getAddressSafe(destination)
  if not destination then
	if not SharedMemoryName then destination = allocateMemory(allocsize,address)
	else destination = allocateSharedMemory(SharedMemoryName,allocsize) end
  end
  local size = (address+5-destination>0x7FFFFFFF) and 14 or 5
  if registername then
	unregisterSymbol(registername)
	registerSymbol(registername,destination,true)
  end
  local opcodes = {}
  local i = 0
  while(i<size) do
    local ext, opc=splitDisassembledString(disassemble(address+i))
    opcodes[#opcodes+1] = opc
    i=i+getInstructionSize(address+i)
  end
  local copy = table.concat(opcodes,'\r\n')
  local readAsTable = true
  local byt = readBytes(address,i,readAsTable)
  for j=1,#byt do byt[j] = ('%02X'):format(byt[j]) end
  local bytes = table.concat(byt, ' ')
  return i,copy,bytes,size,destination
end

function enablescript(name,registername,addressname,script,disable)
    local address=getAddress(addressname)
    if disable then script=(script):format(address,registername,readBytes(registername,1))
    else
        local i,copy,bytes,size =getInsForJump(address,name)
        script=(script):format(registername, registername, name, copy, registername, i, bytes, address)..string.rep('nop\n',i-size)..'returnhere:'
    end
    local success,erro=autoAssembleCheck(script)
    if not success then print('\n'..erro..'\n')local scriptstr=createStringlist()scriptstr.Text=script for j=0,scriptstr.Count-1 do print(string.format('%u\t%s',j+1,scriptstr[j])) end
    if not disable then deAlloc(name)unregisterSymbol(name)end error(name..' autoAssemble failed')end
    autoAssemble(script)
    if disable then deAlloc(name)unregisterSymbol(name)unregisterSymbol(registername)end
end

if syntaxcheck then return end
LaunchMonoDataCollector()
[ENABLE]
enablescript('GrabbedOrDroppedFlashlight_alloc','GrabbedOrDroppedFlashlight_save','PCFlashlight.GrabbedOrDroppedFlashlight',[[
label(newmem)
label(returnhere)
label(%s)
registersymbol(%s)

%s:
newmem:
test rdx,rdx
je short @f
mov rax,[rdx+18] //Light myLight
test rax,rax
je short @f
mov rax,[rax+10]
test rax,rax
je short @f
mov rax,[rax+50]
test rax,rax
je short @f
mov [rax+3C],(float)1 //intensity
mov [rax+40],(float)200 //range
mov [rax+4C],(float)170 //spotAngle
@@:
%s
jmp returnhere
%s:
db %X %s
%X:
jmp newmem
]])

[DISABLE]

enablescript('GrabbedOrDroppedFlashlight_alloc','GrabbedOrDroppedFlashlight_save','PCFlashlight.GrabbedOrDroppedFlashlight',[[
%X:
readmem(%s+1,%u)
]],true)
Ctrl+Alt+A to open AA window in CE

PorcelainCobra
Noobzor
Noobzor
Posts: 5
Joined: Fri Jan 08, 2021 8:21 pm
Reputation: 0

Re: Phasmophobia

Post by PorcelainCobra »

zephirot wrote:
Sun Jan 10, 2021 12:30 pm
PorcelainCobra wrote:
Sat Jan 09, 2021 4:40 pm
Works great, any plans to add a stronger flashlight?
Something I wanted to do long ago but it doesn't work.
I know that intensity of the flashlight is 0.8, the strong one is 1.0
I know the range, the angle... where to look at in the code
But changing the values has absolutely no impact... :mellow:
Also tried to check the Photon part
So it seems that if we want a better light, only way is to use the Glowstick for now.

Code: Select all

Assembly-CSharp
	PCFlashlight
		static fields
		fields
			18 : headLight (type: UnityEngine.Light)
			20 : pcPropGrab (type: PCPropGrab)
			28 : player (type: Player)
			30 : source (type: UnityEngine.AudioSource)
			38 : view (type: PhotonView)
			40 : isOn (type: System.Boolean)
			48 : inventoryLight (type: UnityEngine.Light)
			50 : isBlinking (type: System.Boolean)
			54 : lightIntensity (type: System.Single)
			58 : blinkTimer (type: System.Single)
		methods
			.ctor ():System.Void
			Awake ():System.Void
			EnableOrDisableLight (_active: bool; _isSwapping: bool):System.Void
			EnableOrDisableLightNetworked (_active: bool; _isSwapping: bool):System.Void
			GrabbedOrDroppedFlashlight (torch: Torch; grabbed: bool):System.Void
			GrabbedOrDroppedFlashlightNetworked (_intensity: single; _range: single; _angle: single):System.Void
			OnTorchUse (context: UnityEngine.InputSystem.InputAction/CallbackContext):System.Void
			TurnBlinkOnOrOff (active: bool):System.Void
			Update ():System.Void
From looking around, I see that there is a trainer that does this. It states that you need to drop the flashlight and pick it back up for the effect to take place. Perhaps your code works, you just need to drop it and pick it back up?

PorcelainCobra
Noobzor
Noobzor
Posts: 5
Joined: Fri Jan 08, 2021 8:21 pm
Reputation: 0

Re: Phasmophobia

Post by PorcelainCobra »

Cake-san wrote:
Sun Jan 10, 2021 5:06 pm
Don't know if this will work for anyone though... :sleep:
Improved Flashlight (GrabbedOrReGrabbedFlashlight)

Code: Select all

{$lua}
function getInsForJump(address,registername,destination,allocsize,SharedMemoryName)
  address = getAddressSafe(address)
  if not address then error('getInsForJump address nil') return end
  if not allocsize then allocsize=4096 end
  destination=getAddressSafe(destination)
  if not destination then
	if not SharedMemoryName then destination = allocateMemory(allocsize,address)
	else destination = allocateSharedMemory(SharedMemoryName,allocsize) end
  end
  local size = (address+5-destination>0x7FFFFFFF) and 14 or 5
  if registername then
	unregisterSymbol(registername)
	registerSymbol(registername,destination,true)
  end
  local opcodes = {}
  local i = 0
  while(i<size) do
    local ext, opc=splitDisassembledString(disassemble(address+i))
    opcodes[#opcodes+1] = opc
    i=i+getInstructionSize(address+i)
  end
  local copy = table.concat(opcodes,'\r\n')
  local readAsTable = true
  local byt = readBytes(address,i,readAsTable)
  for j=1,#byt do byt[j] = ('%02X'):format(byt[j]) end
  local bytes = table.concat(byt, ' ')
  return i,copy,bytes,size,destination
end

function enablescript(name,registername,addressname,script,disable)
    local address=getAddress(addressname)
    if disable then script=(script):format(address,registername,readBytes(registername,1))
    else
        local i,copy,bytes,size =getInsForJump(address,name)
        script=(script):format(registername, registername, name, copy, registername, i, bytes, address)..string.rep('nop\n',i-size)..'returnhere:'
    end
    local success,erro=autoAssembleCheck(script)
    if not success then print('\n'..erro..'\n')local scriptstr=createStringlist()scriptstr.Text=script for j=0,scriptstr.Count-1 do print(string.format('%u\t%s',j+1,scriptstr[j])) end
    if not disable then deAlloc(name)unregisterSymbol(name)end error(name..' autoAssemble failed')end
    autoAssemble(script)
    if disable then deAlloc(name)unregisterSymbol(name)unregisterSymbol(registername)end
end

if syntaxcheck then return end
LaunchMonoDataCollector()
[ENABLE]
enablescript('GrabbedOrDroppedFlashlight_alloc','GrabbedOrDroppedFlashlight_save','PCFlashlight.GrabbedOrDroppedFlashlight',[[
label(newmem)
label(returnhere)
label(%s)
registersymbol(%s)

%s:
newmem:
test rdx,rdx
je short @f
mov rax,[rdx+18] //Light myLight
test rax,rax
je short @f
mov rax,[rax+10]
test rax,rax
je short @f
mov rax,[rax+50]
test rax,rax
je short @f
mov [rax+3C],(float)1 //intensity
mov [rax+40],(float)200 //range
mov [rax+4C],(float)170 //spotAngle
@@:
%s
jmp returnhere
%s:
db %X %s
%X:
jmp newmem
]])

[DISABLE]

enablescript('GrabbedOrDroppedFlashlight_alloc','GrabbedOrDroppedFlashlight_save','PCFlashlight.GrabbedOrDroppedFlashlight',[[
%X:
readmem(%s+1,%u)
]],true)
Ctrl+Alt+A to open AA window in CE
This Does work when injecting. You do need to drop the flashlight and pick it back up. Thanks!

zephirot
Noobzor
Noobzor
Posts: 12
Joined: Wed Oct 28, 2020 8:48 pm
Reputation: 12

Re: Phasmophobia

Post by zephirot »

Cake-san wrote:
Sun Jan 10, 2021 5:06 pm
Don't know if this will work for anyone though... :sleep:
Improved Flashlight (GrabbedOrReGrabbedFlashlight)

Code: Select all

{$lua}
function getInsForJump(address,registername,destination,allocsize,SharedMemoryName)
  address = getAddressSafe(address)
  if not address then error('getInsForJump address nil') return end
  if not allocsize then allocsize=4096 end
  destination=getAddressSafe(destination)
  if not destination then
	if not SharedMemoryName then destination = allocateMemory(allocsize,address)
	else destination = allocateSharedMemory(SharedMemoryName,allocsize) end
  end
  local size = (address+5-destination>0x7FFFFFFF) and 14 or 5
  if registername then
	unregisterSymbol(registername)
	registerSymbol(registername,destination,true)
  end
  local opcodes = {}
  local i = 0
  while(i<size) do
    local ext, opc=splitDisassembledString(disassemble(address+i))
    opcodes[#opcodes+1] = opc
    i=i+getInstructionSize(address+i)
  end
  local copy = table.concat(opcodes,'\r\n')
  local readAsTable = true
  local byt = readBytes(address,i,readAsTable)
  for j=1,#byt do byt[j] = ('%02X'):format(byt[j]) end
  local bytes = table.concat(byt, ' ')
  return i,copy,bytes,size,destination
end

function enablescript(name,registername,addressname,script,disable)
    local address=getAddress(addressname)
    if disable then script=(script):format(address,registername,readBytes(registername,1))
    else
        local i,copy,bytes,size =getInsForJump(address,name)
        script=(script):format(registername, registername, name, copy, registername, i, bytes, address)..string.rep('nop\n',i-size)..'returnhere:'
    end
    local success,erro=autoAssembleCheck(script)
    if not success then print('\n'..erro..'\n')local scriptstr=createStringlist()scriptstr.Text=script for j=0,scriptstr.Count-1 do print(string.format('%u\t%s',j+1,scriptstr[j])) end
    if not disable then deAlloc(name)unregisterSymbol(name)end error(name..' autoAssemble failed')end
    autoAssemble(script)
    if disable then deAlloc(name)unregisterSymbol(name)unregisterSymbol(registername)end
end

if syntaxcheck then return end
LaunchMonoDataCollector()
[ENABLE]
enablescript('GrabbedOrDroppedFlashlight_alloc','GrabbedOrDroppedFlashlight_save','PCFlashlight.GrabbedOrDroppedFlashlight',[[
label(newmem)
label(returnhere)
label(%s)
registersymbol(%s)

%s:
newmem:
test rdx,rdx
je short @f
mov rax,[rdx+18] //Light myLight
test rax,rax
je short @f
mov rax,[rax+10]
test rax,rax
je short @f
mov rax,[rax+50]
test rax,rax
je short @f
mov [rax+3C],(float)1 //intensity
mov [rax+40],(float)200 //range
mov [rax+4C],(float)170 //spotAngle
@@:
%s
jmp returnhere
%s:
db %X %s
%X:
jmp newmem
]])

[DISABLE]

enablescript('GrabbedOrDroppedFlashlight_alloc','GrabbedOrDroppedFlashlight_save','PCFlashlight.GrabbedOrDroppedFlashlight',[[
%X:
readmem(%s+1,%u)
]],true)
Ctrl+Alt+A to open AA window in CE
Oh very nice!
I was digging in PCFlashlight.GrabbedOrDroppedFlashlightNetworked because of the 3 arguments but maybe PCFlashlight.GrabbedOrDroppedFlashlight was the key.
Thanks for this precious code, many good things in there!

Edit:
Table updated for beta 0.23
- Professional difficulty : added a script (activate before joining maps) to turn on the fusebox as before from the beginning

I'm editing the table for 0.24.1 and later, it will take time, maybe for this weekend!
Analyzing all previous tables and bytes and changing all scripts with also aob to avoid updating them in the future (if no big change of course)
- New table complete
Testing the table on 3 versions of the game (release and beta) to see if everything is ok before uploading here
- Changing again few things..
Table ready
Attachments
Phasmophobia_Zv28_Release_and_Beta0.23.CT
(270.38 KiB) Downloaded 77 times
Last edited by zephirot on Sat Jan 16, 2021 5:17 pm, edited 1 time in total.

zephirot
Noobzor
Noobzor
Posts: 12
Joined: Wed Oct 28, 2020 8:48 pm
Reputation: 12

Re: Phasmophobia

Post by zephirot »

Alright, final table ready!

Because of some offsets for the player and ghost (difference release/beta), still have to separate the scripts.
Otherwise, most of them are working in both versions.

If you have problems, don't hesitate to give a feedback.
"Normally", shouldn't be necessary to update the table if no big changes like offsets or new things.

Note: Sometimes, Mono is not correctly activated, if you can't run a script, go in top menu "Mono" then "Activate mono features"

Edit: Beta has been updated to 0.25 and the table is still working, good news, seems it's working well! :)
- Just a little update to v5, I forgot to put the Setup Phase script back for the truck timer!
- Also added a script to turn on all lights from start.

Changes in beta 0.25.1 broke some scripts..
Updated to v6

V7.1 minor update (fixed Salt)
Attachments
Phasmophobia_Release_and_Beta_AOB_v7.1.CT
(361.38 KiB) Downloaded 30 times
Phasmophobia_Release_and_Beta_AOB_v7.CT
(361.09 KiB) Downloaded 28 times
Phasmophobia_Release_and_Beta_AOB_v6.CT
(361.43 KiB) Downloaded 56 times

Post Reply

Who is online

Users browsing this forum: Cyan Garamonde, Datapel