SSH Productions: Module documentation for Idle.zip

Module: Idle 1.02, by SSH

Allows multiple idle animations

Download Idle as a zip file

Author

Andrew MacCormack (SSH)

Please use the messaging function on the AGS forums to contact

me about problems with this module

Abstract

Allows multiple idle animations, and in specified loops

Dependencies

AGS 2.71 or later

Functions

Idle.SetDelay(Character *cc, int delay)

Sets the delay before the idle animation for the specified character.

Specifying a delay of 0 makes the idle animation run continuously when

not moving or animating, -1 makes all idle animations stop for that

character.

Idle.Add(Character *cc, int view, optional int loop, optional int frame_delay, optional bool forwards);

Adds a new potential idle animation for the specified character. If just a

view is given, the idle animation will use the current loop whenthe idle

animation activates, frame_delay defaults to character's animation speed, and

the direction defaults to forwards, or pass false for backwards.

Idle.Remove(Character *cc, int view, optional int loop, optional int frame_delay, optional bool forwards);

Removes the idle animation with the given arguments from the list of possible

animations for that character.

Idle.RemoveAll(Character *cc);

Removes all idle aniamtions currently set up for the specified character.

Idle.SetRandom(Character *cc);

Set that character to choose idle animations randomly

Idle.SetSequential(Character *cc);

Set that character to choose idle animations in the order added (default)

Configuration

By default, the idle countdowns and animations stop during blocking scripts,

such as cutscenes. However, if you want them to carry on, change the

#define of Idle_Rep_Ex from repeatedly_execute to repeatedly_execute_always

Example

 function game_start() {
   Idle.SetDelay(player, 300);
   Idle.Add(player, SCRATCHNOSE);
   Idle.Add(player, DRUMFINGERS);
 	Idle.Add(player, DANCE, 0); // Do long dancing anim in loop 0 of view Dance
   Idle.SetRandom(player); // Make player's idle anims happen randomly
 }

Caveats

Needs more extensive testing.

Revision History

2 Oct 06: v1.0 First release of MultiResponse module

5 Oct 06: v1.01 Now removed debug lines... D'oh!

16 Feb 07: v1.02 Fixed some bugs spotted by Sadistyk

Licence

Idle AGS script module

Copyright (C) 2006 Andrew MacCormack

This module is licenced under the Creative Commons Attribution Share-alike

licence, (see http://creativecommons.org/licenses/by-sa/2.5/scotland/ )

which basically means do what you like as long as you credit me and don't

start selling modified copies of this module.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR

IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,

FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL

THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER

LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER

DEALINGS IN THE SOFTWARE.

In addition to the licences mentioned in the modules themselves, you may choose to use the following creative commons licence if you prefer for all AGS modules and open source code resources on my site.

Creative Commons License
This work is licenced under a Creative Commons Licence.