Using the Console - Yozzaxia1311/MegaManLove GitHub Wiki
Pressing the tilde key will present you this engine's most useful debugging tool:
In the console, you can type and execute commands with user-provided parameters, as well as set console variables.
Commands
Note: assets/autoexec.cfg
is ran automatically when the game starts.
Name | Arguments | Usage | Is a cheat | Example |
---|---|---|---|---|
findcmd |
N/A | Gives a list of all commands | No | Use name |
findcvar |
N/A | Gives a list of all console variables | No | Use name |
help |
Command name | Gives info about command | No | help findcmd |
exec |
Path of .cfg executable (don't include extension) |
Runs commands from an external .cfg file |
No | echo assets/testcfg |
runlua |
Path of .lua file (don't include extension) |
Runs Lua from an external .lua file |
Yes | runlua assets/testlua |
echo |
What to print | Prints to the console | No | echo hello world! |
clear |
N/A | Clears the console | No | Use name |
alias |
Command name, alias | Alias a command | No | alias echo findcmd |
wait |
Optional wait time in frames (default is 1) | Delays console execute | No | wait , wait 100 |
opendir |
N/A | Opens the save directory | No | Use name |
setskin |
Path of directory, Optional player number | Sets the skin of a player, or all players if the seconds arg is omitted | Yes | setskin assets/players/megaMan , setskin assets/players/megaMan 1 |
reset |
N/A | Resets the game | No | Use name |
quit |
N/A | Quits the game | No | Use name |
defbinds |
N/A | Sets player input back to default | No | Use name |
states |
N/A | Gives a list of all state files | No | Use name |
state |
State path (don't include extension) | Sets the state | Yes | state assets/states/templates/templateStage |
resetstate |
Optional checkpoint name | Resets the state, with an optional checkpoint | Yes | resetstate , resetstate boss |
checkpoints |
N/A | Gives a list of all checkpoints | Yes | Use name |
checkpoint |
Checkpoint name | Sets the checkpoint | Yes | checkpoint boss |
getpos |
N/A | Gives the main player's position | No | Use name |
give |
Global object index, optional parameters | Spawns an object. playerx /y allows for offseting numbers by the main player's coords |
Yes | give health playerx,-32 playery (playerx,-32 is the difference of main player's x coord and -32) |
hurt |
Damage (negative numbers heal) | Hurts all players | Yes | hurt 5 , hurt -10 |
kill |
N/A | Kills all players | No | Use name |
grav |
Gravity multiplier | Sets the gravity multiplier of all players | Yes | grav 0.5 |
flip |
N/A | Flips the gravity of all players | Yes | Use name |
recs |
N/A | Gives a list of all recordings | No | Use name |
rec |
N/A | Starts recording after the next state is set | Yes | Use name |
recend |
N/A | Ends an on-going recording | No | Use name |
recsave |
Save name (don't include extension) | Saves .rd recording file |
No | recsave testrec |
recopen |
Path of .rd record (don't include extension) |
Runs a recording from an external .rd file |
Yes | recopen testrec |
recdel |
Path of .rd record (don't include extension) |
Deletes external .rd file |
No | recdel testrec |
lockcheats |
N/A | Sets the value of cheats to 0 , and flags it as cheat |
No | Use name |
Console variables
Note: when setting a console variable, the first argument is the name of the variable, and the second argument is what the variable will be set to.
Name | Type | Default value | Cheat | Usage |
---|---|---|---|---|
cheats |
Number | 0 |
No (by default) | Enables cheats if set to 1 |
scale |
Number | 2 |
No | Scales the window |
fullscreen |
Number | 0 |
No | Fullscreens window if set to 1 , or else it goes to windowed mode |
volume |
Number | 1 |
No | Global game volume from 0-1 |
fps |
Number | 60 |
Yes | Sets the frames per seconds |
showfps |
Number | 0 |
No | Overlays FPS if set to 1 |
showcollision |
Number | 0 |
Yes | Overlays collision of all on-screen entities if set to 1 |
showentitycount |
Number | 0 |
Yes | Overlays entity count if set to 1 |
infinitelives |
Number | 0 |
Yes | Enables infinite lives if set to 1 |
lives |
Number | 2 (gets set to 3 if on easy mode) |
Yes | Number of lives |
etanks |
Number | 0 |
Yes | Number of Energy Tanks in possession |
wtanks |
Number | 0 |
Yes | Number of Weapon Tanks in possession |
diff |
String | normal |
Yes | Sets difficulty (Example: easy , normal , hard ) |
inv |
Number | 0 |
Yes | Enables invincibility if set to 1 |
noclip |
Number | 0 |
Yes | Enables no-clip mode if set to 1 |