EVENT DISPLAYWEAPON: Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
No edit summary
mNo edit summary
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{EventTable|1=EVENT_DISPLAYWEAPON |2=[[screenpeek]]|3=[[i|player->i]]|4=1 value}}
EVENT_DISPLAYWEAPON is a [[EDuke32_event_list|Game Event]].
EVENT_DISPLAYWEAPON is a [[EDuke32_event_list|Game Event]].


This event is similar to [[EVENT_DISPLAYREST]] and [[EVENT_DISPLAYCROSSHAIR]] in the fact that it is used to draw the HUD weapons on-screen. The only reason this is separated from [[EVENT_DISPLAYREST]] and [[EVENT_DISPLAYCROSSHAIR]] is that this event is only run when view mode (a.k.a. F7 or DNVIEW) is off. You can use it to draw your own custom weapons to the screen that do not have the exact same tile set as the pre-set weapons. Remember to check the player's current weapon first and then, if it is the weapon slot that you want replaced, put <code>setvar [[RETURN]] -1</code> in your code. The constantly updated variable [[currentweapon]] should be used with this event, i.e do not use your own declared variables, otherwise when the player attempts to switch weapons, raising/lowering of the new weapon will be glitched.  
Set RETURN to a nonzero value to disable the weapon display, including the quick-kick.
 
This event is similar to [[EVENT_DISPLAYREST]] and [[EVENT_DISPLAYCROSSHAIR]] in the fact that it is used to draw the HUD weapons on-screen.
 
The only reason this is separated from [[EVENT_DISPLAYREST]] and [[EVENT_DISPLAYCROSSHAIR]] is that this event is only run when view mode (a.k.a. F7 or DNVIEW) is off.  
 
You can use it to draw your own custom weapons to the screen that do not have the exact same tile set as the pre-set weapons. Remember to check the player's current weapon first and then, if it is the weapon slot that you want replaced, put <code>setvar [[RETURN]] -1</code> in your code.
 
The constantly updated variable [[currentweapon]] should be used with this event, i.e do not use your own declared variables, otherwise when the player attempts to switch weapons, raising/lowering of the new weapon will be glitched.  


The difference between EVENT_DISPLAYWEAPON and [[EVENT_DRAWWEAPON]] is that the second doesn't hide the quick kick tile. EVENT_DRAWWEAPON may be useful if you don't plan to re-do the quick kick.
The difference between EVENT_DISPLAYWEAPON and [[EVENT_DRAWWEAPON]] is that the second doesn't hide the quick kick tile. EVENT_DRAWWEAPON may be useful if you don't plan to re-do the quick kick.


[[Category:Events]]
[[Category:Events]]

Latest revision as of 10:25, 4 February 2022

Event ID player# THISACTOR RETURN
EVENT_DISPLAYWEAPON screenpeek player->i 1 value

EVENT_DISPLAYWEAPON is a Game Event.

Set RETURN to a nonzero value to disable the weapon display, including the quick-kick.

This event is similar to EVENT_DISPLAYREST and EVENT_DISPLAYCROSSHAIR in the fact that it is used to draw the HUD weapons on-screen.

The only reason this is separated from EVENT_DISPLAYREST and EVENT_DISPLAYCROSSHAIR is that this event is only run when view mode (a.k.a. F7 or DNVIEW) is off.

You can use it to draw your own custom weapons to the screen that do not have the exact same tile set as the pre-set weapons. Remember to check the player's current weapon first and then, if it is the weapon slot that you want replaced, put setvar RETURN -1 in your code.

The constantly updated variable currentweapon should be used with this event, i.e do not use your own declared variables, otherwise when the player attempts to switch weapons, raising/lowering of the new weapon will be glitched.

The difference between EVENT_DISPLAYWEAPON and EVENT_DRAWWEAPON is that the second doesn't hide the quick kick tile. EVENT_DRAWWEAPON may be useful if you don't plan to re-do the quick kick.