Book Image

Mastering CryENGINE

By : Michelle Martin
Book Image

Mastering CryENGINE

By: Michelle Martin

Overview of this book

Table of Contents (17 chapters)
Mastering CryENGINE
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Lua-based entities


Most entities you can place in CryENGINE Sandbox are based on the Lua script. This means these entities have a script proxy attached to them. This script proxy provides you access to a Lua table that contains the entity information and various functions. These Lua tables let you add new properties or functions to an entity.

Creating a new Lua script entity is easy and can be done within a few minutes without recompiling any code.

Creating a new Lua-based entity

Only a few steps are necessary to create a new Lua script entity. Firstly, an entity definition file, a so-called .ent file, has to be created. This file registers the Lua entity with the engine and points to a script that will be used. The entity definition files are placed in the ../Game/Entities/.. folder.

Let's create a new entity by first creating an .ent file with the name Testy.ent and place it in the ../Game/Entities/..folder. For our example, we will just call our entity Testy, but you can change the entity...