SSH Productions: Module documentation for MultiResponse.zip

Module: MultiResponse 1.2, by SSH

Give multiple responses to the same event, easily

Download MultiResponse 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

Makes multiple responses to an interaction easy to script

Dependencies

AGS 2.71 or later

Functions

Multi.Disp(String responses)

Does a Display of the next response in the seuqence given. Responses are

separated by the ">" character. On reaching the last response, will

repeat it indefinately. Returns the position of the response given (starts

from 1)

Multi.Response(String responses)

An alias for Multi.Disp, for backwards compatibility with v1.0

Multi.Say(String responses)

As for Multi.Disp, but uses player.Say to show the message

Multi.SRespond(String responses)

Returns the string that would be Display-ed by Multi.Disp, so that

the user can do what they like with it. The position that would

normally be returned in Multi.Disp is instead set in Multi.response

Multi.SLoop(String responses)

As with Multi.SRespond, but automatically loops back to the first

response after the last one is said

Multi.SRandom(String responses)

As with Multi.SRespond, but chooses a response at Random

Multi.Reset(String responses)

Resets the count of the given responses string to the beginning

Configuration

The MULTIR_DELIMITER #define below sets which character is used as a

response delimiter, usually ">".

MULTIR_HASHSIZE sets the number of strings used to keep responses in

there is probably little point in changing this, as the hashing

function is pretty simple and will not benefit greatly froma larger table than

the default 100

Example

 // Display each response in turn until the last one, which repeats:
 Multi.Respond("I can count>1>2>3>Done!");
 // Display each response in turn, starting again once all responses used
 Display(Multi.SLoop("Ready>Steady>Go"));

Caveats

Could get reallly slow when you have a lot, maybe

Revision History

21 Aug 06: v1.0 First release of MultiResponse module

25 Aug 06: v1.1 Added more options and hashtable

12 May 08: v1.2 Added extender functions

Licence

MultiResponse 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.