Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
Joined: Sep 2017
R
Reltzu Offline OP
apprentice
OP Offline
apprentice
R
Joined: Sep 2017
I created a simple .gameScript that fires on the event "OnTriggerEnter" and displays some text above the character that entered the trigger.
I assigned the script under "Project Settings" and "Game Scripts".
Nothing happens when a character enters the EventTrigger.

When I copy the same code to any .itemScript it works fine though.
So, how do I enable .gameScripts properly? What am I doing wrong?

Joined: Aug 2016
apprentice
Offline
apprentice
Joined: Aug 2016
Hi Reltzu,

you're on the right track, you need to set an event name for the trigger in the sidebar and then use that (instead of the GUID like with the story editor) to make it work. For example with the event name "ScriptTest" like so: https://i.imgur.com/igD4WPw.jpg and the script like so:

Code
EVENTS

EVENT EventTriggerTest
VARS
	CHARACTER: _character
ON
	// OnTriggerEnter(_character, _, "TRIGGERGUID_EventTrigger_000_47617a86-d08a-4d10-8698-8670e534d1d9") <-- doesn't work
	// OnTriggerEnter(_character, _, "EventTrigger_000_47617a86-d08a-4d10-8698-8670e534d1d9") <-- doesn't work either
	OnTriggerEnter(_character, _, "ScriptTest") // <-- works! :)
ACTIONS
	DisplayText(_character, "TriggerTest :)", 3)


At least that is the only way it works for me.

Joined: Sep 2017
R
Reltzu Offline OP
apprentice
OP Offline
apprentice
R
Joined: Sep 2017
Thanks for your reply. Thing is, I did exactly that (that’s almost my code 1to1). And it works if I put that code anywhere in an itemScript. But it’s not working in a gameScript. I suspect the gameScript is not active, even though I assigned it to the project.
Is that script you posted an item/charScript or a gameScript?

Joined: Aug 2016
apprentice
Offline
apprentice
Joined: Aug 2016
Hi,

that's a gameScript assigned under "Project Settings" just like you did as well.

EDIT: I think I found the problem. After you setup everything you need to save and then exit the editor. After you start it again it should work. Reload level and story doesn't work. It seems to only work with restarting the entire editor.


Moderated by  Larian_KVN 

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