Development Forum |
|
CAOS Highlighter for ConTEXT | |
|
felinorn
|
11/14/2010 | |
Yes, I'm trying to learn coding in CAOS. I want to do it in ConTEXT, but there's no highlighter for the CAOS language that I need to get the most out of ConTEXT.
Essentially, ConTEXT is a text editor that when used with a Highlighter, it makes it easier to read code by coloring the text to see commands, variables, comments, etc. However, there is no .chl for CAOS. What if we created an exclusive highlighter for ConTEXT to read CAOS. Perhaps that development utility will have us use the editor more often for Agent Programming.
If you want to contribute to the CAOS in ConTEXT Project, your ideas and opinions will be greatly acknowledged.
Creatures, and Civilization? I'll pay good money to have Norns form Nations and Cultures! |
Geek Ettin
eprillios
|
11/14/2010 | |
I believe that CAOS uses the same structure as C#.
I always use the 'C#' highlighting in Notepad++. I didn't notice any problems with the output of it.
EDIT: I've discovered that 'Python' also works fine, maybe even better. But after all, any special highlighter would be nice.
Geek Ettin's Lab (New!)
Bill Gates: "Be nice to nerds. Chances are you'll end up working for one."
|
Prodigal Sock
Ghosthande
|
11/14/2010 | |
It looks like most of the code is just black to me. Readable sure, but the coloring in the CAOS program is a lot nicer.
What is it about this program that caught your fancy, felinorn? And what system is it for? From what I understand the CAOS tool only works on Windows--while I still think the CAOS tool is still irreplacable, if this program works on other systems, I'd be very interested.
|
felinorn
|
11/14/2010 | |
Actually, a .chl can be made using notepad. You just have to know how it works. If anybody can find a documentation of the CAOS Syntax, I can get started on making a highlighter for ConTEXT. However, unlike Linux operation, on Windows, I have to inject the .cos manually.
Your idea of substitution might work Lembam, the problem is, I don't think the code is divided line-by-line. It maybe a one-lined string of text. It's not arranged like 68000 assembly, at least I don't think.
Creatures, and Civilization? I'll pay good money to have Norns form Nations and Cultures! |
Prodigal Sock
Ghosthande
|
11/14/2010 | |
A documentation as in, the CAOS documentation that comes in the game? It doesn't actually show what colors are used by the CAOS tool, but it lists what category different commands, variables etc. fall under, and the structure of certain comands. Seems like a good starting point.
|
felinorn
|
11/15/2010 | |
Ah, the CAOS documentation for Creatures Engine 2.286 (netbabel 148 ). Don't worry, I got it in html. format. I'm going to upload some of my work so far, so that if you want edit or add-on to the highlighter, you may dump your code in for comparison.
Edit: Finally, a working highlighter. Copy the code into Notepad and save it as a .chl. Be sure to quote it to force save it as that file extension. You will need ConTEXT to use it. Get it from here.
//////////////////////////////////////////////////////////////////////////////
//
// Creatures Agent Object Scripting syntax highlighter written by felinorn
//
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// language name
Language: Creatures Agent Object Scripting
//////////////////////////////////////////////////////////////////////////////
// put whatever you want here, short description, author name, email address..
Description: Creatures Agent Object Scripting syntax highlighter
Written by: Nicholas Manuel (felinorn)
e-mail: nmsputnick559@gmail.com
Keywords1 = CAOS
Keywords2 = Creatures 3 Agent Script
Keywords3 = Creatures Docking Station Agent Script
Keywords4 = Creatures Engine 2.286 (netbabel 148)
//////////////////////////////////////////////////////////////////////////////
// default file filter
// note: if more than one extension is associated, eg:
// C/C++ files (*.c,*.cpp,*.h,*.hpp)|*.c;*.cpp;*.h;*.hpp
Filter: COS File (*.cos) |*.cos
//////////////////////////////////////////////////////////////////////////////
// help file which will be invoked when F1 is pressed
HelpFile:
//////////////////////////////////////////////////////////////////////////////
// language case sensitivity
// 0 - no
// 1 - yes
CaseSensitive: 0
//////////////////////////////////////////////////////////////////////////////
// comment type: LineComment - comment to the EOL
// BlockCommentBeg - block comment begin, it could be
// multiline
// BlockCommentEnd - block comment end
//
// if there is more than one definition of line/beg/end comment string,
// you can separate it with spaces.
// for example, for pascal it would be:
// LineComment: //
// BlockCommentBeg: (* {
// BlockCommentEnd: *) }
LineComment: ;
BlockCommentBeg:
BlockCommentEnd:
//////////////////////////////////////////////////////////////////////////////
// identifier characters
// note: characters shouldn't be delimited, except arrays
// array of chars could be defined as from_char..to_char
IdentifierBegChars: a..z A..Z _%@.
IdentifierChars: a..z A..Z _ 0..9 ? +
//////////////////////////////////////////////////////////////////////////////
// numeric constants begin characters
// note: characters shouldn't be delimited, except arrays
// array of chars could be defined as from_char..to_char
// number always starts with 0..9 except when NumConstBeg
// defines other
NumConstBegChars: 0..9
//////////////////////////////////////////////////////////////////////////////
// numeric constants characters
// note: characters shouldn't be delimited, except arrays
// array of chars could be defined as from_char..to_char
// number always starts with 0..9 except when NumConstBeg
// defines other
NumConstChars: 0..9
//////////////////////////////////////////////////////////////////////////////
// escape character
EscapeChar:
//////////////////////////////////////////////////////////////////////////////
// keyword table
// note: delimited with spaces, lines could be wrapped
// you may divide keywords into five groups which can be
// highlighted differently
// CAOS commands
KeyWords1: absv addb adds addv adin ages alph altr andv anim anms appr apro bang bkgd boot born brmi brn cabn cabw cacl calc call cato cmra cmrp cmrt core dbg dcor dele delg delm deln delw divv dmap doca doif doin done dpas drop dsee econ elif else emit endi enum epas esee etch ever fade fcus file ftlo forf frat frel frmt frsh gait gene gids goto gpas grpl grpv hair help injr inst ject kill like line load lock loop ltcy mann mapd mapk mate mclr memx mesg midi modv mous mtoa mulv mvby mvft mvsf mvto namn negv new newc next nohh notv nude ordr orrv outs outv outx over pat plmd plmu quit rclr reaf repe reps retn rgam rotn rpas rtar save sayn scam scrx seta sets setv setz show slow snap sndc snde sndl sndq spas spnl star step stim stop stpc stpt strk subr subv sway tino tntw ttar ucln unlk untl urge velo vocb voic wait walk wear webb wtnt zoom
// CAOS conditional commands
KeyWords2: accg admp aero aslp attr avel base bhvr bkgd body buzz cabp cabv calg char chem clac clik dead dirn door drea driv elas face fdmp fric fvel gall hand hist imsk link loci meta mind mira mmsc motr net norn page part paus perm plne pose pray prop prt pswd ptxt puhl pupt pure rate rmsc rnge rtyp sdmp soul spin svel targ tick tint touc tran trck uncs varc vois volm wpau wrld zomb _cd_
// CAOS integer, float, string, and agent parameters
KeyWords3: abba acos addm addr agnt angl asin atan attn avar bkds bvar byit cabb cabl cabr cabt cage caos carr cata cati catx cmrx cmry code codf codg codp cods cos_ crea date dayt dbg# dbga decn dftx dfty disq down drv! eame eamn emid erid etik expr fall fltx flty fmly from ftoi fvwm game gamn gmap gnam gnus grap grid gtos heap hotp hots iitt innf inni innl inok ins# itof keyd limb loft lorp lowa maph mapw meta mloc modu mont mopx mopy movs movx movy mows msec mthx mthy mtoa mtoc mute name ncls npgs null nwld obst ooww orgf orgi orgn ovxx ownr pace paws pcls pntr pnxt posb posl posr post posx posy race rand read rean reaq relx rely rght rloc room rtif rtim scol sean seee seen sins sin_ snax sorc sorq spcs sqrt stof stoi strl subs tack tage tan_ tcor tick time tmvb tmvf tmvt torx tory totl twin type ufos uftx ufty unid uppa vaxx vecx vecy velx vely visi vmjr vmnr vois vtos wall wdth wild wnam wndb wndh wndl wndr wndt wndw wnti wolf wtik wuid year _it_ _p1_ _p2_ _up_
// CAOS sub strings
KeyWords4: agti agts asrt back butt clon comp coun cpro crag cros deps dmpb dmpd dmpl dmpn dmpt dull ejct erra evnt expo find finr fixd flsh fore foto frma frqh frql garb gend glob grph head hear host html iclo impo inew init injt iope itot izap jdel join krak make mon1 mon2 move netu oclo oflu onew oope otot ozap pass play poll prev prof rawe refr root ruso send setd setl setn sett shou shut sign simp stat tact test text tock ulin unik user utxt vari vhcl what whod whof whon whoz wipe writ wrt+ wvet
//////////////////////////////////////////////////////////////////////////////
// string delimiter: StringBegChar - string begin char
// StringEndChar - string end char
// MultilineStrings - enables multiline strings, as perl
// has it
StringBegChar: '
StringEndChar: '
MultilineStrings: 0
//////////////////////////////////////////////////////////////////////////////
// use preprocessor: 0 - no
// 1 - yes
// note: if yes, '#' and statements after it will be
// highlighted with Preprocessor defined colors
UsePreprocessor: 0
//////////////////////////////////////////////////////////////////////////////
// highlight line: 0 - no
// 1 - yes
// note: if yes, current line will be highlighted
CurrLineHighlighted: 1
//////////////////////////////////////////////////////////////////////////////
// colors
// note: first value is foreground, second is background color
// and third (optional) represents font attribute:
// B - bold
// I - italic
// U - underline
// S - strike out
// attributes can be combined: eg. B or BI
// as value, it could be used any standard windows color:
// clBlack, clMaroon, clGreen, clOlive, clNavy,
// clPurple, clTeal, clGray, clSilver, clRed, clLime,
// clYellow, clBlue, clFuchsia, clAqua, clLtGray,
// clDkGray, clWhite, clScrollBar, clBackground,
// clActiveCaption, clInactiveCaption, clMenu, clWindow,
// clWindowFrame, clMenuText, clWindowText, clCaptionText,
// clActiveBorder, clInactiveBorder, clAppWorkSpace,
// clHighlight, clHighlightText, clBtnFace, clBtnShadow,
// clGrayText, clBtnText, clInactiveCaptionText,
// clBtnHighlight, cl3DDkShadow, cl3DLight, clInfoText,
// clInfoBk
// as value, it could be used hex numeric constant too:
// $BBGGRR - BB: blue, GG: green, RR: red, eg: $FF6A00
SpaceCol: clWindowText clWindow
Keyword1Col: clNavy clWindow B
Keyword2Col: clPurple clWindow B
Keyword3Col: clGreen clWindow BI
Keyword4Col: $FF6A00 clWindow
IdentifierCol: clWindowText clWindow I
CommentCol: clGray clWindow I
NumberCol: clRed clWindow
StringCol: clMaroon clWindow
SymbolCol: clGray clWindow
PreprocessorCol: clBlue clWindow
SelectionCol: clWhite clNavy
CurrentLineCol: clBlack clYellow
OverrideTxtFgColor: 0
BlockAutoindent: 0
BlockBegStr:
BlockEndStr:
MatchedBracesCol: clWindowText clGray |
Creatures, and Civilization? I'll pay good money to have Norns form Nations and Cultures! |
Prime
|
11/19/2010 | |
Works great at highlighting. Good job felinorn! |
felinorn
|
11/19/2010 | |
I can't take all the credit. After all, I used Ambil's M68k Highlighter as the backbone of the project. But, thank you.
Oh, one last detail. Due to the nature of the code, there is a limitation. It mainly optimized for Creatures Engine 2.286, netbabel 148. You may need to modify the highlighter for the version you're using. Oh, and it's also preferred you make Creatures 3/DS Agents with that highlighter, than the other games (unless you count Creatures Adventures).
Creatures, and Civilization? I'll pay good money to have Norns form Nations and Cultures! |
Moe
|
11/19/2010 | |
I wonder if this can be done with a text editor that works on Macs, so that the Mac users of our community can at last have color coded CAOS editing. |
felinorn
|
11/19/2010 | |
That would be a challenge. Unfortunately, I'm more concerned with Windows intergrated operations for the Creatures Series. So, I can't help you there, sorry.
Creatures, and Civilization? I'll pay good money to have Norns form Nations and Cultures! |
|