# ShiftContents

Objects
Contents
5.1 OC
bool
bool shift_back If `true`, objects will be resorted backwards.
id target_id ID of the object type to be in front after the shift. If this parameter is specified, no call to ControlContents will be made. The object will be selected directly and without the selection sound. In this way you can overload the contents switching in ControlContents and add your own sounds or special events.
bool no_calls If `true`, calls to ControlContents and Selection will be made.
Resorts the contained objects so 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 `false`, 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 `false`, 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.
ScrollContents
Sven2
2002-04