Does anyone know how to open url and/or how to open txt file from krk game?
Is there any English documentation for krk?
var lines = [];
lines.load(System.exePath + filename);
System.shellExecute(url)
System.shellExecute("download.ps1")
I guess, to use System.shellExecute(url) I need to write a function and call the function from main menu, because I can't invoke it in main menu. Or can I? Is there any inline method to do so?Read the file?
Code to load a text file into an array by lines:
Use System.exePath to read a file from the same folder as the main exe. Without a path, it will load the file from the data folder or one of the .xp3 archives.Code:var lines = []; lines.load(System.exePath + filename);
You can open the URL in the system browser:But if you need to download a file and read it, then it is probably impossible by default without plugins or using external programs to download the file, like writing a PowerShell script to download the file, run it withCode:System.shellExecute(url)
and then read downloaded file with load. I never tried this, so not sure if it will work.Code:System.shellExecute("download.ps1")
@select text="Where to buy the game" target=System.shellExecute(https://www.dlsite.com/maniax/circle/profile/=/maker_id/RG03103.html)
does not work.@select text="Where to buy the game" target=*openURL
@jump
...) and label.*openURL
[commit]
[iscript]
System.shellExecute("https://www.dlsite.com/maniax/circle/profile/=/maker_id/RG03103.html");
[endscript]
; return back to the menu
[jump target=*menu]
@return
).WORKS!!! THANKS!It depends on how the "select" macro is defined.
Probably something like this should work:
*openURL is a label - named position in the code that should be executed, labels start with *.Code:@select text="Where to buy the game" target=*openURL
And somewhere in the same script, it should be carefully placed not to break other code, on an empty line between some [jump ...] (or@jump
...) and label.
Code:*openURL [commit] [iscript] System.shellExecute("https://www.dlsite.com/maniax/circle/profile/=/maker_id/RG03103.html"); [endscript] ; return back to the menu [jump target=*menu]
Instead of *menu should be a real label from this file, probably it will be on the top of the file (or next one after [return] or@return
).
Do you know how to use console? For example to see current variables?
@set (K2COMPAT_PURGE_DEBUG = 1)
and @set (K2COMPAT_PURGE_CONSOLE = 1)
at startup.tjs if there are such lines.I think I did that, just the K2... variables were in different file (k2compat.tjs). I have a black dos-like debug screen, but no console...Comment lines (add "//" at start of line)@set (K2COMPAT_PURGE_DEBUG = 1)
and@set (K2COMPAT_PURGE_CONSOLE = 1)
at startup.tjs if there are such lines.
Run the game with the "-debug" argument like "game.exe -debug".
This should enable the console; you can just input variable names to check their values.
I think I did that, just the K2... variables were in different file (k2compat.tjs). I have a black dos-like debug screen, but no console...
The black screen seems read only.
var underDevelopment = (Storages.extractStorageName(System.exeName) == "krkr.exe");
with var underDevelopment = true;
game.charaEdit.bonusPoint