CAOS DOES NOT SUPPORT IN-LINE COMMENTS!!! IT SOMETIMES LOOKS LIKE IT DOES, BUT IT DOESN'T!!! PUT ALL YOUR COMMENTS ON NEW LINES!!! ARGH

DO THIS:

* pain is not on the top of my list of things i enjoy
addv va00 va04

NEVER EVER THIS:

addv va00 va04 * i love dealing with heisenbugs forever

 


Don't forget to disable autokill if it's on (ctrl-shift-w ctrl-shift-a). If it's on it'll say it is in the window title.

:)

...:^)

 


GSUB and SUBR work just fine outside of object scripts.


 

You can force a run of the timer script (or any other) with 'mesg writ hots 9'.


Ject will ruin your day given the chance: JECT returns an 'OK' even if you give it a cos file that doesn't exist, so beware typos etc. a good way to make sure it injected is

rtar 1 1 95 snde "chwp"

(1 1 95 is the pointer. rtar randomly targets an agent of the classifier (in this case, there SHOULD only be one, since it's the pointer.) Grep the bootstrap for this string for lots of fun!)

obviously take this out if you'll be auto-running the script or using it for anything else besides debugging


Edos drop-and-drag order: Edos seems to import selections in reverse order, at least on OSX. AKA if you have 1.png, 2.png, 3.png selected and shown in that order in finder, it will import 3.png as frame 0, 2.png as frame 1, 1.png as frame 3. Just sort by reverse name in finder. I think date is part of it too. still researching


Working on scripts, but also making new worlds: To keep around cos files in bootstrap but NOT have them auto-inject into newly made worlds, end them with ".cosp" or something else weird, like "myproject.ohgod". Just not '.cos'. JECT doesn't care about the extensions of the files you give it/doesn't try to add one for you like some other commands do. I have vim set up to recognize '.cosp' as something it should apply the caos syntax file to, so maybe a good reason to keep consistent.


Fun with bitmasks: ATTR Attribute flags are a 12-bit bitfield (probably 16 bits). To prove, start putting 1, 11, 1111, 1111111 etc. up throug 12 into a binary to decimal converter and see what you get. BHVR, defining possible interactions, is 6 bits (probably an 8 bit field overall). Try this knowledge out with the bit-level math commands.


Brutal pause: Forcing a non-breaking error inside an object script is a good way to get the engine to 'pause' to actual 0% cpu use (instead of the actual game pause which still runs music and tons of other stuff) without enabling debug mode and causing that mess.

new: simp 1 1 56565 "blank" 1 0 0
scrp 1 1 56565 10
    mvsf 9000 9000
    kill targ

You may have to modify if you have a room at 9000,9000, ofc.


Load order: Bootstrap run order is alphabetical. Take advantage of this to make your own patches.