Skip to content
2767mr edited this page Mar 7, 2020 · 6 revisions

Definition layout

The file is broken down into two different sections: entries and tree.

Entries

This is a JSON object.
The keys are the same as the object/var you are referencing.
The value is in the format of:

  • type:
    • object:
      • contains other definitions
    • member:
      • contains the definition of a single var
  • name:
    • The name that will be used to reference this object/var
  • members:
    • Only in type: object
    • Array of definitions
  • parent:
    • Only in type: member
    • Path of target definition's parent
  • refType:
    • Only in type: member
    • var:
      • Static link; will not be updated if original gets changed
    • ref:
      • Dynamic link; a function that returns the current value
    • raw:
      • Raw value; does not actually reference code
  • compiled:
    • Only in type: member
    • Object that contains how to find the value in CC's code

compiled layout

  • type:
    • fixed:
      • unused
    • select:
      • iterates all AST nodes and checks if the from condition is matched
  • pattern:
    • if type: select it contains the child of the matched AST node that contains the target value
  • from:
    • Only in type: select
    • contains a condition that every AST node is matched against
    • type:
      • The type of the node as defined in the AST
    • values:
      • Array of subconditions
      • name:
        • The child of the current AST node which value is compared
      • value:
        • The value nameis matched against
      • type:
        • Either dynamic or not existent
        • Defines if value depends on other definitions

Adding your own definition

Adding you own definition is not easy and requires some knowledge of programming and Javascript ASTs. If you still want to do it you can follow these steps:

  1. Find your definition in CC's source code
    • For example if you want to add cc.ig.eventsto the definitions you have find ig.pa (v0.9.5-5)
  2. Look for unique non-obfuscated codes/values/strings nearby or in the same block
    • You can easily recognize non-obfuscated values by they meaningful(aGh is not, SET_TELEPORT_TIME is)
    • Strings are always non-obfuscated
    • You can use CTRL + f to check their uniqueness
    • In this example I chose CHANGE_PLAYER_HP
  3. Put it into CCDefedit.
    This software simplifies finding, validating, and adding definitions.
Clone this wiki locally