Skip to main content

News

Topic: Sphere Map Engine Catch (Read 1676 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
Sphere Map Engine Catch
I am trying to implement code involving functions to update the map engine and a render function in the animation loop but I am running into problems. If I put MapEngine("DoubleEmpty.rmp", 60); in the game() function of main.js file, I get SPHERE ENGINE HAS STOPPED WORKING and a problem event named BEX or APPCRASH. If I comment out the MapEngine line in the main.js file and turn on the same command in an intro function in a cutscene file, I get MAP ENGINE FAILED! MAP ENGINE IS ALREADY RUNNING. If I comment out that command in the cutscene file I get RENDERMAP() failed! MAP ENGINE called when MAP ENGINE was not running. I am using 5 files from Radnen's Knights Tale and the Wait function in the Animate.js file and admittedly, I don't really know in detail how they work to create the textbox and fade text and objects. The textbox function has an 'if map engine is running condition'. Maybe I just need to add an IF MAP ENGINE is running condition?

Code: [Select]
//------REQUIRE SCRIPTS------//
RequireScript('Load Data.js');
RequireScript('Animate.js');  // I am only using the WAIT function in this file to show the map for a specified time period
RequireScript('FadeObject.js');
RequireScript('TextWindow.js');
RequireScript('FadeWindow.js');
RequireScript('FadeText.js');
RequireScript('cutscene1.js'); // This file contains my function for an animation.
RequireSystemScript('time.js');
RequireSystemScript('screen.js');


  I have another version of this game file with these same 9 files and a naive linear animation function that works fine. What did I change that is causing me such aggravation? The MapEngine function is in the game() function in the main.js file.

FORGET ALL THAT! I figured it out! The problem was caused by using the map to create new tiles which were then causing the map to not load because they were invalid tile references.


DaVince edit - added code tags
  • Last Edit: June 21, 2013, 05:22:16 am by DaVince

  • N E O
  • [*][*][*][*][*]
  • Administrator
  • Senior Administrator
Re: Sphere Map Engine Catch
Reply #1
So...your problem is fixed?

To summarize for those unfamiliar with a possible solution, RenderMap() and UpdateMapEngine() need to make sure IsMapEngineRunning() returns true otherwise you'll get errors; MapEngine() starts a new map engine and will error if IsMapEngineRunning() returns true, which means you'll need to use ChangeMap() instead.