RETURN: Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
Fox (talk | contribs)
No edit summary
Fox (talk | contribs)
No edit summary
 
Line 1: Line 1:
The '''RETURN''' gamevar returns different values depending of the situation. Used mostly for [[events]].
The '''RETURN''' gamevar returns different values depending of the situation. Used mostly for [[events]].


The '''return #''' userdef structure is an extension of the '''RETURN''' gamevar. If # equals zero, the value will be the same as RETURN.
The '''return #''' userdef structure is an extension of the '''RETURN''' gamevar. If '''#''' equals zero, the value will be the same as RETURN.


Not to be confused with the [[return]] command.
Not to be confused with the [[return]] command.

Latest revision as of 01:32, 20 February 2020

The RETURN gamevar returns different values depending of the situation. Used mostly for events.

The return # userdef structure is an extension of the RETURN gamevar. If # equals zero, the value will be the same as RETURN.

Not to be confused with the return command.

Examples

EXAMPLE:

onevent EVENT_GETLOADTILE
    setvar RETURN <value>
endevent

In this case, RETURN "return"s the load screen background number into the var RETURN, setting it to something else changes it, changing the background for the loading screen.

EXAMPLE 2:

onevent EVENT_FIRE
    setvar RETURN -1
endevent

In this case, setting RETURN to -1 cancels EVENT_FIRE, causing the player to no longer be able to use a weapon.

EXAMPLE 3:

espawn LIZTROOP
setactor[RETURN].pal 21
setactor[RETURN].extra 400

In this case, RETURN will allow you to spawn an Assault Captain [LIZTROOP, Pal 21] with 400 health instead of 60 health.