Create Actor

From Game Editor

Jump to: navigation, search

Create Actor is both an event and a function, but the function is CreateActor. The event has some limitations, as it can't be combined with the function if creating its own actor type.

This event is pretty self explanatory as it is triggered by the creation of the actor. It is actor specific, so clones will not retrigger other clones create actor events. This event is usually used to set variables, such as HP. One limitation for Create Actor is the ability to use Create Actor for the same actor type. This is a protection as it would cause an infinite loop, choking gameEditor. It is possible to do this with Create Actor->Script Editor, but it will do nothing, overlooked by gameEditor.

For more advanced programmers, the Create Actor event for view can be helpful for declarations. It is guaranteed the first actor script run after start up. This way you can use view actor for initial creates, using calloc.

A common use of Create Actor would be, in combination with Script Editor, to set certain actor variables, such as HP, Ammo, DEF, and others. This example will use Create Actor -> Script Editor to set an enemy actor.

Enemy -> Create Actor -> Script Editor