《双点医院》★★★★★★★★★★内置Debug控制台开启方法★★★★★★★★★★
本帖最后由 tempa 于 2018-9-6 19:30 编辑不算原创,但是好像看某个贴子,有个哥们贴了张控制台的图,google了一下找到了CE版本。
http://fearlessrevolution.com/viewtopic.php?t=7780
但是我比较喜欢直接用C#高级语言处理,所以直接改了个dnSpy版,无需CE。
简单说下方法,理论上此修改方法应该全版本通用,但是我只下载了最初的版本,因为第1版我玩着没什么问题,现在二周目,所以就没更新。
另外也不知道这哥们发的是哪个版本的Assembly-CSharp-firstpass.dll文件,版本不同,直接覆盖肯定会出问题。还是按自己当前的版本,自己改最靠谱。
首先备份2个文件
TwoPointHospital\TPH_Data\Managed\Assembly-CSharp.dll
和
TwoPointHospital\TPH_Data\Managed\Assembly-CSharp-firstpass.dll
这次要多备份1个Assembly-CSharp-firstpass.dll,因为我们要修改这个文件。
Assembly-CSharp.dll改多了,没想到这次会在Assembly-CSharp-firstpass.dll里。
1.首先选中Assembly-CSharp-firstpass.dll依次展开
UnityConsole >> ConsoleCommandsDatabase >> RegisterCommand 函数,如图
你看到的这个函数应该是空的,而我这里是改好的,编辑函数,加入下面这句话,重新编译即可。
ConsoleCommandsDatabase.Database = new ConsoleCommand(command, description, usage, callback);
新手可以参考我之前的dnSpy入门贴子。
http://bbs.3dmgame.com/thread-5782890-1-1.html
如果编译没出任何错误,那么保存他就可以了。
2.接下来Assembly-CSharp.dll依此展开
TH20 >> App >> .ctor
如图,点击编辑方法
去掉图中所示的这行代码
base..ctor();
并且在函数参数末尾加入
: base()
如图
这句函数参数尾加: base似乎不写也行,但是按照C#的写法应该是写上的。
如果你的版本没有base..ctor();这句代码就不用管,继续看下面。
接下来按Ctrl + F搜索字符串
consoleController.ToggleKey
来到如图
把这句的KeyCode.None改为
KeyCode.BackQuote
如图
这是1前面的那个~那个键,是许多自带控制台调式游戏的默认键,当然你也可以改成其他任何你喜欢的快捷键。
全部搞定后点右下角的编译按钮,如果没有任何错误,保存,再进游戏,按~键即可调出控制台。
最后附上控制台命令。
可以测试一下命令,我只试了一个命令
SpawnGhost
生成鬼魂
为了不破坏游戏进度,新开一个存档,第1关先生成一屋子鬼玩玩,看起来可以正常使用。
很好,有了控制台,可以彻底消除角色了,对于编辑建筑都复原不了而卡死的员工和病人有奇效,真是好消息。
DebugDestroyCharacter
删除选中角色
ClearQualifications
选中角色属性槽设为白板,洗属性神技,保留槽位,只去掉属性
SpawnRequiredStaff
补全当前状态下AI认为所缺少的员工,还有这种操作......我感觉不是我玩游戏,而是游戏玩我......{:2_29:}
版主不要加隐藏了,加了隐藏我自己都编辑不了贴子了{:3_124:}
大佬。。控制台命令能不能给个中文版的 水平有限看不懂啊 我的英文也很烂,等英文大佬翻译吧 这让我小学英语不及格的人怎么看啊........................ 支持支持 过去瞄了瞄那些时间...
应该还是初版来的...还是8月30左右的事..而且也没之后了.. 真厉害,让我学编程的节奏 谢谢楼主分享 本帖最后由 Swatering 于 2018-9-6 15:47 编辑
我翻下那些debug 的语句吧,纯手打。有错误勿喷
游戏内主要修改
ModifyBalance", "Changes bank balance by some amount", "ModifyBalance Amount, e.g. ChangeBalance -100 直接改显示余额
EarnMoney", "Change bank balance by some amount, and counts as earned", "EarnMoney Amount, e.g. EarnMoney -100" 余额增加收入金钱
SetSpeedMax", "Sets the speed to max", "SetSpeedMax 游戏速度设到最快。不知道最大是多少。
SetSpeedMin", "Sets the speed to min", "SetSpeedMax 设到最慢游戏速度
SetSpeedDefault", "Sets the speed to default (1x)", "SetSpeedMax" 设置普通游戏速度
SpawnPatient", "Spawns a patient next frame", "SpawnPatient 下一帧位置生成病人
SpawnSomePatients", "Spawns some (default 16) patients", "SpawnSomePatients 生成默认数量16个病人
SpawnOnePatientWithEachIllness", "Spawns one patient with each illness", "SpawnOnePatientWithEachIllness 生成带已知的每种病症的病人各一个
SpawnGhost", "Spawns a ghost", "SpawnGhost 随机生成鬼混
SpawnGhostAtCursor", "Spawns a ghost at the cursor", "SpawnGhostAtCursor 鼠标位置生成鬼混
Die", "Make all characters dead", "Die 所有角色死亡
Poop", "Make all characters have an accident", "Poop 所有角色遭遇意外(比如摔倒等)
Sick", "Make all characters throw up", "Sick 所有角色呕吐
Thirsty", "Make all characters suddenly super thirsty", "Hungry 所有角色特别渴
Hungry", "Make all characters suddenly super hungry", "Hungry 所有角色特别渴
PixelateCharacter", "Makes the selected character pixelated", "PixelateCharacter 把选中的人物 像素化(8位症)
ApplyCharacterMask", "Apply Character Mask", "Apply Character Mask 没懂
SpawnMonoBeast", "Spawns a MonoBeast at the cursor location", "SpawnMonoBeast 生成藏霉怪
RadioSkipToEnd", "Skips to the last 10 seconds of a song.", "RadioSkipToEnd 当前BGD跳到播放最后10秒
ModifyReputation", "Changes special reputation by some amount", "ModifyReputation Amount, e.g. ModifyReputation -100 修改声誉
CreateStaffChallenge", "Instantly creates a new staff challenge", "CreateStaffChallenge" 生成员工挑战
DumpStaffWorkScehdule", "Dumps out a log of all jobs in the work scheduler", "DumpStaffWorkScehdule 放弃所有的员工职责设置,即你改过的员工全部置空还是恢复全部我也不清楚
SetDayOfMonth", "Sets the day of the month", "SetDayOfMonth 设定几号。。1号发工资哦
SetMonthOfYear", "Sets the month of the year", "SetMonthOfYear 设定月份
SetYear", "Sets the year number", "SetYear " 设定年份
[collapse=DEBUG相关修改][/collapse]
SetDebugFlyCameraEnabled", "Sets whether debug fly camera is active", "SetDebugFlyCameraEnabled 设置debug空中摄像头启用,估计角度会比游戏摄像头更高
LoadLevel", "Loads a level with a given ID", "LoadLevel LevelID 开启 第X关
GenerateAssetIDCSV", "Generates the asset ID CSV file", "GenerateAssetIDCSV 生成资产物品ID的EXCEL表格到本地
Language", "Set the current language", "Language 改游戏语言
CreateChallenge", "Instantly creates a new challenge with the index into the ChallengeManager playlist", "CreateChallenge <name>, e.g. CreateChallenge Earthquake 生成地震、火山等随机事件
LogCurrentChallengeScore", "Logs the current challenge score breakdown", "LogCurrentChallengeScore 记录已经挺过的 事件
StopAllChallenges", "Stop any further challenges from starting", "StopAllChallenges 关掉所有随机事件发生
TogglePatientSpawning", "Toggles patient spawning on/off", "TogglePatientSpawning 切换病人生成功能开关
Unhappy", "Make all characters suddenly unhappy", "Unhappy 所有人物不高兴
SetAttributeOnAllCharacters", "Sets an attribute on all characters to some amount", "SetAttributeOnAllCharacters e.g. SetAttributeOnAllCharacters Hunger -100 修改人物的 饥饿、渴、高兴、健康、卫生等数值
OpenHospital", "Open hospital", "OpenHospital 医院开门
CloseHospital", "Close hospital", "CloseHospital 医院关门
UnlockLevelIllnesses", "Unlocks all illnesses that are defined for this level", "UnlockLevelIllnesses 开启当前关卡所有疾病
UnlockAllIllnesses", "Unlocks all illnesses", "UnlockAllIllnesses 解锁所有疾病
RunPatientSpawnSimulation", "Runs a spawn simulation X times to help balance weights", "RunPatientSpawnSimulation 执行病人生成程序 可控制疾病种类及病人数量
DeleteCollaborativeProjectFiles", "Deletes the remote storage for your collaborative projects", "DeleteCollaborativeProjectFiles 不懂
AbandonCollaborativeObjective", "Abandons current collaborative objective if there is one", "AbandonCollaborativeObjective 不懂
[/collapse]
DebugKillCharacter", "Kill the character currently selected", "DebugKillCharacter 杀人
DebugDestroyCharacter", "Destroy the character currently selected", "DebugDestroyCharacter 删掉人物
SetCharacterToiletFull", "Set the selected character's toilet attribute to full", "SetCharacterToiletFull 设定人物非常想上厕所
SetCharacterBoredomFull", "Set the selected character's boredom attribute to full", "SetCharacterBoredomFull 设定人物十分无聊
SetCharacterEnergyEmpty", "Set the selected character's energy attribute to empty", "SetCharacterEnergyEmpty 设定人物能力条空
SetCharacterHungerFull", "Set the selected character's hunger attribute to full", "SetCharacterHungerFull 设定人物饥饿满
SetCharacterLitterFull", "Set the selected character's litter attribute to full", "SetCharacterLitterFull 设定人物满身垃圾
SetCharacterThirstFull", "Set the selected character's thirst attribute to full", "SetCharacterThirstFull 十分饥渴
SetCharacterHappinessEmpty", "Set the selected character's happiness attribute to empty", "SetCharacterHappinessEmpty 幸福值空
SetCharacterHappinessFull", "Set the selected character's happiness attribute to full", "SetCharacterHappinessFull 幸福值满
RemoveCharacterSkinOverride", "Remove Character Skin Override", "Remove Character Skin Override 去掉病人的病症表现。即你无法从外观判断某些疾病,因为大家都一样
AddStaffXP", "Increase the selected staff member's XP", "AddStaffXP 增加员工经验
SetStaffRank", "Set staff member's rank level", "SetStaffRank 设定员工职称“见习”“初级”“高级”什么的
SetStaffRequiresTraining", "Set staff member requires training", "SetStaffRequiresTraining 设定员工需要培训,新加一个技能槽
StaffResign", "Make the selected staff member resign", "StaffResign 员工辞职
StaffThreatenToLeave", "Make the selected staff member threaten to leave", "StaffResign 员工威胁辞职
ApplyDamage", "Applies damage to the room item", "ApplyDamage 房间内物品损坏
SetMaintenanceLevelFull", "Set the selected room item's maintenance attribute to full", "SetMaintenanceLevelFull 维修值满 即毋须维护
UpgradeItem", "Upgrades the selected room item", "UpgradeItem 升级物品
CompleteDiagnosis", "Completes diagnosis and sends patient to treatment room", "CompleteDiagnosis 对病人完成诊断并送去治疗
AssignQualification", "Assign qualification to staff member", "AssignQualification 对员工赋予技能
ClearQualifications", "Removes all qualifications on the staff member", "ClearQualifications 清空员工技能
MarkForPromotion", "Sets the selected character as ready for promotion", "MarkForPromotion 员工可以晋升
AssignTrait", "Assign trait to character", "AssignTrait 给任务赋予特质,比如那些治疗加幸福感5什么的,暴躁,饿怒症什么的
ClearTraits", "Removes all traits on a character", "ClearQualifications 清空任务特质
SetHiresFlavourTrait", "Assigns the specified flavour trait key to the first doctor in the hire menu", "SetHiresFlavourTrait <TraitNumber> <Gender> 对招聘列表里的第一位医生赋予某个特定的特质以及性别,估计有些特质有性别限制
AssignGuiltTrip", "Assigns the specified guilt trip key to a character", "AssignGuiltTrip <TraitNumber> <Gender> 同上,罪恶感相关
EditHospital", "Edit hospital layout", "EditHospital 编辑医院地界
BuyPlot", "Buy a specific hospital plot", "BuyPlot 购买一块空地
SellPlot", "Sell a specific hospital plot", "SellPlot 卖出一块空地
OffsetLandscapeItems", "Offset all landscape items", "OffsetLandscapeItems X Y关闭地面景观物体,即正常游戏无法控制那些停车场之类的东西
NukeLandscapeItems", "Deletes all landscape items containing tag", "NukeLandscapeItems <tag>摧毁所有地面景观物体
DestroyItems", "Destroys all room items containing tag", "DestroyItems <tag> 摧毁房间里的物品
NumItemsWithTag", "Prints number of items matching debug tag", "DestroyItems <tag> 对各种道具标记上标签
DestroyAllRooms", "Destroys all rooms", "DestroyAllRooms 删除所有放假
LoadRoomLayout", "Load room layout config file", "LoadRoomLayout 加载保存过的房间
SaveRoomLayout", "Save room layout config file", "SaveRoomLayout 保存当前房间模型
SpawnRequiredStaff", "Spawn required staff", "SpawnRequiredStaff 补满当前所需要的职业空缺,没抓鬼的清洁工就给你补个抓鬼的,以此类推
ReloadRoomLights", "Reload Room Lights", "Reload Room Lights 重新调节房间亮度
AutoReloadRoomLights", "Auto Reload Room Lights", "Auto Reload Room Lights自动重新调节亮度
PlaySoundEventEndlessly", "Play and loop a Sound Event Endlessly", "Play and loop a Sound Event Endlessly 循环一个特效音。不是BGM。
SetWorkLifeBalance", "Sets the staff work life balance slider", "SetWorkLifeBalance <type> <rank> <slider> 设定员工休息条,游戏里按4,看员工信息里的那个休息条
LogStaffRecord", "Logs the current staff record for the current year", "LogStaffRecord 记录当前年份的员工信息
RetroEveryone", "Make all characters have retro effect", "RetroEveryone 所有人物变成初代主题医院风格
DisableAllCharacterVisualModes", "Disable all visual modes on all characters", "DisableAllCharacterVisualModes 无法点击人物镜头跟随
SaveScenario", "Saves current level scenario", "SaveScenario 保存当前剧情
ShowHospitalEventLog", "ShowHospitalEventLog", "ShowHospitalEventLog 展示医院事件记录
PushCursorVaccinate", "Activate Vaccinate Cursor", "Activate Vaccinate Cursor 鼠标变成打疫苗的状态
ToggleLevelCamera", "Toggles level camera on/off, to be used when other cameras are available", "ToggleLevelCamera debug镜头开了之后,调整镜头切换
ToggleDebugLevelCamera", "Allows greater pitch angles on the level camera", "ToggleDebugLevelCamera 允许镜头到达更高角度
[collapse=以下几个是游戏画面,阴影质量之类的东西。不翻了]
DisableAA", "Disable Antialiasing", "DisableAA
EnableSMAA", "Enable Subpixel Morphological Antialiasing", "EnableSMAA
EnableFXAA", "Enable Fast Approximate Antialiasing", "EnableFXAA
EnableTAA", "Enable Temporal Antialiasing", "EnableTAA
DisableLargeRT", "Disables Large RT for capturing", "DisableLargeRT
EnableLargeRT", "Enable Large RT for capturing", "EnableLargeRT <scale>
ToggleShadowCulling", "Toggle the shadow culling optimisation", "ToggleShadowCulling[/collapse]
AssignQualification {definition.NameLocalised}", "Assign qualification <staffName> to staff member", "AssignQualification 赋予技能
AssignTrait {definition.GetShortName(Character.Sex.Male)}", "Assign trait " + ((UnityEngine.Object)SharedInstanceUtils.GetSharedInstance(definition)).name + "to staff member", "AssignTrait赋予特质
"AwardStar", "Awards star to current level", "AwardStar 奖励星星
AwardSilver", "Awards silver to the player", "AwardSilver 没懂
UnlockEverything", "Unlocks everyting in the game i.e. levels, rooms, items", "UnlockEverything 解锁所有物品
UnlockAllLevels", "Unlocks all levels in the game", "UnlockAllLevels 解锁所有关卡
LockAllSilverItems", "Locks all silver items in the game", "LockAllSilverItems 锁定所有银色物品
UnlockAllSilverItems", "Unlocks all silver items in the game", "UnlockAllSilverItems 解锁所有银色物品
LogFoundationValue", "Prints information about the foundation value", "LogFoundationValue 保存投资的记录
ToggleAddWallBackFace", "Toggles adding a wall back face programmatically", "ToggleAddWallBackFace 开启小窗增加墙体纹理
ToggleUseDefaultWallPrefabs", "Toggles using default wall prefabs for performance testing", "ToggleUseDefaultWallPrefabs" 开启墙体使用默认的纹理
感谢楼主的分享
淦,还能这样么
支持一下!!! 谢谢楼主分享 技术帖子支持~~~~! 11111111111111111111
6666666666666试试看
本帖最后由 kk2065c03 于 2018-9-6 16:18 编辑
1.02 版本似乎不同?Assembly-CSharp.dll 沒有 base..ctor();
強行加上 : base()
會出現'GC' does not contain a definition for 'Collect'
跟 The foeld 'App._graphyManager' is never used
是不是缺了什麼?
牛逼,跪伏
谢谢分享!!
666666666666666666666666
66666666666666
本帖最后由 tempa 于 2018-9-6 22:44 编辑
kk2065c03 发表于 2018-9-6 15:51
1.02 版本似乎不同?Assembly-CSharp.dll 沒有 base..ctor();
強行加上 : base()
會出現'GC' does not con ...
没下过1.02,如果没有就不加试试。
没办法把文件发出来,因为大家版本都不同,修改过的部分也不同,只能分享方法,MOD还没有正式出来,所以暂时也无法做成MOD。
只能有耐心的人瞎搞着玩玩了。
本帖最后由 a123456000 于 2018-9-7 01:18 编辑
多谢楼主分享经验,成功开启,我这笨人就用刚在游戏里试过的代码借花献佛分享一下吧!
ClearQualifications 删除人物技能
AssignQualification +技能ID技能级数=增加选定人物技能(如下)
助理
AssignQualification <!-Missing Translation -!> 营销学 最高5级
AssignQualification <!-Missing Translation -!> 客户服务 最高5级
医生/护士
AssignQualification <!-Missing Translation -!> 诊断 最高5级
AssignQualification <!-Missing Translation -!>全科诊断 最高5级
AssignQualification <!-Missing Translation -!> 遗传学 最高1级
AssignQualification <!-Missing Translation -!> 精神学 最高5级
AssignQualification <!-Missing Translation -!> 放射学 最高1级
AssignQualification <!-Missing Translation -!> 研究 最高5级
AssignQualification <!-Missing Translation -!> 外科学 最高5级
AssignQualification <!-Missing Translation -!> 治疗 最高5级
AssignQualification <!-Missing Translation -!> 注射 最高1级
AssignQualification <!-Missing Translation -!> 药房 最高1级
AssignQualification <!-Missing Translation -!> 病房 最高5级
通用
AssignQualification <!-Missing Translation -!> 体力培训 最高1级
AssignQualification <!-Missing Translation -!> 情商学 最高1级
AssignQualification <!-Missing Translation -!> 临床交流 最高1级
AssignQualification <!-Missing Translation -!> 工作激情 最高1级
AssignQualification <!-Missing Translation -!> 培训达人班 最高1级
勤杂工
AssignQualification <!-Missing Translation -!> 捉鬼 最高1级
AssignQualification <!-Missing Translation -!> 维护最高5级
AssignQualification <!-Missing Translation -!> 机械升级 最高5级
ClearTraits删除人物特质
AssignTrait +特质ID=添加选定人物特质(如下)
AssignTrait <!-Missing Translation -!> 好辩
AssignTrait <!-Missing Translation -!> 无聊
AssignTrait <!-Missing Translation -!> 魅力十足
AssignTrait <!-Missing Translation -!> 脏脏的
AssignTrait <!-Missing Translation -!> 艺人
AssignTrait <!-Missing Translation -!> 邪恶本性
AssignTrait <!-Missing Translation -!> 有趣的人
AssignTrait <!-Missing Translation -!> 园艺高手
AssignTrait <!-Missing Translation -!> 饿怒症
AssignTrait <!-Missing Translation -!> 乐观主义者
AssignTrait <!-Missing Translation -!>闷闷不乐
AssignTrait <!-Missing Translation -!> 治愈者
AssignTrait <!-Missing Translation -!> 小洁癖
AssignTrait <!-Missing Translation -!> 美颜心悸
AssignTrait <!-Missing Translation -!> 激励者
AssignTrait <!-Missing Translation -!> 懒人
AssignTrait <!-Missing Translation -!> 一学就会
AssignTrait <!-Missing Translation -!> 笨拙
AssignTrait <!-Missing Translation -!> 垃圾制造者
AssignTrait <!-Missing Translation -!> 精神抖擞
AssignTrait <!-Missing Translation -!> 瞌睡虫
AssignTrait <!-Missing Translation -!> 讨厌鬼
AssignTrait <!-Missing Translation -!> 粗俗不堪
AssignTrait <!-Missing Translation -!> 我很贵
AssignTrait <!-Missing Translation -!> 我很便宜
AssignTrait <!-Missing Translation -!> 恋爱狂
AssignTrait <!-Missing Translation -!> 急性子
AssignTrait <!-Missing Translation -!> 老师
AssignTrait <!-Missing Translation -!> 不知疲倦
AssignTrait <!-Missing Translation -!> 厕怒症
AssignTrait <!-Missing Translation -!> 不讲卫生
AssignTrait <!-Missing Translation -!> 无精打采
AssignTrait <!-Missing Translation -!> 膀胱不好
1.02测试成功,可以用 机械升级那个我打错了是Mechanics! 本帖最后由 风卷残翼 于 2018-9-7 12:27 编辑
谢谢大佬!小白修改成功!!
顺便附上v1.02(v1.0.20902)版本自己修改的文件(其他均未修改 只是按照楼主方法修改了控制台)
其他版本的改完多分享吧,我这改的乱七八槽的就不放1.00的文件了。
当然改起来也不难,点几下鼠标,复制粘贴,最多5分钟就解决了。 风卷残翼 发表于 2018-9-7 11:55
谢谢大佬!小白修改成功!!
顺便附上v1.02(v1.0.20902)版本自己修改的文件(其他均未修改 只是按照楼主 ...
01文件损坏?
xsunstar 发表于 2018-9-6 22:39
1.02测试成功,可以用
求修改方法, 1.02 版本似乎不同?Assembly-CSharp.dll 沒有 base..ctor();
強行加上 : base()
會出現'GC' does not contain a definition for 'Collect'
跟 The foeld 'App._graphyManager' is never used
是不是缺了什麼?
如果没有就不用加,一切以能编译通过为准,那个代码修改的主要目的是让控制台按键生效。默认是没有分配按键。改一句话就能解决。