Make Nightvision light rooms: Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
New page: 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 ...
 
No edit summary
 
Line 7: Line 7:


getplayer[THISACTOR].heat_on TEMP // this reads the heat_on member of the player structure into TEMP
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
// 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)
ifvare TEMP 1 setplayer[THISACTOR].visibility 0 // if the goggles are on, visibility is set to 0 (full)
// the normal APLAYER code resumes below...
</pre>
</pre>


[[Category: Tutorials]]
[[Category: Tutorials]]

Latest revision as of 22:38, 15 April 2007

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...