Cutscene Controller : using chart_mode_cutoff to switch into map?

Place to get help with not working mods / modding interface.
Post Reply
User avatar
TheBloke
Fast Inserter
Fast Inserter
Posts: 123
Joined: Mon Dec 03, 2018 2:48 am
Contact:

Cutscene Controller : using chart_mode_cutoff to switch into map?

Post by TheBloke »

Hi guys

Not sure if this is a bug or if I'm just misunderstanding something here.

I'm trying to make use of LuaPlayer::set_controller type=cutscene to do a smooth zoom from fully zoomed-out map into fully zoomed-in normal view, using chart_mode_cutoff.
API description of waypoints table
It reads like chart_mode_cutoff should specify the point at which it goes from normal view to the map, and vice versa? But.. it doesn't. Here's an example I've tried:

Code: Select all

/c game.player.set_controller { type = defines.controllers.cutscene, 
  waypoints = { 
    { position = {0,0}, transition_time = 360, time_to_wait = 720, zoom = 0.01, chart_mode_cutoff = 0.5}, 
    { position = {0,0}, transition_time = 720, time_to_wait = 240, zoom = 1, chart_mode_cutoff = 0.5} 
  }, 
final_transition_time = 60 }
This results in it zooming to 0.01 and back in, without switching into the map. This causes me to drop to about 5 FPS because it's trying to render the whole world at that very high zoom level (it's only a 2048x2048 world, but it's still horribly choppy.)

Am I misunderstanding "chart mode" here? I wondered if maybe it meant "map view" rather than the normal map, but I've tried testing it with lower zoom levels, and I honestly can't see any visual difference between specifying chart_mode_cutoff and not specifying it. I looked for the fuzzy static that appears on zoomed-in map view, and it's not apparent. Besides, it says "map zoomed-out", which doesn't sound like map view.

I was hoping to use the cutscene controller for some video footage I'm trying to make. I specifically want it to start in the map, then transition to normal zoom level as if I opened the map, zoomed out as far as I can, then then zoomed in with mouse wheel. If need be I will just do it manually with the mouse, but if I could get a cutscene to work it would be smoother, and would allow me to try different transition times.

Thanks

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Cutscene Controller : using chart_mode_cutoff to switch into map?

Post by eradicator »

As can be seen in the campaign script, chart_mode_cutoff is a parameter of the cutscene, not of each waypoint. The documentation is wrong on that part (I've called bilka to the rescue).

Code: Select all

/c game.player.set_controller { type = defines.controllers.cutscene, 
  waypoints = { 
    { position = {0,0}, transition_time = 360, time_to_wait = 720, zoom = 0.01}, 
    { position = {0,0}, transition_time = 720, time_to_wait = 240, zoom = 1 } 
  }, 
chart_mode_cutoff = 0.5,
final_transition_time = 60 }
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

User avatar
TheBloke
Fast Inserter
Fast Inserter
Posts: 123
Joined: Mon Dec 03, 2018 2:48 am
Contact:

Re: Cutscene Controller : using chart_mode_cutoff to switch into map?

Post by TheBloke »

Ahhh! That works perfectly, thanks so much.

Post Reply

Return to “Modding help”