2021-11-24 00:44:04 -05:00
This directory holds the user profiles.
To make your own profile, create a new directory here with your username.
e.g. for username `mark` make a directory called `mark`
Inside that directory, create `user.gs` and `user.gc` files.
These are your own user scripts, loaded after the GOOS library and GOAL library respectively.
2023-01-07 11:24:02 -05:00
> Alternatively, if you only have a single folder in `goal_src/user/` it will be assumed to be your user folder
2021-11-24 00:44:04 -05:00
The rest of the directory can be used however you please!
To automatically log in as a specific user, create a `user.txt` file in this directory
which contains just the username you want to log in as. That way you don't have to
modify multiple scripts when you want to change users.
If you want to make your profile public, edit the .gitignore in this directory.
repl: Add a few new quality of life improvements (#2030)
- You can define a `startup.gc` in your user folder, each line will be
executed on startup (deprecates the usefulness of some cli flags)
- You can define a `repl-config.json` file to override REPL settings.
Long-term this is a better approach than a bunch of CLI flags as well
- Via this, you can override the amount of time the repl will attempt to
listen for the target
- At the same time, I think i may have found why on Windows it can
sometimes take forever to timeout when the game dies, will dig into this
later
- Added some keybinds for common operations, shown here
https://user-images.githubusercontent.com/13153231/202890278-1ff2bb06-dddf-4bde-9178-aa0883799167.mp4
> builds the game, connects to it, attaches a debugger and continues,
launches it, gets the backtrace, stops the target -- all with only
keybinds.
If you want these keybinds to work inside VSCode's integrated terminal,
you need to add the following to your settings file
```json
"terminal.integrated.commandsToSkipShell": [
"-workbench.action.quickOpen",
"-workbench.action.quickOpenView"
]
```
2022-11-20 14:28:41 -05:00
2023-01-07 11:24:02 -05:00
Additionally, you can provide a `repl-config.json` to set various REPL settings, an example configuration:
```json
{
"numConnectToTargetAttempts": 1,
"jak1": {
2023-04-11 17:57:20 -04:00
"gameVersionFolder": "jak1_pal", // corresponds with your "gameName" in the decomp config, "jak1" by default
2023-01-07 11:24:02 -05:00
"asmFileSearchDirs": [
"goal_src/jak1"
]
},
"jak2": {
2023-04-11 17:57:20 -04:00
"gameVersionFolder": "jak2_pal", // corresponds with your "gameName" in the decomp config, "jak2" by default
2023-01-07 11:24:02 -05:00
"asmFileSearchDirs": [
"goal_src/jak2"
]
},
"appendKeybinds": true,
"keybinds": [
{
"modifier": "ctrl",
"key": "S",
"description": "Test Bind",
"command": "(format 0 \"hello world\")"
}
2023-07-05 14:15:46 -04:00
],
"perGameHistory": false // do not use separate history files for each game version
2023-01-07 11:24:02 -05:00
}
```
repl: Add a few new quality of life improvements (#2030)
- You can define a `startup.gc` in your user folder, each line will be
executed on startup (deprecates the usefulness of some cli flags)
- You can define a `repl-config.json` file to override REPL settings.
Long-term this is a better approach than a bunch of CLI flags as well
- Via this, you can override the amount of time the repl will attempt to
listen for the target
- At the same time, I think i may have found why on Windows it can
sometimes take forever to timeout when the game dies, will dig into this
later
- Added some keybinds for common operations, shown here
https://user-images.githubusercontent.com/13153231/202890278-1ff2bb06-dddf-4bde-9178-aa0883799167.mp4
> builds the game, connects to it, attaches a debugger and continues,
launches it, gets the backtrace, stops the target -- all with only
keybinds.
If you want these keybinds to work inside VSCode's integrated terminal,
you need to add the following to your settings file
```json
"terminal.integrated.commandsToSkipShell": [
"-workbench.action.quickOpen",
"-workbench.action.quickOpenView"
]
```
2022-11-20 14:28:41 -05:00
And a `startup.gc` where each line will be executed upon startup
2023-01-07 11:24:02 -05:00
## Re-running certain commands upon listening to the target
A common workflow that you might want in your `startup.gc` is something like the following:
```clj
(mi)
(lt)
(dbgc)
(test-play)
```
This builds the game, connects to the game, attaches the debugger, and runs it.
However, when you crash you ideally want to just be able to:
- stop the game via `(:stop)` or the respective keybind
- fix the code, rebuild just that file
- re-launch the game and re-connect
Upon which you'd probably want to run all or some of the above startup again. But how can you accomplish this without re-launching the REPL completely? Like so:
```clj
(mi)
(lt)
;; og:run-below-on-listen
(dbgc)
(test-play)
```
As the comment suggests, upon a succesful `(lt)` it will run any lines below it again.