Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ++ Initial error output
- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- Variables of different types are being compared
- (型が違う値同士を比較しようとしました)
- Z:/home/nassim/Documents/game/danmakufu/PancakeGame/Touhou Henkaden ~ Highly Responsive to Pancakes/script/Highly Responsive to Pancakes/Package.dnh
- Package.dnh line(行)=920
- ↓
- if(info[0] == "StagePackMode"){SetCommonData("StagePackPath", info[2]);}
- TStageScene(GetReplayInfo(result, REPLAY_FILE_PATH));
- }
- }
- task TStagePackSelectScene {
- SetSkipModeKey(KEY_INVALID);
- let idScript = LoadScript(GetCurrentScriptDir
- ~~~
- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- ++ Fix
- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- // File: Package.dnh
- //
- // starts line 904
- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- task TReplaySelectScene {
- SetSkipModeKey(KEY_INVALID);
- let idScript = LoadScript(GetCurrentScriptDirectory ~ "System/ReplaySelectScene.dnh");
- StartScript(idScript);
- while(!IsCloseScript(idScript)) {
- yield;
- }
- let result = GetScriptResult(idScript);
- if(result == -1) {
- TTitleScene;
- } else {
- let info = GetReplayInfo(result, REPLAY_COMMENT);
- let len = length(info);
- WriteLog("GETREPLAYINFO =========== length " ~ vtos("1d", len) ~ " == info " ~ ToString(info));
- // GetReplayInfo(result, RELAY_COMMENT) does not return an array but a string
- // I have not test if it's SetReplayInfo which converts the array to a string
- info = serializedArrayToArray(info);
- len = length(info);
- WriteLog("GETREPLAYINFO =========== length " ~ vtos("1d", len) ~ " == info " ~ ToString(info));
- //RaiseError("muujah!");
- SetCommonData("PLAYER", info[0]);
- SetCommonData("Mode", info[1]);
- //if(info[0] == "StagePackMode"){SetCommonData("StagePackPath", info[2]);}
- if(isSameString("StagePackMode", info[1])){SetCommonData("StagePackPath", info[2]);}
- TStageScene(GetReplayInfo(result, REPLAY_FILE_PATH));
- }
- }
- /* =========================================================================
- isSameString
- Checks if the two input strings are identical
- @param string ref reference string
- @param string string string to test
- @return boolean true if strings are identical, false otherwise
- ========================================================================= */
- function isSameString(let ref, let string) {
- if(length(string) != length(ref)) { return false; }
- ascent(i in 0..length(ref)) {
- if(string[i]!=ref[i]) { return false; }
- }
- return true;
- }
- /* =========================================================================
- serializedArrayToArray
- Converts a serialized array (string value) to a regular array
- @param string stringArray the serialized array to convert
- @return array
- ========================================================================= */
- function serializedArrayToArray(let stringArray) {
- let separator = ",";
- let len = length(stringArray);
- //let separatorCount = 0;
- let results = [];
- let temp = "";
- // range is 1..len-1 in order to get rid of "[" and "]" characters
- ascent(i in 1..len-1) {
- if(ToString(stringArray[i])!=separator) {
- temp = temp ~ ToString(stringArray[i]);
- }
- else {
- results = results ~ [ temp ];
- temp = "";
- }
- }
- // last result
- results = results ~ [ temp ];
- return results;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement