Resorts the contained objects to the next object with a differing ID will be in front. The most common application for this command is inventory selection.
This command calls the function "ControlContents" in the container object which can be used to overload the selection process. If the function ControlContents does not exist in the container object or returns 0, the function "Selection" will be called in the newly selected inventory object. If the function Selection does not exist in the contained object or returns 0, the engine will play the "Grab" sound effect for the container object (default behaviour for inventory selection). See also
object scripts.
Notice: nowadays the function ShiftContents will also play the selection sound. To avoid double playback, object scripts should take this into consideration and not play their own selection sound or move the sound playback to the ControlContents function, as seen below.
protected func ControlSpecial()
{
[Inventarwechsel]
ShiftContents();
return(1);
}
Part of an object script. Moves the contents of an object on special key 1.
protected func ControlContents(idTarget)
{
if (!ShiftContents(0, 0, idTarget)) return(1);
return(1, Sound("Ding"));
}
Through this object script selecting a new inventory item will play a "Ding" sound.