Difference between revisions of "LoL Event handling"

From Wikiid
Jump to: navigation, search
(New page: '''Events'' are sent to Java plugins that desire some form of continual or intermittant updates. Events are generated either by the core game code ("built-in events") or by other plugins (...)
 
(No difference)

Latest revision as of 22:39, 23 October 2007

'Events are sent to Java plugins that desire some form of continual or intermittant updates. Events are generated either by the core game code ("built-in events") or by other plugins ("Java triggered events").

Built-in Events

These events are generated by the core game package and any plugin may use 'wantEvent' to cause one of their methods to be called when the event happens.

FirstFrame 
This event happens once and once only - on the very first frame of the actual game. Prior to that time, some models, and other plugins may not yet be loaded so it is illegal to do things like collision detection before the FirstFrame event has happened. Hence it is common to do at least some model initialisation in the FirstFrame event rather than in the plugins' constructor function.
NextFrame 
This event happens at the start of every single frame.
Keystroke 
This event occurs every time a key on the keyboard is pushed down. The event handler (as named in 'wantEvent') must take a single char parameter - which is the ASCII key that was struck.
MouseClick 
This event occurs every time a mouse-button is clicked down. The event handler (as named in 'wantEvent') must take a single char parameter which is either the letter 'L', 'M' or 'R' depending on whether it was the left, middle or right button of the mouse that was clicked.
Joystick0/Joystick1 
These events occur whenever a button is pressed on the specified joystick. The event handler (as named in 'wantEvent') must take a single char parameter - which is 'A' for the first button, 'B' for the second and so forth. The actual labelling of buttons on the physical joystick does not always match this scheme - so pressing the button labelled 'A' may or may not send an 'A' to the event handler. There is a wide variety of joystick labelling schemes which makes the selection of which button does which thing a tricky matter. Trial and error is recommended!

Java triggered events

These events are created inside one Java plugin and will be recieved by every other Java plugin that corresponds to a model that meets the criteria set in the event call. It is possible to send events to all other plugins, to only those within a certain range, or to those that fall within a certain angle of the front of this model.

As far as recieving those events, there is no difference between a Java event and a built-in event.


Wikiid Pages relating to Lemur of Lima (edit)
Lemur of Lima - Main page
Lemur of Lima - Controls
Lemur of Lima - Levels :
List of Levels, Level design, Screen shots, Models
Lemur of Lima - Java Plugins :
Java plugin API, Event handling, Flags, GameInterface API , Alphabetical Index
Lemur of Lima - Source Code Documentation :
Initialisation, Main Loop, gameTools


Wikiid Pages relating to gameTools (edit)
gameTools - Main page
gameTools - Support Tools :
plb_to_ac3d, mklevel, mktile, mktree, tiled, autogen_java, mk3dgallery
gameTools - File Formats :
title_screen.rgb, ultimate.xml, material.xml, decoration.xml, physics.xml
tiled.xml, tiled_autotiles.xml, Level files, Tile naming scheme, PLB files
gameTools - Source Code :
Game functions: gameCamera, gameClock, gameChecksum/gameHashTable, gameHTTP,
gameIsect, gameJoystick, gameParticleManager, gameScreen/gameMouse,
gameSky, gameStarter, gameStrokeFont, gameUtils
Material database: MatList/MatEntry
Tile map handling: TileObject/MapFlag/MapEntry/Map
Java Interfacing: JavaLink
Image file loading: liImage/liImageFactory
3D Model file loading: loadPLB, PLB exporter
Physics: Sabot, Bullet, gameTools - Use with Blender, PLB exporter
Object management: Object