Make Nightvision light rooms

From EDukeWiki
Jump to navigation Jump to search

This simple example illustrates how to check and alter members of the player structure. This code will cause low visibility areas to become fully visible when the nightvision goggles are used (the normal goggle effects are unchanged).

gamevar TEMP 0 1

actor APLAYER MAXPLAYERHEALTH PSTAND 0 0 // this line is unchanged from the standard cons

getplayer[THISACTOR].heat_on TEMP // this reads the heat_on member of the player structure into TEMP

// heat_on is 0 if the goggles are off, 1 if they are on

ifvare TEMP 1 setplayer[THISACTOR].visibility 0 // if the goggles are on, visibility is set to 0 (full)

// the normal APLAYER code resumes below...