Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Mastering CryENGINE
  • Table Of Contents Toc
Mastering CryENGINE

Mastering CryENGINE

By : Michelle Martin
4.8 (9)
close
close
Mastering CryENGINE

Mastering CryENGINE

4.8 (9)
By: Michelle Martin

Overview of this book

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

Using engine callbacks


The Lua entities are notified of system and entity events through the engine callback functions. These are optional functions within your Lua entity that will be called automatically. An example of this is the OnUsed() function, which is called when the player tries to use your entity.

There are a lot of Lua script callbacks defined in CryENGINE that allow you to work more efficiently with your scripts. We have used some of the basic engine callbacks, such as the following, in our example script:

  • OnReset

  • OnPropertyChange

  • OnInit

These three callbacks, for example, are used in almost every Lua entity and make your life a lot easier. OnReset, for example, is called automatically every time the script is reloaded, while OnPropertyChange is called whenever you change one of the entity's properties in Sandbox. The OnInit callback is triggered when the actual game is started or you jump into game mode in Sandbox. Utilizing these callbacks makes it very easy to set up and...

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Mastering CryENGINE
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon