Page 1 of 1

[Solved]Could not create cutscene controller

Posted: Mon Apr 01, 2019 1:07 pm
by WIZ4
I'm trying to create a cutscene:

Code: Select all

function cutscene(player)
	local waypoint = {
	position = {x=100,y=100},
	transition_time = 1000,
	time_to_wait = 1000
	}
	player.set_controller{  --line 546
		type = defines.controllers.cutscene,
		waypoints = waypoint, 
		final_transition_time = 1000}
And when I call this function, I get an error:

Code: Select all

/c cutscene(game.player)
Screenshot_6.jpg
Screenshot_6.jpg (45.9 KiB) Viewed 936 times
What is wrong with the position provided?

Re: Could not create cutscene controller

Posted: Tue Apr 02, 2019 12:43 pm
by WIZ4
I forgot to put a waypoint in the table. Problem solved

Code: Select all

	local waypoint = {{
		position = {x=90,y=89},
		transition_time = 1000,
		time_to_wait = 1000
	}}