EventListclasseventList.t[149], eventListItem.t[301]

An "event list." This is a general-purpose type of script that lets you define the scripted events separately from the Script object.

The script is driven by a list of values; each value represents one step of the script. Each value can be a single-quoted string, in which case the string is simply displayed; a function pointer, in which case the function is invoked without arguments; another Script object, in which case the object's doScript() method is invoked; a property pointer, in which case the property of 'self' (the EventList object) is invoked with no arguments; or nil, in which case nothing happens.

This base type of event list runs through the list once, in order, and then simply stops doing anything once we pass the last event.

class EventList :   Script

Superclass Tree   (in declaration order)

EventList
        Script
                object

Subclass Tree  

EventList
        CyclicEventList
        ExternalEventList
        RandomEventList
        ShuffledEventList
        StopEventList
        SyncEventList

Global Objects  

(none)

Summary of Properties  

curScriptState  eventList  eventListLen  resetEachCycle 

Summary of Methods  

addItem  advanceState  construct  doScript  doScriptEvent  resetList  scriptDone 

Inherited from Script :
getScriptState 

Properties  

curScriptStateOVERRIDDENeventList.t[166]

by default, start at the first list element

eventListeventList.t[153]
the list of events

eventListLeneventList.t[156]
cached length of the event list

resetEachCycleeventListItem.t[327]
Flag, do we want to reset the list each time we've run through all our items? By default we don't, but this might ba en appropriate place to call resetList() if we do want to call it. Note that this is in any case irrelevant on the base EventList class but may be relevant on some of its subclaases (CyclicEventList, RandomEventList and ShuffledEventList).

Methods  

addItem (item, prop)eventListItem.t[333]

Add an item to prop (usually eventList) property of this EventList, where prop should be supplied as a property pointer,

advanceState ( )eventList.t[159]
advance to the next state

construct (lst)eventList.t[150]
no description available

doScript ( )OVERRIDDENeventList.t[169]
process the next step of the script

doScriptEvent (evt)eventList.t[192]
carry out one script event

resetList ( )eventListItem.t[308]
Game code can call this method to remove all EventListItems that have been finished with (isDone = true) from the eventList of this EventList. This probably isn't necessary unless there are likely to be a large number of such items slowing down execution.

scriptDone ( )eventList.t[235]
Perform any end-of-script processing. By default, we advance the script to the next state.

Some scripts might want to override this. For example, a script could be driven entirely by some external timing; the state of a script could vary once per turn, for example, or could change each time an actor pushes a button. In these cases, invoking the script wouldn't affect the state of the event list, so the subclass would override scriptDone() so that it does nothing at all.

Adv3Lite Library Reference Manual
Generated on 01/03/2024 from adv3Lite version 1.6.2