The Terasology Foundation

Behaviours 4: Great Groups!

<- Previous Task Next Task ->

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)

Task tags

  • ai
  • java
  • json
  • animals
  • Terasology

Students who completed this task

nailorcn, HannahG, Kanonbell

Task type

  • code Code
  • web Design
close

2019