Behaviours 4: Great Groups!
Wouldn't it be great if you could create a behavior and assign it to all creratures of the same tipe? Like, make ALL deer run? Well, you can do that in Terasology using Groups! Among other things, a group can make all creatures of a certain type to behave in the same manner - what we call "group behavior".
The objective of this task is to get you familiarized with the usage of group behaviors. At the end of this task, you will have learned how to assign a behavior to a group of creatures.
Requirements
You must fork the module BehaviorsBasic, clone the fork under Terasology/modules, and modify the existing InitialBehaviorSystem
so that when the player executes the command assignGroupBehavior
in the in-game console, the creatures belonging to a specific group are assigned the behavior previously created by you.
Acceptance Criteria
You must submit a PR compliant to the task requirements. The submission will be verified as follows:
- Two creatures belonging to the same group will be spawned using the in-game console;
- The command
assignGroupBehavior
will be executed. - All creatures belonging to the group must be assigned the behavior previously created by the student.
Resources & References (Where to Start)
- To assign behaviors to creatures, check our tutorial. Also, check modules that use behaviors extensively, such as the WildAnimals module. For Groups, check our Group wiki page and the module WildAnimalsMadness.