Talk:Global Scripts

Revision as of 18:18, 25 March 2006 by imported>JT

--Kkuhlmann 20:27, 24 March 2006 (EST) Removed section about having to add a condition to a quest or the game will crash. Not true. There are plenty of quests without any conditions. If the game is crashing, it must be for some other reason (perhaps something in the script itself).


Probably right. The Player.GetIsRace function might be failing before the game is successfully initiated or loaded. At the very least, adding that particular condition to my own plugin forces the player to be playing a valid race before the game is loaded. --JT 21:36, 24 March 2006 (EST)

The script, for reference:

scriptname JTKhNightEyeScript

float fQuestDelayTime
short nighteye_toggle

begin GameMode

;If the player is not a Khajiit, we have to return here.  Unfortunately, we can't just stop
; the script because the player will not be a Khajiit until his/her race has been selected.
; I'll have to do some research into the chargen states in Oblivion.
if ( Player.GetIsRace "Khajiit" != 1 )
	return
endif

;Until the player is a Khajiit, this script will execute only once every 5 seconds or so,
; based on Oblivion's standard quest engine.
;If this point is reached, then the player is a Khajiit and we want to process this script every
; frame to allow perfect resolution of the player's Eye of Night power.
set fQuestDelayTime to ( 0.001 )

;The player has cast the Eye of Night power.
if ( Player.IsSpellTarget "LpRaceKhajiitNightEye" )
	if ( nighteye_toggle == 0 ) ;If we are not currently in night-vision mode...
		Player.Dispel "LpRaceKhajiitNightEye"
		Player.AddSpell "JTKhNightEyeAbility"
		set nighteye_toggle to 1
	else ;If we are currently in night-vision mode...
		Player.Dispel "LpRaceKhajiitNightEye"
		Player.RemoveSpell "JTKhNightEyeAbility"
		set nighteye_toggle to 0
	endif
endif

end GameMode

--Kkuhlmann 06:51, 25 March 2006 (EST) Quest conditions only apply to the quest's dialogue, and since your quest doesn't involve dialogue, having a condition or not shouldn't have any impact. _Shouldn't_... obviously something strange is going on though.


Strange. I'll do some stress testing. Maybe I'll be able to work out a good synopsis for your codemonkeys. ;-) --JT 18:18, 25 March 2006 (EST)

Return to "Global Scripts" page.