跑跑車首頁

當(dāng)前位置:首頁攻略秘籍單機(jī)攻略 → 巫師3加載游戲報(bào)錯(cuò)解決方案_巫師3Could not find function報(bào)錯(cuò)

巫師3加載游戲報(bào)錯(cuò)解決方案_巫師3Could not find function報(bào)錯(cuò)

作者:Koroomoo來源:本站整理 發(fā)表時(shí)間:2017/8/18 16:51:47 評(píng)論(0)

Could not find function 'GetChosenMainMenuType',無法找到函數(shù),“GetChosenMainMenuType”函數(shù)未被定義。相信不少人也遇到過這種報(bào)錯(cuò),真的鬧心,小編在這里為大家?guī)斫鉀Q這個(gè)報(bào)錯(cuò)的方法!

Could not find function 'GetChosenMainMenuType'
無法找到函數(shù),“GetChosenMainMenuType”函數(shù)未被定義。


相信不少人也遇到過這種報(bào)錯(cuò),真的鬧心。
如果是使用WitcherScriptMerger 0.6.2的話,這種錯(cuò)誤是根本檢測(cè)不出來。

通過四處查找,終于找到了這種報(bào)錯(cuò)的緣由。
問題出在r4Game.ws文件上。


在GOG年度版1.3.1游戲原文件中原本是有“GetChosenMainMenuType”等函數(shù)的定義的。
位置:E:\The Witcher 3 GOG\content\content0\scripts\game\r4Game.ws


而在WitcherScriptMerger 0.6.2漢化版中,其初始默認(rèn)的r4Game.ws就缺失了這段“GetChosenMainMenuType”等函數(shù)的定義。
位置:E:\The Witcher 3 GOG\Witcher Script Merger\Tools\wcc_lite\r4data\scripts\game\r4Game.ws


當(dāng)使用0.6.2版去做mod整合時(shí)生成的mod0000_MergedFiles時(shí),其生成的r4Game.ws也就沒有“GetChosenMainMenuType”函數(shù)的
位置:E:\The Witcher 3 GOG\Mods\mod0000_MergedFiles\content\scripts\game\r4Game.ws


所以用0.6.2版整合腳本,檢測(cè)無錯(cuò)(它本身就不包含GetChosenMainMenuType等有些函數(shù)的寫入),但打開游戲加載腳本時(shí)就會(huì)出錯(cuò)

解決方法:
GetChosenMainMenuType函數(shù)的定義等缺失部分,在PopulateMenuQueueMainAlways函數(shù)和GetNewGameDefinitionFilename函數(shù)之間。
1.打開:E:\The Witcher 3 GOG\Mods\mod0000_MergedFiles\content\scripts\game\r4Game.ws (右鍵用記事本打開該文件

2.搜索(Ctrl+F):public function GetNewGameDefinitionFilename() : string

3.在其之前添加:GetChosenMainMenuType等函數(shù)的定義,內(nèi)容如下(內(nèi)容與E:\The Witcher 3 GOG\content\content0\scripts\game\r4Game.ws中的相同)

例如:
private var _mainMenuType : int; default _mainMenuType = -1;


        public function GetChosenMainMenuType() : int
        {
                return _mainMenuType;
        }
        
        private function ChooseRandomMainMenuIfNotChosenYet() : int
        {
                var availableMainMenuTypes : array< int >;
                var seed : int;
                var index : int;
                
                if ( _mainMenuType > -1 )
                {
                        return _mainMenuType;
                }
                
                availableMainMenuTypes.PushBack( 0 );
                
                if (theGame.GetDLCManager().IsEP1Available())
                {
                        availableMainMenuTypes.PushBack( 1 );
                }
                if (theGame.GetDLCManager().IsEP2Available())
                {
                        availableMainMenuTypes.PushBack( 2 );
                }


                seed = CalcSeed( theGame );
                index = (int)RandNoiseF( seed, availableMainMenuTypes.Size() );


                _mainMenuType = availableMainMenuTypes[ index ];
                LogChannel('asd', "RAND " + seed + "   " + index + "   " + _mainMenuType );


                return _mainMenuType;
        }

注意“}”別刪,“private var _mainMenuType : int;”前面的Tab符別忘,回車符要有。

改完之后,可以打開E:\The Witcher 3 GOG\content\content0\scripts\game\r4Game.ws,兩個(gè)文件對(duì)比看看格式。


最后,如果沒有mod0000_MergedFiles文件夾,比如單個(gè)mod的測(cè)試,也有相同的錯(cuò)誤,上述的方法同樣適用。

在Mods文件夾下搜索“r4Game.ws”


選擇可能引起報(bào)錯(cuò)的r4Game.ws,同樣地對(duì)照E:\The Witcher 3 GOG\content\content0\scripts\game\r4Game.ws來添加缺失部分。


玩家評(píng)論
我要點(diǎn)評(píng)

網(wǎng)名 注:您的評(píng)論需要經(jīng)過審核才會(huì)顯示出來。

已有 0 位玩家參與點(diǎn)評(píng)
下載排行