Genetics‎ > ‎Gene Types‎ > ‎

change_focus Gene

The change_focus gene lets MyKaryotes change whatever their current focus is on. As you may recall, MyKaryotes can only focus on one object in their environment at a time, and this focus lets them carry out actions relevant to that focus.

The first and only argument to the change_focus gene dictates what the MyKaryote should change its focus to. Below is a table showing all of the possible strings for this argument.
 nearest_prey The MyKaryote changes its focus to the closest thing it considers prey.
 nearest_predatorThe MyKaryote changes its focus to the nearest thing it considers a predator.
 nearest_same_speciesThe MyKaryote changes its focus to the nearest member of the same species (as indicated by species name). 
 nearest_wallThe MyKaryote changes its focus to the nearest wall. This could be useful for things like detecting imminent collisions to avoid health loss, etc. 
 nearest_cellThe MyKaryote changes its focus to the closest cell, no matter what kind it is. 

Note that these focus changes will only be successful if an object of that type is within the cell's eyesight range attribute, as measured in pixels. If it can't find any, then the focus will be set to noone.

Example usage:
1 change_focus nearest_prey 0 0 0