![]() |
![]() |
Work continues |
![]() |
![]() |
![]() |
![]() |
|||||
General Info Main Page Latest News Schedule What is it? About Matt About This Site Duke Enhancements Duke Insider More Information WW2GI Enhancements |
Events
Events allow the CON programmer to change the processing on an event. Events are defined in enhance.con Event blocks are started with 'onevent' and ended by 'endevent' So, onevent EVENT_INIT { } endevent Events are: EVENT_INITCalled when game is initialized, just after script is parsed. EVENT_ENTERLEVELCalled when a level is being entered EVENT_RESETWEAPONSCalled when player's weapons are reset. This happens when they enter a level, and each time they 'come to life' EVENT_RESETINVENTORYCalled when player's inventory is reset. EVENT_HOLSTERThe player has pressed the 'holster' key. Set 'RETURN' to zero to allow default processing (the default is to allow processing). You can also execute any code in the event handler (such as changing weapon flags, etc) EVENT_LOOKLEFTThe player hit the 'look left' key. Set 'RETURN' to zero to allow default processing EVENT_LOOKRIGHTThe player hit the 'look right' key. Set 'RETURN' to zero to allow default processing EVENT_SOARUPThe player hit the 'JUMP' key while the jetpack is active. Set 'RETURN' to zero to allow default processing EVENT_SOARDOWNThe player hit the 'Crouch' key while the jetpack is active. Set 'RETURN' to zero to allow default processing EVENT_CROUCHThe player hit the 'crouch' key. Set 'RETURN' to zero to allow default processing EVENT_JUMPThe player hit the 'Jump' key. Set 'RETURN' to zero to allow default processing EVENT_RETURNTOCENTERThe player hit the 'Return to center' key. Set 'RETURN' to zero to allow default processing EVENT_LOOKUPThe player hit the 'look up' key. Set 'RETURN' to zero to allow default processing EVENT_LOOKDOWNThe player hit the 'look down' key. Set 'RETURN' to zero to allow default processing EVENT_AIMUPThe player hit the 'aim up' key. Set 'RETURN' to zero to allow default processing EVENT_AIMDOWNThe player hit the 'aim down' key. Set 'RETURN' to zero to allow default processing EVENT_FIREThe player hit the 'Fire' key. 'WEAPON' is set to the weapon ID that is firing. So, onevent WEAPON_FIRE { ifvare WOKSLIKE PISTOL_WEAPON { ifvare PISTOLJAMMED 1 { setvar RETURN 1 // don't fire if jammed setvar PISTOLJAMMED 0 // unjam it for next time } } } endevent Set 'RETURN' to zero to allow default processing EVENT_CHANGEWEAPONThe player is changing weapons. The new weapon is in 'WEAPON' and 'WORKSLIKE' -1 means 'no weapon' There is no return value. EVENT_GETSHOTRANGECalled when the player is shooting. The current weapon is in 'WEAPON' and 'WORKSLIKE' Return the shot random distribution in 'ANGRANGE' and 'ZRANGE'. Default is '32', and '256'. Numbers must be a power of two. onevent EVENT_GETSHOTRANGE { addlogvar WORKSLIKE // log the current value (debugging) ifvare WORKSLIKE PISTOL_WEAPON { // dump the defaults...(debugging) addlogvar ANGRANGE addlogvar ZRANGE // set the values... setvar ANGRANGE 2 // very accurate setvar ZRANGE 16 } } endevent EVENT_GETAUTOAIMANGLECalled when the auto aim angle is desired for the weapon. Set 'AUTOAIMANGLE' to zero to disable auto-aim for the weapon. Default value for AUTOAIMANGLE is 48. onevent EVENT_GETAUTOAIMANGLE { // default is 48 ifvare WORKSLIKE PISTOL_WEAPON { setvar AUTOAIMANGLE 64 // a 'wider' auto-aim angle. } } endevent EVENT_GETLOADTILEGet the tile to display as background when starting a level. Set value into 'RETURN'. Default is LOADSCREEN (3281) EVENT_CHEATGETSTEROIDSPlayer has entered a cheat to get steroids. On entry, RETURN is set to default. EVENT_CHEATGETHEATPlayer has entered a cheat to get night vision. On entry, RETURN is set to default. EVENT_CHEATGETBOOTPlayer has entered a cheat to get inventory item. On entry, RETURN is set to default. EVENT_CHEATGETSHIELDPlayer has entered a cheat to get inventory item. On entry, RETURN is set to default. EVENT_CHEATGETSCUBAPlayer has entered a cheat to get inventory item. On entry, RETURN is set to default. EVENT_CHEATGETHOLODUKEPlayer has entered a cheat to get inventory item. On entry, RETURN is set to default. EVENT_CHEATGETJETPACKPlayer has entered a cheat to get inventory item. On entry, RETURN is set to default. EVENT_CHEATGETFIRSTAIDPlayer has entered a cheat to get inventory item. On entry, RETURN is set to default. EVENT_QUICKKICKPlayer has hit the button (key). On entry, RETURN is set to 0 Set RETURN to non-zero to prevent use of key. EVENT_INVENTORYPlayer has hit the button (key). On entry, RETURN is set to 0 Set RETURN to non-zero to prevent use of key. EVENT_USENIGHTVISIONPlayer has hit the button (key). On entry, RETURN is set to 0 Set RETURN to non-zero to prevent use of key. EVENT_USESTEROIDSPlayer has hit the button (key). On entry, RETURN is set to 0 Set RETURN to non-zero to prevent use of key. EVENT_INVENTORYLEFTPlayer has hit the button (key). On entry, RETURN is set to the next inventory item. Set RETURN to zero to select no inventory item EVENT_INVENTORYRIGHTPlayer has hit the button (key). On entry, RETURN is set to the next inventory item. Set RETURN to zero to select no inventory item EVENT_HOLODUKEONPlayer has hit the button (key) and Holoduke is turning on. On entry, RETURN is set to 0 Set RETURN to non-zero to prevent use of key. EVENT_HOLODUKEOFFPlayer has hit the button (key) and Holoduke is turning off On entry, RETURN is set to 0 Set RETURN to non-zero to prevent use of key. EVENT_USEMEDKITPlayer has hit the button (key). On entry, RETURN is set to 0 Set RETURN to non-zero to prevent use of key. EVENT_USEJETPACKPlayer has hit the button (key). On entry, RETURN is set to 0 Set RETURN to non-zero to prevent use of key. EVENT_TURNAROUNDPlayer has hit the button (key). On entry, RETURN is set to 0 Set RETURN to non-zero to prevent use of key.
|
||||
![]() |