CExpression
What is CExpression?
CExpression is a format that stores an expression's identifiers, flags, and parameters.
Structure
| Size | Type | Name | Description |
|---|---|---|---|
| 2 | Int16 | Object Type | The object type, also used as an identifier for expressions |
| 2 | Int16 | Expression Id | The main identifier for the expression, |
The remaining data only exists if Object Type and Expresion Id are not 0
| Size | Type | Name | Description |
|---|---|---|---|
| 2 | UInt16 | Data Size | The size of the data, including itself and the Identifiers |
This data only exists if Object Type > 0 or Object Type = -7
| Size | Type | Name | Description |
|---|---|---|---|
| 2 | UInt16 | Object Info | The referenced object info related to this expression, if Object Type = -7 this is used as a Player ID |
| 2 | UInt16 | Object Info List | Unsure of usage, possibly Global Event related? |
Expression Definitions
This is a list of expressions unrelated to objects (Object Type < 0)
For a list of expressions per object, NOT YET IMPLEMENTED
| Object Type | Expression Id | Name | String | Parameters |
|---|---|---|---|---|
| -1 | -3 | VIRGULE | ,␣ | |
| -1 | -2 | PARENTH2 | ( | |
| -1 | -1 | PARENTH1 | ) | |
| -1 | 0 | LONG | Value | |
| -1 | 1 | RANDOM | Random( | 1 |
| -1 | 2 | VARGLO | Global Value( | 1 |
| -1 | 3 | STRING | "Value" | |
| -1 | 4 | STR | Str$( | 1 |
| -1 | 5 | VAL | Val( | 1 |
| -1 | 6 | DRIVE | Appdrive$ | |
| -1 | 7 | DIRECTORY | Appdir$ | |
| -1 | 8 | PATH | Apppath$ | |
| -1 | 9 | APPNAME | Appname$ | |
| -1 | 10 | SIN | Sin( | 1 |
| -1 | 11 | COS | Cos( | 1 |
| -1 | 12 | TAN | Tan( | 1 |
| -1 | 13 | SQR | Sqr( | 1 |
| -1 | 14 | LOG | Log( | 1 |
| -1 | 15 | LN | Ln( | 1 |
| -1 | 16 | HEX | Hex$( | 1 |
| -1 | 17 | BIN | Bin$( | 1 |
| -1 | 18 | EXP | Exp( | 1 |
| -1 | 19 | LEFT | Left$( | 2 |
| -1 | 20 | RIGHT | Right$( | 2 |
| -1 | 21 | MID | Mid$( | 3 |
| -1 | 22 | LEN | Len( | 1 |
| -1 | 23 | DOUBLE | Value | |
| -1 | 24 | VARGLONAMED | Global Value Name | |
| -1 | 25 | ENTERSTRINGHERE | >Enter string here< | |
| -1 | 26 | ENTERVALUEHERE | >Enter number here< | |
| -1 | 27 | FLOAT | Value | |
| -1 | 28 | INT | Int( | 1 |
| -1 | 29 | ABS | Abs( | 1 |
| -1 | 30 | CEIL | Ceil( | 1 |
| -1 | 31 | FLOOR | Floor( | 1 |
| -1 | 32 | ACOS | ACos( | 1 |
| -1 | 33 | ASIN | ASin( | 1 |
| -1 | 34 | ATAN | ATan( | 1 |
| -1 | 35 | NOT | NOT( | 1 |
| -1 | 36 | NDROPFILES | NDropped | |
| -1 | 37 | DROPFILE | Dropped$( | 1 |
| -1 | 38 | GETCOMMANDLINE | CommandLine$ | |
| -1 | 39 | GETCOMMANDITEM | CommandItem$( | 1 |
| -1 | 40 | MIN | Min( | 2 |
| -1 | 41 | MAX | Max( | 2 |
| -1 | 42 | GETRGB | GetRGB( | 3 |
| -1 | 43 | GETRED | GetRed( | 1 |
| -1 | 44 | GETGREEN | GetGreen( | 1 |
| -1 | 45 | GETBLUE | GetBlue( | 1 |
| -1 | 46 | LOOPINDEX | LoopIndex( | 1 |
| -1 | 47 | NEWLINE | NewLine$ | |
| -1 | 48 | ROUND | Round( | 1 |
| -1 | 49 | STRINGGLO | Global String( | 1 |
| -1 | 50 | STRINGGLONAMED | Global String Name | |
| -1 | 51 | LOWER | Lower$( | 1 |
| -1 | 52 | UPPER | Upper$( | 1 |
| -1 | 53 | FIND | Find( | 3 |
| -1 | 54 | REVERSEFIND | ReverseFind( | 3 |
| -1 | 55 | GETCLIPBOARD | ClipText$ | |
| -1 | 56 | TEMPPATH | AppTempPath$ | |
| -1 | 57 | BINFILETEMPNAME | BinFileTempName$( | 1 |
| -1 | 58 | FLOATSTR | FloatToString$( | 3 |
| -1 | 59 | ATAN2 | ATan2( | 2 |
| -1 | 60 | ZERO | 0 | |
| -1 | 61 | EMPTY | "" | |
| -1 | 62 | DISTANCE | Distance( | 4 |
| -1 | 63 | ANGLE | VAngle( | 2 |
| -1 | 64 | RANGE | Range( | 3 |
| -1 | 65 | RANDOMRANGE | RRandom( | 2 |
| -1 | 66 | |||
| -1 | 67 | RUNTIMENAME | RuntimeName$ | |
| -1 | 68 | STRINGREPLACE | ReplaceString$( | 3 |
| -1 | 69 | SIGN | Sign( | 1 |
| -1 | 70 | LERP | Lerp( | 3 |
| -1 | 71 | INVLERP | InvLerp( | 3 |
| -2 | 0 | GETSAMPLEMAINVOL | SampleMainVolume | |
| -2 | 1 | GETSAMPLEVOL | SampleVolume( | 1 |
| -2 | 2 | GETCHANNELVOL | ChannelVolume( | 1 |
| -2 | 3 | GETSAMPLEMAINPAN | SampleMainPan | |
| -2 | 4 | GETSAMPLEPAN | SamplePan( | 1 |
| -2 | 5 | GETCHANNELPAN | ChannelPan( | 1 |
| -2 | 6 | GETSAMPLEPOS | SamplePosition( | 1 |
| -2 | 7 | GETCHANNELPOS | ChannelPosition( | 1 |
| -2 | 8 | GETSAMPLEDUR | SampleDuration( | 1 |
| -2 | 9 | GETCHANNELDUR | ChannelDuration( | 1 |
| -2 | 10 | GETSAMPLEFREQ | SampleFreq( | 1 |
| -2 | 11 | GETCHANNELFREQ | ChannelFreq( | 1 |
| -2 | 12 | GETCHANNELSNDNAME | ChannelSampleName$( | 1 |
| -3 | 0 | GAMLEVEL | frame | |
| -3 | 1 | GAMNPLAYER | players | |
| -3 | 2 | PLAYXLEFT | X Left Frame | |
| -3 | 3 | PLAYXRIGHT | X Right Frame | |
| -3 | 4 | PLAYYTOP | Y Top Frame | |
| -3 | 5 | PLAYYBOTTOM | Y Bottom Frame | |
| -3 | 6 | PLAYWIDTH | Frame Width | |
| -3 | 7 | PLAYHEIGHT | Frame Height | |
| -3 | 8 | GAMLEVELNEW | frame | |
| -3 | 9 | GETCOLLISIONMASK | CollisionMask( | 2 |
| -3 | 10 | FRAMERATE | FrameRate | |
| -3 | 11 | GETVIRTUALWIDTH | VirtualWidth | |
| -3 | 12 | GETVIRTUALHEIGHT | VirtualHeight | |
| -3 | 13 | GETFRAMEBKDCOLOR | FrameBkdColor | |
| -3 | 14 | GRAPHICMODE | DisplayMode | |
| -3 | 15 | PIXELSHADERVERSION | PixelShaderVersion | |
| -3 | 16 | FRAMEALPHACOEF | FrameAlphaCoef | |
| -3 | 17 | FRAMERGBCOEF | FrameRGBCoef | |
| -3 | 18 | FRAMEEFFECTPARAM | FrameEffectParam( | 1 |
| -3 | 19 | DPIScale | ||
| -4 | 0 | TIMVALUE | timer | |
| -4 | 1 | TIMCENT | hundreds | |
| -4 | 2 | TIMSECONDS | seconds | |
| -4 | 3 | TIMHOURS | hours | |
| -4 | 4 | TIMMINITS | minutes | |
| -4 | 5 | EVENTAFTER | eventindex | |
| -5 | 0 | CRENUMBERALL | Total Objects | |
| -5 | 1 | LASTFIXEDVALUE | Last fixed value | |
| -6 | 0 | XMOUSE | XMouse | |
| -6 | 1 | YMOUSE | YMouse | |
| -6 | 2 | MOUSEWHEELDELTA | WheelDelta | |
| -7 | 0 | PLASCORE | score("Player (ObjectInfo + 1)") | |
| -7 | 1 | PLALIVES | lives("Player (ObjectInfo + 1)") | |
| -7 | 2 | GETINPUT | input("Player (ObjectInfo + 1)") | |
| -7 | 3 | GETINPUTKEY | key$("Player (ObjectInfo + 1)",␣ | 1 |
| -7 | 4 | GETPLAYERNAME | playername$("Player (ObjectInfo + 1)") |