r3-custom-code/README.md

1.1 KiB

#R3 Custom Code

Almost every entity you create will have some 'Custom Code' component.

Custom Code components have a property which define the WHEN they get executed ('ex. on entity_loaded' event), and also the WHAT happens.

They are created explicitly in the editor and the code can be modified 'on the fly' using the editor.

Everytime you save a custom code component, the R3 api will create a GIT commit and push to this repository, to a javascript file which has exactly the same ID as the custom code component.

This is useful in case you accidentally overwrite the custom code component with some bad code or you simply want to investigate your code components from a more convenient location such as github.

Every time you save an entity, and this entity has a custom code component, it will 'PUSH' the current branch to the remote.

So in short, from the editor, if you select the custom code component and hit 'save' :

  • commit to this repository

if you select the entity which happens to have a custom code component and hit 'save' :

  • commit to this repository and push to remote