Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Hi there, getting a crash when the menu builder plugin tries to draw a picture to a "selection data window" from a "selection option" "pictures" parameter.

YEP_CoreEngine.js:1098 SyntaxError: Unexpected token U in JSON at position 0
  
    at JSON.parse (<anonymous>)
    at Window_SynMenuSelcData.drawPicture (Synrec_MenuBuilder.js:3730)
    at Window_SynMenuSelcData.drawData (Synrec_MenuBuilder.js:3718)
    at Window_SynMenuSelcData.updateSelected (Synrec_MenuBuilder.js:3666)
    at Window_SynMenuSelcData.update (Synrec_MenuBuilder.js:3655)
    at rpg_core.js:7397
    at Array.forEach (<anonymous>)
    at WindowLayer.update (rpg_core.js:7395)
    at rpg_scenes.js:262
    at Array.forEach (<anonymous>)

Here is the selection option configuration:

{"Name":"Sarah Adams","Alternative Name":"<WordWrap>In her dorm, Evening: Tuesdays and Thursdays Morning: Saturdays","Display Requirements":"{\"Variable Requirements\":\"[\\\"{\\\\\\\"Name\\\\\\\":\\\\\\\"Variable\\\\\\\",\\\\\\\"Variable\\\\\\\":\\\\\\\"102\\\\\\\",\\\\\\\"Min Value\\\\\\\":\\\\\\\"0\\\\\\\",\\\\\\\"Max Value\\\\\\\":\\\\\\\"0\\\\\\\"}\\\"]\",\"Switch Requirements\":\"[\\\"101\\\"]\",\"Item Requirements\":\"[]\",\"Weapon Requirements\":\"[]\",\"Armor Requirements\":\"[]\"}","Select Requirements":"","Description":"\"Sarah is energetic and full of life. She often lets her\\npassion and emotions guide her which gets her in a\\nlot of trouble.\\n\\nAlthough she usually has a bright personality, a\\nrecent loss of someone close to her still weighs\\nheavily on her feelings.\\n\\nSarah was one of Luc's closest friends from childhood\\nto high school. As they graduated, they fell out of\\ncontact but certain events have brough them back\\ntogether.\"","Pictures":"[\"UISarahFace\",\"UIHeart0\"]","Static Graphic":"","Animated Graphic":"","Video":"","Video X":"0","Video Y":"0","Video Width":"0","Video Height":"0","Scene Button":"","Event Execution":"0","Code Execution":"\"\"","Require Actor Select":"false"}

And the data window:

{"Name":"FaceWindow","Dimension Configuration":"{\"X\":\"210\",\"Y\":\"10\",\"Width\":\"165\",\"Height\":\"162\"}","Window Font and Style Configuration":"{\"Font Settings\":\"\",\"Font Size\":\"16\",\"Font Face\":\"sans-serif\",\"Base Font Color\":\"#ffffff\",\"Font Outline Color\":\"rgba(0, 0, 0, 0.5)\",\"Font Outline Thickness\":\"3\",\"Window Skin\":\"Window\",\"Window Opacity\":\"255\",\"Show Window Dimmer\":\"false\"}","Display Requirements":"","Gauges":"[]","Draw Option Name":"false","Name Text":"%1","Name X":"0","Name Y":"0","Draw Alternative Option Name":"false","Alternative Name Text":"%1","Alternative Name X":"0","Alternative Name Y":"0","Draw Description":"false","Description X":"0","Description Y":"0","Draw Picture":"true","Picture Index":"0","Picture X":"0","Picture Y":"4","Picture Width":"0","Picture Height":"0"}

Thanks for the report, I'll check it out

To be clear, was this set using the editor or the plugin parameters?

Hey, sorry for the slow response. This was set using plugin parameters. I tweaked the function below to fix it:

Window_SynMenuSelcData.prototype.drawPicture = function(data){
    const window_data = this._window_data;
    const draw_pic = eval(window_data['Draw Picture']);
    if(!draw_pic)return;
    //const pic_names = JSON.parse(data['Pictures'] || []); edited by Icosa for Thread, 2025
    const pic_names = data['Pictures'] || [];
    const pic_index = eval(window_data['Picture Index']);
    const pic_name = pic_names[pic_index];
    if(!pic_name)return;
    const bitmap = ImageManager.loadPicture(pic_name);
    const bx = 0;
    const by = 0;
    const bw = bitmap.width;
    const bh = bitmap.height;
    const dx = eval(window_data['Picture X']);
    const dy = eval(window_data['Picture Y']);
    const dw = eval(window_data['Picture Width']);
    const dh = eval(window_data['Picture Height']);
    this.contents.blt(bitmap,bx,by,bw,bh,dx,dy,dw,dh);
}

This was done in the latest version of menu builder, you can just download the updated version

Thanks!