I've been using this cus it saves trying to find these bits and bobs in lots of different scripts. If you have anything to add please do, it was edited in notion because it supports code blocks.

Thank you to Lugia19 for this intro bit.

(making the site look nice cus why not :D, and its still kind of in progress!!! - elitesnake2424)

Icepick Notes:

Enable developer mode under "Settings" in icepick. This will give you a console where you can easily input commands and monitor the output.

Screenshot 2024-01-16 005446.png

You can use the command print("Your text here") to log anything to console. Be warned that if you want to put in say the value of an integer variable, you need to do variable.tostring() to add it.

String concatenation is done via +, so like-print("The value of X is:" + x.tostring())

Most Useful Command:

The command reload_mods is your friend. This allows you to make changes to your mod and reload it on the fly, without restarting the game. Note that some changes won't show up, such as kb_act.lst changes.

If you have some questions about squirrel's formatting rules as a language, use http://www.squirrel-lang.org/mainsite/squirreldoc/reference/index.html

How to use Icepick instead of doing VPK Modding:

Basically, within the folder of your mod you can place .nut/.gnut/.set/.txt files (basically any file that's just text). If this file is in the same spot in the directory tree as an existing file contained within a VPK, then it will replace it once the game starts.

For example if I wanted to replace, say, _remote_functions_sp.gnut, I would have to place it under [mod folder]\scripts\vscripts\

It's also possible to add wholly new files. If you want to add a custom script file, you need to add it to the CustomScripts section of your mod.json

Speaking of which, here's an example of a mod.json:

{
    "ApiId" : "freeze", //Can be anything since the site is gone
		"Name" : "NPC Freeze",    
		"Description" : "Adds a toggle to freeze NPCs",    
		"Authors" : [        "lugia19"    ],    
		"Contacts" : [        "[email protected]"    ],    
		"CustomScripts": [ //This is where the custom scripts are listed.
		  {
            "Path": "NPC_freeze.nut",
            //The path to the file, starting from vscripts. For example, the full path to this file is actually "lugia19.NPCfreeze\\scripts\\vscripts\\NPC_freeze.nut"
            "RunOn": "SERVER || CLIENT",
		        //This is the context in which the file runs/where the functions this file lists as global are available. Contexts are explained below.
            "ClientCallback": "NPCFreezeInit",
					   //These are the functions that are run as soon as the level loads - they're used to set up stuff like custom keybinds, etc.
            "ServerCallback": "NPCFreezeInit"
					    //There MUST be a callback, even if it's a completely empty function that does nothing.
		  },
	    {
            //This is just an example of how to list multiple custom scripts.
            "Path": "NPC_freeze2.nut",
            "RunOn": "SERVER || CLIENT",
            "ClientCallback": "NPCFreezeInit",
            "ServerCallback": "NPCFreezeInit"
       },
    ]
}

Squirrel Notes:

Server/Client contexts: The game has two main contexts (not including UI) in which it can run squirrel code - server and client.

Tons of functions the game has are limited to one of these two contexts. For example, if a filename starts with cl_, that means it only runs in the client context, and its functions are only available in the client context.