Onevent: Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
Mblackwell (talk | contribs)
mNo edit summary
No edit summary
Line 6: Line 6:
Example code:
Example code:


 
<pre>
[[gamevar]] MYMEDPACK 100 1
[[gamevar]] MYMEDPACK 100 1


onevent [[EVENT_TURNAROUND]]
onevent [[EVENT_TURNAROUND]]
 
{
[[palfrom]] 32 0 0 32
    [[palfrom]] 32 0 0 32
 
    [[addphealth]] 5
[[addphealth]] 5
    [[subvar]] MYMEDPACK 5
 
    [[setvar]] RETURN -1
[[subvar]] MYMEDPACK 5
}
 
[[setvar]] RETURN -1
 
[[endevent]]
[[endevent]]
 
</pre>






See the [[EDuke32 event list]] for a list of all currently valid [[event]]s in Eduke32.
See the [[EDuke32 event list]] for a list of all currently valid [[event]]s in Eduke32.

Revision as of 16:54, 7 September 2005

onevent <event name> { code } endevent

Used outside of all actors. When the event called <event name> occurs, any following code occurs. endevent is used to end the statement. Set the gamevar RETURN to -1 inside an onevent statement to cancel to effects of the event.


Example code:

[[gamevar]] MYMEDPACK 100 1

onevent [[EVENT_TURNAROUND]]
{
    [[palfrom]] 32 0 0 32
    [[addphealth]] 5
    [[subvar]] MYMEDPACK 5
    [[setvar]] RETURN -1
}
[[endevent]]


See the EDuke32 event list for a list of all currently valid events in Eduke32.