Suspended food items 

Is there an easy way to suspend food items in the air? (so if you create the item with a height of '1', it just stays there rather than falling to the ground)
Thanks!

Forums: 
Maciej Komosinski's picture

You can disable mechanical simulation per-group. If using the "standard" experiment definition, see settings for the group named "Food" (e.g. click twice on the "Food" label in the "Groups" window). Then clear the "Body simulation" checkbox, and then all newly added food items will not be simulated (gravity will not affect them).

Regarding setting height, see the standard.expdef file in the scripts directory. The addfood() function is called when a new food item is added. It revives one food item in group #1 (this is the "Food" group). Then, the onBorn() function is called, which has the "else..." section that handles initialization of energy for all food items. You could add a Creature.moveAbs() function call to move the food item as you wish (see also the place_randomly() function in standard_placement.inc).

Once you modify a script, you have to restart Framsticks or click the "Reload experiment definition" button.

Thanks! seems to work perfectly...