Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
#629676 11/10/17 10:21 AM
Joined: Sep 2017
R
Reltzu Offline OP
apprentice
OP Offline
apprentice
R
Joined: Sep 2017
Hi.

I am trying to get a timer to work in a gameScript.

it works fine in an itemScript using the following code, but the same code does not work in my gameScript (the script is active and it works otherwise). Any ideas?

Code
ON
	OnUseItem(_playerChar,__Me)
ACTIONS
	StartTimer("MissionTimerTick", 1, 5)
	Output("timer started")
	
EVENT MissionTimer
VARS
ON
	OnTimer("MissionTimerTick")
ACTIONS
	Output("ticking from item")


Here is the non working gameScript.

Code
EVENT LeverUsed
VARS
	CHARACTER: _thisChar
ON
	OnUseItem(_thisChar, ITEM:S_My_Lever_cfc46525-0878-499e-8936-f1e9d9842e61)
ACTIONS
	StartTimer("MissionTimerTick", 1, 5)
	Output("timer started")
	
EVENT MissionTimer
VARS
ON
	OnTimer("MissionTimerTick")
ACTIONS
	Output("ticking from game")

Joined: Mar 2016
Location: Belgium
T
addict
Offline
addict
T
Joined: Mar 2016
Location: Belgium
Timers are indeed not supported in GameSripts. FWIW, GameScripts also don't receive OnInit() events.

Last edited by Tinkerer; 11/10/17 08:06 PM.
Joined: Sep 2017
R
Reltzu Offline OP
apprentice
OP Offline
apprentice
R
Joined: Sep 2017
Yeah I figured as much. I actually worked around it by running a timer in an item script and then firing a custom ItemEvent from there which I catch in the game script.


Moderated by  Larian_KVN 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.5