Difference between revisions of "Talk:GetButtonPressed"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>Snarker
imported>Haama
(Reason why I switched the buttonpressed flags)
Line 1: Line 1:
The example script does an infinite loop.  Because the GetButtonPress is in GameMode, it will keep getting the button pressed over and over, thus displaying the final dialog over and over again.  I edited the code to fix this error.  --[[User:Snarker|Snarker]] 22:27, 7 December 2007 (EST)
The example script does an infinite loop.  Because the GetButtonPress is in GameMode, it will keep getting the button pressed over and over, thus displaying the final dialog over and over again.  I edited the code to fix this error.  --[[User:Snarker|Snarker]] 22:27, 7 December 2007 (EST)
:I switched the buttonpressed flags. When a mod is first loaded in the game, every object's script runs once. When a variable is set on an object, it will run the next frame. The way it was set up before, it would continue to use GetButtonPressed until the player enters a MenuMode. In this particular case it's minor, but it can add up and is a good habit to re-enforce.--[[User:Haama|Haama]] 23:12, 7 December 2007 (EST)

Revision as of 23:12, 7 December 2007

The example script does an infinite loop. Because the GetButtonPress is in GameMode, it will keep getting the button pressed over and over, thus displaying the final dialog over and over again. I edited the code to fix this error. --Snarker 22:27, 7 December 2007 (EST)

I switched the buttonpressed flags. When a mod is first loaded in the game, every object's script runs once. When a variable is set on an object, it will run the next frame. The way it was set up before, it would continue to use GetButtonPressed until the player enters a MenuMode. In this particular case it's minor, but it can add up and is a good habit to re-enforce.--Haama 23:12, 7 December 2007 (EST)