PageSourceSearch

https://youthful-varahamihira-d6b430.netlify.app/assets/js/fe0d1825.7a15c977.js

js youthful-varahamihira-d6b430.netlify.app collected 2026-10-03 11:39:42 UTC 27,501 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkgb_studio_docs=self.webpackChunkgb_studio_docs||[]).push([[7604],{1906:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>r,contentTitle:()=>c,default:()=>h,frontMatter:()=>a,metadata:()=>o,toc:()=>d});var l=s(5893),n=s(1151),i=s(237);const a={sidebar_position:2},c="Music & Sound Effects",o={id:"scripting/script-glossary/music-sound-effects",title:"Music & Sound Effects",description:"Play Music Track",source:"@site/docs/scripting/script-glossary/music-sound-effects.md",sourceDirName:"scripting/script-glossary",slug:"/scripting/script-glossary/music-sound-effects",permalink:"/docs/scripting/script-glossary/music-sound-effects",draft:!1,unlisted:!1,editUrl:"https://github.com/chrismaltby/gb-studio-docs/tree/main/docs/scripting/script-glossary/music-sound-effects.md",tags:[],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2},sidebar:"tutorialSidebar",previous:{title:"Miscellaneous",permalink:"/docs/scripting/script-glossary/miscellaneous"},next:{title:"Save Data",permalink:"/docs/scripting/script-glossary/save-data"}},r={},d=[{value:"Play Music Track",id:"play-music-track",level:3},{value:"Play Sound Effect",id:"play-sound-effect",level:3},{value:"Dialogue & Menus",id:"dialogue--menus",level:2},{value:"Set Text Sound Effect",id:"set-text-sound-effect",level:3},{value:"Script",id:"script",level:2},{value:"Set Music Routine",id:"set-music-routine",level:3},{value:"Stop",id:"stop",level:2},{value:"Mute Channel",id:"mute-channel",level:3},{value:"Stop Music",id:"stop-music",level:3}];function u(e){const t={a:"a",br:"br",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",strong:"strong",ul:"ul",...(0,n.a)(),...e.components};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(t.h1,{id:"music--sound-effects",children:"Music & Sound Effects"}),"\n",(0,l.jsx)(t.h3,{id:"play-music-track",children:"Play Music Track"}),"\n",(0,l.jsx)(t.p,{children:"Plays a music file. If you play a new song while another song is playing, the old song will stop automatically."}),"\n",(0,l.jsx)(i.ZP,{title:"Play Music Track",fields:[{key:"musicId",label:"Song",description:"The song to play.",type:"music",defaultValue:"LAST_MUSIC"}]}),"\n",(0,l.jsxs)(t.ul,{children:["\n",(0,l.jsxs)(t.li,{children:[(0,l.jsx)(t.strong,{children:"Song"}),": The song to play."]}),"\n"]}),"\n",(0,l.jsx)(t.h3,{id:"play-sound-effect",children:"Play Sound Effect"}),"\n",(0,l.jsxs)(t.p,{children:["Play a sound effect, choose from playing a .WAV, .VGM, or .SAV (fxhammer) file from ",(0,l.jsx)(t.code,{children:"/assets/sounds"})," or a preset sound effect."]}),"\n",(0,l.jsx)(i.ZP,{title:"Play Sound Effect",fields:[{key:"type",type:"soundEffect",label:"Sound Effect",description:"The sound effect to play. Can choose from files within `/assets/sounds` or from preset sounds like `Beep`, `Pitch` and `Tone`.",defaultValue:"beep",flexBasis:"60%"},{key:"priority",label:"Priority",description:"The priority of the effect, high, medium or low. If two sound effects are playing at the same time then higher priority sound effects will take precedence.",type:"priority",options:[["low","Low"],["medium","Medium"],["high","High"]],defaultValue:"medium",flexBasis:"15%"},{key:"pitch",type:"number",label:"Pitch",description:"The pitch of the sound effect (Beep effect only).",conditions:[{key:"type",eq:"beep"}],min:1,max:8,step:1,defaultValue:4},{key:"frequency",type:"number",label:"Frequency in hz",description:"The frequency of the sound effect in hz (Tone effect only).",conditions:[{key:"type",eq:"tone"}],min:0,max:2e4,step:1,defaultValue:200},{key:"duration",type:"number",label:"Duration",description:"The length of time to play the sound effect.",unitsField:"units",unitsDefault:"time",conditions:[{key:"type",in:["beep","crash","tone"]}],min:0,max:4.25,step:.01,defaultValue:.5},{key:"wait",type:"checkbox",label:"Wait until finished",description:"Set if script should pause until sound effect has finished playing.",conditions:[{key:"type",in:["beep","crash","tone"]}],defaultValue:!0,flexBasis:"100%"},{key:"effect",type:"number",label:"Effect Index",description:"The effect number to play (for fxhammer only).",min:0,max:60,defaultValue:0,conditions:[{key:"type",soundType:"fxhammer"}]}]}),"\n",(0,l.jsxs)(t.ul,{children:["\n",(0,l.jsxs)(t.li,{children:[(0,l.jsx)(t.strong,{children:"Sound Effect"}),": The sound effect to play. Can choose from files within ",(0,l.jsx)(t.code,{children:"/assets/sounds"})," or from preset sounds like ",(0,l.jsx)(t.code,{children:"Beep"}),", ",(0,l.jsx)(t.code,{children:"Pitch"})," and ",(0,l.jsx)(t.code,{children:"Tone"}),"."]}),"\n",(0,l.jsxs)(t.li,{children:[(0,l.jsx)(t.strong,{children:"Priority"}),": The priority of the effect, high, medium or low. If two sound effects are playing at the same time then higher priority sound effects will take precedence."]}),"\n",(0,l.jsxs)(t.li,{children:[(0,l.jsx)(t.strong,{children:"Pitch"}),": The pitch of the sound effect (Beep effect only)."]}),"\n",(0,l.jsxs)(t.li,{children:[(0,l.jsx)(t.strong,{children:"Frequency in hz"}),": The frequency of the sound effect in hz (Tone effect only)."]}),"\n",(0,l.jsxs)(t.li,{children:[(0,l.jsx)(t.strong,{children:"Duration"}),": The length of time to play the sound effect."]}),"\n",(0,l.jsxs)(t.li,{children:[(0,l.jsx)(t.strong,{children:"Wait until finished"}),": Set if script should pause until sound effect has finished playing."]}),"\n",(0,l.jsxs)(t.li,{children:[(0,l.jsx)(t.strong,{children:"Effect Index"}),": The effect number to play (for fxhammer only)."]}),"\n"]}),"\n",(0,l.jsx)(t.h2,{id:"dialogue--menus",children:"Dialogue & Menus"}),"\n",(0,l.jsx)(t.h3,{id:"set-text-sound-effect",children:"Set Text Sound Effect"}),"\n",(0,l.jsx)(t.p,{children:"Set a sound effect to play as each text character is displayed."}),"\n",(0,l.jsx)(i.ZP,{title:"Set Text Sound Effect",fields:[{key:"type",type:"soundEffect",label:"Sound Effect",description:"The sound effect to play. Can choose from files within `/assets/sounds` or from preset sounds like `Beep`, `Pitch` and `Tone`.",defaultValue:"tone",flexBasis:"60%",allowNone:!0},{key:"pitch",type:"number",label:"Pitch",description:"The pitch of the sound effect (Beep effect only).",conditions:[{key:"type",eq:"beep"}],min:1,max:8,step:1,defaultValue:4,width:"50%"},{key:"frequency",type:"number",label:"Frequency in hz",description:"The frequency of the sound effect in hz (Tone effect only).",conditions:[{key:"type",eq:"tone"}],min:0,max:2e4,step:1,defaultValue:300,width:"50%"},{key:"duration",type:"number",label:"Duration",description:"The length of time to play the sound effect.",unitsField:"units",unitsDefault:"time",conditions:[{key:"type",in:["beep","crash","tone"]}
1],min:0,max:4.25,step:.01,defaultValue:.05,width:"50%"},{key:"effect",type:"number",label:"Effect Index",description:"The effect number to play (for fxhammer only).",min:0,max:60,defaultValue:0,conditions:[{key:"type",soundType:"fxhammer"}],width:"50%"}]}),"\n",(0,l.jsxs)(t.ul,{children:["\n",(0,l.jsxs)(t.li,{children:[(0,l.jsx)(t.strong,{children:"Sound Effect"}),": The sound effect to play. Can choose from files within ",(0,l.jsx)(t.code,{children:"/assets/sounds"})," or from preset sounds like ",(0,l.jsx)(t.code,{children:"Beep"}),", ",(0,l.jsx)(t.code,{children:"Pitch"})," and ",(0,l.jsx)(t.code,{children:"Tone"}),"."]}),"\n",(0,l.jsxs)(t.li,{children:[(0,l.jsx)(t.strong,{children:"Pitch"}),": The pitch of the sound effect (Beep effect only)."]}),"\n",(0,l.jsxs)(t.li,{children:[(0,l.jsx)(t.strong,{children:"Frequency in hz"}),": The frequency of the sound effect in hz (Tone effect only)."]}),"\n",(0,l.jsxs)(t.li,{children:[(0,l.jsx)(t.strong,{children:"Duration"}),": The length of time to play the sound effect."]}),"\n",(0,l.jsxs)(t.li,{children:[(0,l.jsx)(t.strong,{children:"Effect Index"}),": The effect number to play (for fxhammer only)."]}),"\n"]}),"\n",(0,l.jsx)(t.h2,{id:"script",children:"Script"}),"\n",(0,l.jsx)(t.h3,{id:"set-music-routine",children:"Set Music Routine"}),"\n",(0,l.jsx)(t.p,{children:"Attach a script to one of the four music routines that can be triggered from a .uge file. In the music editor you are able to use the call routine effect in your songs to trigger these scripts in time to music."}),"\n",(0,l.jsxs)(t.p,{children:[(0,l.jsx)(t.strong,{children:"References"}),(0,l.jsx)(t.br,{}),"\n",(0,l.jsx)(t.a,{href:"/docs/assets/music/music-huge#effects",children:"/docs/assets/music/music-huge#effects"})]}),"\n",(0,l.jsx)(i.ZP,{title:"Set Music Routine",fields:[{key:"routine",label:"Routine",description:"The music routine, either 0, 1, 2 or 3.",type:"number",defaultValue:0,min:0,max:3},{key:"__scriptTabs",type:"tabs",defaultValue:"trigger",values:{trigger:"On Call"}},{key:"true",label:"On Call",description:"The script to run when the routine is called.",type:"events",allowedContexts:["global","entity","prefab"],conditions:[{key:"__scriptTabs",in:[null,"trigger"]}]}]}),"\n",(0,l.jsxs)(t.ul,{children:["\n",(0,l.jsxs)(t.li,{children:[(0,l.jsx)(t.strong,{children:"Routine"}),": The music routine, either 0, 1, 2 or 3."]}),"\n",(0,l.jsxs)(t.li,{children:[(0,l.jsx)(t.strong,{children:"On Call"}),": The script to run when the routine is called."]}),"\n"]}),"\n",(0,l.jsx)(t.h2,{id:"stop",children:"Stop"}),"\n",(0,l.jsx)(t.h3,{id:"mute-channel",children:"Mute Channel"}),"\n",(0,l.jsx)(t.p,{children:"Set which audio channels are active and which are muted."}),"\n",(0,l.jsx)(i.ZP,{title:"Mute Channel",fields:[{key:"channels",label:"Active Channels",description:"The channels that will produce sound. Any unselected channels will be muted.",type:"togglebuttons",options:[[0,"Duty 1"],[1,"Duty 2"],[2,"Wave"],[3,"Noise"]],allowMultiple:!0,allowNone:!0}]}),"\n",(0,l.jsxs)(t.ul,{children:["\n",(0,l.jsxs)(t.li,{children:[(0,l.jsx)(t.strong,{children:"Active Channels"}),": The channels that will produce sound. Any unselected channels will be muted."]}),"\n"]}),"\n",(0,l.jsx)(t.h3,{id:"stop-music",children:"Stop Music"}),"\n",(0,l.jsx)(t.p,{children:"Stops any currently playing music."}),"\n",(0,l.jsx)(i.ZP,{title:"Stop Music",fields:[{label:"Stops any music that was previously playing."}]})]})}function h(e={}){const{wrapper:t}={...(0,n.a)(),...e.components};return t?(0,l.jsx)(t,{...e,children:(0,l.jsx)(u,{...e})}):u(e)}},237:(e,t,s)=>{s.d(t,{jx:()=>h,ZP:()=>k});s(7294);var l=s(512);const n={wrapper:"wrapper_Ipv2",header:"header_uY2Y",collapsableHeader:"collapsableHeader_Wady",form:"form_gV8o",field:"field_znmN",group:"group_Pakl",fieldHalf:"fieldHalf_mvGz",fieldInput:"fieldInput_DJtc",flexGrow:"flexGrow_dGNp",select:"select_piNM",selectIcon:"selectIcon_MlvR",input:"input_Tp_3",textarea:"textarea_tAAu",code:"code_VhHR",checkbox:"checkbox_kfbl",checkboxInput:"checkboxInput_aYfD",checkboxInputChecked:"checkboxInputChecked_mYiI",toggleButtons:"toggleButtons_NXwh",toggleButtonsRow:"toggleButtonsRow__YdE",toggleButtonsOption:"toggleButtonsOption_LK3C",toggleButtonsOptionSelected:"toggleButtonsOptionSelected_L_DP",conditional:"conditional_NY1W",conditionalLabel:"conditionalLabel_bY4O",eventsWrapper:"eventsWrapper_kJsX",button:"button_yKMz",buttonSmall:"buttonSmall_hjQK",eventButton:"eventButton_WDUY",unionSelect:"unionSelect_Jb_2",tabs:"tabs_nij8",tabsEventSection:"tabsEventSection_TZ3p",tab:"tab_tomX",tabSelected:"tabSelected_B_9X",break:"break_GXKR",unknown:"unknown_nmto",paletteSwatch:"paletteSwatch_SD8s",valueAtomInput:"valueAtomInput_H9XF",valueAtomInputButton:"valueAtomInputButton_pCsL",valueInputBrackets:"valueInputBrackets_RoeW",valueInputOperationButton:"valueInputOperationButton_pexu"};var i=s(5893);const a=["number","direction","variable","indirect","property","expression","true","false"],c=["add","sub","mul","div","mod","min","max","eq","ne","gt","gte","lt","lte","and","or","atan2","shl","shr","bAND","bOR","bXOR"],o=e=>!!e&&c.includes(e.type),r=e=>!!e&&a.includes(e.type);function d(){return(0,i.jsx)("div",{className:n.unionSelect,children:(0,i.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",children:[(0,i.jsx)("ellipse",{ry:"10",id:"svg_1",cy:"12",cx:"12",strokeWidth:"3",stroke:"#ccc",fill:"transparent"}),(0,i.jsx)("circle",{cx:"12",cy:"12",r:"2"})]})})}function u(e){let{children:t}=e;return(0,i.jsx)("div",{className:n.input,children:t})}function h(e){let{children:t}=e;if(r(t))return(0,i.jsx)(p,{type:t.type,value:t.defaultValue});if(o(t)){let e=t.type;return e="eq"===e?"==":"lt"===e?"<":"==",(0,i.jsxs)("div",{className:n.valueInputBrackets,children:[(0,i.jsx)(h,{children:t.valueA}),(0,i.jsx)("div",{className:n.valueInputOperationButton,children:e}),(0,i.jsx)(h,{children:t.valueB})]})}return(0,i.jsx)(p,{type:"variable"})}function p(e){let{type:t,value:s}=e,l=s??0;return"true"===t?l="True":"false"===t?l="False":"expression"===t?l="6 * $health":"variable"===t&&(l="$Variable0"),(0,i.jsxs)("div",{className:n.valueAtomInput,children:[(0,i.jsxs)("div",{className:n.valueAtomInputButton,children:["number"===t&&(0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:(0,i.jsx)("path",{d:"M22.548 9l.452-2h-5.364l1.364-6h-2l-1.364 6h-5l1.364-6h-2l-1.364 6h-6.184l-.452 2h6.182l-1.364 6h-5.36l-.458 2h
15.364l-1.364 6h2l1.364-6h5l-1.364 6h2l1.364-6h6.185l.451-2h-6.182l1.364-6h5.366zm-8.73 6h-5l1.364-6h5l-1.364 6z"})}),"direction"===t&&(0,i.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",children:(0,i.jsx)("path",{d:"M14.145 8.633l-2.145-8.633-2.148 8.636c-.572.366-1.034.877-1.358 1.477l-8.494 1.887 8.494 1.887c.324.6.786 1.111 1.358 1.477l2.148 8.636 2.157-8.64c.571-.367 1.03-.879 1.353-1.479l8.49-1.881-8.492-1.884c-.324-.603-.788-1.116-1.363-1.483zm-2.145 5.367c-1.104 0-2-.896-2-2s.896-2 2-2 2 .896 2 2-.896 2-2 2zm7 5l-3.43-2.186c.474-.352.893-.771 1.245-1.245l2.185 3.431zm-3.521-11.882l3.521-2.117-2.119 3.519c-.386-.542-.86-1.015-1.402-1.402zm-6.955 9.767l-3.524 2.115 2.118-3.521c.387.543.862 1.018 1.406 1.406zm-1.34-8.453l-2.184-3.431 3.431 2.184c-.474.352-.894.772-1.247 1.247z"})}),"true"===t&&(0,i.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",children:(0,i.jsx)("path",{d:"M21.5 2H2.5V7H9V22H15V7H21.5V2Z"})}),"false"===t&&(0,i.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",children:(0,i.jsx)("path",{d:"M18.5 2H6V22H12V14.5H17V10.5H12V6.5H18.5V2Z"})}),"variable"===t&&(0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:(0,i.jsx)("path",{d:"M12.7148438,22.1757812 L12.714,20.229 L12.7800926,20.2258391 C13.6949267,20.1603492 14.530599,19.9802517 15.2871094,19.6855469 C16.2597656,19.3066406 17.0253906,18.7519531 17.5839844,18.0214844 C18.1425781,17.2910156 18.421875,16.40625 18.421875,15.3671875 L18.421875,15.34375 C18.421875,14.0625 18.0097656,13.0683594 17.1855469,12.3613281 C16.3613281,11.6542969 15.1484375,11.1210938 13.546875,10.7617188 L12.714,10.579 L12.714,6.513 L12.8085938,6.52539062 C13.0585938,6.56835938 13.2929688,6.6328125 13.5117188,6.71875 C13.9492188,6.890625 14.3046875,7.14257812 14.578125,7.47460938 C14.8515625,7.80664062 15.015625,8.21875 15.0703125,8.7109375 L15.0820312,8.734375 L18.1875,8.72265625 L18.1992188,8.7109375 C18.1601562,7.71875 17.8769531,6.85742188 17.3496094,6.12695312 C16.8222656,5.39648438 16.0996094,4.83203125 15.1816406,4.43359375 C14.5390625,4.1546875 13.8208789,3.97339844 13.0270898,3.88972656 L12.714,3.863 L12.7148438,1.890625 L11.3671875,1.890625 L11.367,3.856 L11.2021123,3.86429398 C10.3338638,3.9304591 9.54123264,4.11241319 8.82421875,4.41015625 C7.90234375,4.79296875 7.17578125,5.33984375 6.64453125,6.05078125 C6.11328125,6.76171875 5.84765625,7.609375 5.84765625,8.59375 L5.84765625,8.6171875 C5.84765625,9.875 6.25390625,10.8671875 7.06640625,11.59375 C7.87890625,12.3203125 9.05078125,12.859375 10.5820312,13.2109375 L11.367,13.384 L11.367,17.597 L11.2177136,17.5815529 C10.8854432,17.5394611 10.5876116,17.469308 10.3242188,17.3710938 C9.86328125,17.1992188 9.50195312,16.9511719 9.24023438,16.6269531 C8.97851562,16.3027344 8.80859375,15.921875 8.73046875,15.484375 L8.73046875,15.4609375 L5.6015625,15.4609375 L5.58984375,15.484375 C5.62890625,16.5078125 5.92773438,17.375 6.48632812,18.0859375 C7.04492188,18.796875 7.79882812,19.3359375 8.74804688,19.703125 C9.48632812,19.9887153 10.3014082,20.1632427 11.193287,20.2267072 L11.367,20.236 L11.3671875,22.1757812 L12.7148438,22.1757812 Z M11.367,10.268 L11.2575,10.2376563 C10.59,10.0464062 10.0875,9.82265625 9.75,9.56640625 C9.328125,9.24609375 9.1171875,8.84375 9.1171875,8.359375 L9.1171875,8.3359375 C9.1171875,7.9765625 9.2265625,7.65625 9.4453125,7.375 C9.6640625,7.09375 9.98828125,6.87109375 10.4179688,6.70703125 C10.6635045,6.61328125 10.9422034,6.54631696 11.2540657,6.50613839 L11.367,6.495 L11.367,10.268 Z M12.714,17.6 L12.714,13.69 L12.8831676,13.7330514 C13.6502131,13.9410834 14.201527,14.1713423 14.5371094,14.4238281 C14.9472656,14.7324219 15.1523438,15.15625 15.1523438,15.6953125 L15.1523438,15.71875 C15.1523438,16.109375 15.0371094,16.4492188 14.8066406,16.7382812 C14.5761719,17.0273438 14.2304688,17.2480469 13.7695312,17.4003906 C13.5061384,17.4874442 13.2032047,17.5496253 12.8607302,17.586934 L12.714,17.6 Z",fillRule:"nonzero"})}),"expression"===t&&(0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:(0,i.jsx)("path",{d:"M0.445923 0H23.5541V5.65642H19.4566V4.09756H9.22323L15.8426 12L9.22323 19.9024H19.4567V18.3436H23.5543V24H0.445923L10.4974 12L0.445923 0Z"})})]}),(0,i.jsx)("div",{className:n.input,children:l})]})}function f(e){let{children:t}=e;return(0,i.jsx)("div",{className:n.textarea,children:t})}function x(e){let{children:t}=e;return(0,i.jsx)("div",{className:(0,l.Z)(n.textarea,n.code),children:t})}function y(e){let{children:t}=e;return(0,i.jsxs)("div",{className:n.select,children:[t,(0,i.jsx)("div",{className:n.flexGrow}),(0,i.jsx)("svg",{height:"20",width:"20",viewBox:"0 0 20 20",ariaHidden:"true",focusable:"false",children:(0,i.jsx)("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"})})]})}function m(){return(0,i.jsxs)("div",{className:n.paletteSwatch,children:[(0,i.jsx)("div",{style:{backgroundColor:"rgb(232, 248, 224)"}}),(0,i.jsx)("div",{style:{backgroundColor:"rgb(176, 240, 136)"}}),(0,i.jsx)("div",{style:{backgroundColor:"rgb(80, 152, 120)"}}),(0,i.jsx)("div",{style:{backgroundColor:"rgb(32, 40, 80)"}})]})}function g(e){let{options:t,moreOptions:s,value:a}=e;return(0,i.jsxs)("div",{className:n.toggleButtons,children:[(0,i.jsx)("div",{className:n.toggleButtonsRow,children:t.map((e=>(0,i.jsx)("div",{className:(0,l.Z)(n.toggleButtonsOption,{[n.toggleButtonsOptionSelected]:Array.isArray(a)?a.includes(e.value):a===e.value}),children:e.label})))}),s&&(0,i.jsx)("div",{className:n.toggleButtonsRow,children:s.map((e=>(0,i.jsx)("div",{className:(0,l.Z)(n.toggleButtonsOption,{[n.toggleButtonsOptionSelected]:Array.isArray(a)?a.includes(e.value):a===e.value}),children:e.label})))})]})}const j=e=>{let{angle:t}=e;return(0,i.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",style:{transform:`rotate(${t}deg)`},children:(0,i.jsx)("path",{d:"M24 22h-24l12-20z"})})};function v(e){let{field:t}=e;return"actor"===t.type?(0,i.jsxs)(y,{children:[(0,i.jsx)("img",{className:n.selectIcon,src:"/img/script-glossary/actor.png"}),"player"===t.defaultValue?"Player":"Actor 1"]}):"emote"===t.type?(0,i.jsxs)(y,{children:[(0,i.jsx)("img",{className:n.selectIcon,src:"/img/script-glossary/emote.png"}),"Love"]}):"avatar"===t.type?(0,i.jsxs)(y,{children:[(0,i.jsx)("img",{className:n.selectIcon,src:"/img/script-glossary/actor.png"}),"Avatar 1"]}):"scene"===t.type?(0,i.jsx)(y,{children:"Scene 1"}):"animationstate"===t.type?(0,i.jsx)(y,{children:"Default"}):"overlayColor"===t.type?(0,i.jsx)(y,{children:"Black"}):"cameraSpeed"===t.type||"overlaySpeed"===t.type?(0,i.jsx)(y,{children:"Speed 1"}):"moveSpeed"===t.type?(0,i.jsx)(y,{children:"Speed 2"}):"animSpeed"===t.type?(0,i.jsx)(y,{children:"Speed 4"}):"fadeSpeed"===t.type?(0,i.jsx)(y,{children:"Speed 1"}):"customEvent"===t.type?(0,i.jsx)(y,{children:"My Custom Script"}):"engineField"===t.type?(0,i.jsx)(y,{children:"Jump Velocity"}):"music"===t.type||"music"===t.type?(0,i.jsx)(y,{children:"My Track 1"}):"soundEffect"===t.type?(0,i.jsx)(y,{children:"Beep"}):"engineFieldValue"===t.type?(0,i.jsx)(h,{children:"0"}):"number"===t.type||"text"===t.type||"matharea"===t.type||"textarea"===t.type&&t.singleLine?(0,i.jsx)(u,{children:t.placeholder||t.defaultValue}):"textarea"!==t.type||t.singleLine?"code"===t.type?(0,i.jsx)(x,{children:t.placeholder||t.defaultValue}):"references"===t.type?(0,i.jsx)("div",{className:(0,l.Z)(n.button,n.buttonSmall),children:"Add Reference"}):"moveType"===t.type?(0,i.jsx)("div",{className:n.button,children:(0,i.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",children:(0,i.jsx)("path",{d:"M6 11v-4l-6 5 6 5v-4h12v4l6-5-6-5v4z"})})}):"priority"===t.type?(0,i.jsx)("div",{className:n.button,children:(0,i.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",children:[(0,i.jsx)("path",{d:"M 8.17 6.493 C 8.09 5.692 8.72 5 9.521 5 C 10.322 5 10.952 5.692 10.872 6.493 L 10.071 14.503 C 10.042 14.785 9.805 15 9.521 15 C 9.237 15 9 14.785 8.971 14.502 L 8.17 6.493 Z M 9.521 19.25 C 8.831 19.25 8.271 18.69 8.271 18 C 8.271 17.31 8.831 16.75 9.521 16.75 C 10.211 16.75 10.771 17.31 10.771 18 C 10.771 18.69 10.211 19.25 9.521 19.25 Z"}),(0,i.jsx)("path",{d:"M 13.128 6.493 C 13.048 5.692 13.678 5 14.479 5 C 15.28 5 15.91 5.692 15.83 6.493 L 15.029 14.503 C 15 14.785 14.763 15 14.479 15 C 14.195 15 13.958 14.785 13.929 14.502 L 13.128 6.493 Z M 14.479 19.25 C 13.789 19.25 13.229 18.69 13.229 18 C 13.229 17.31 13.789 16.75 14.479 16.75 C 15.169 16.75 15.729 17.31 15.729 18 C 15.729 18.69 15.169 19.25 14.479 19.25 Z"})]})}):"operator"===t.type||"mathOperator"===t.type?(0,i.jsx)(y,{children:t.defaultValue}):"direction"===t.type?(0,i.jsx)(g,{options:[{label:(0,i.jsx)(j,{angle:-90}),value:"left"},{label:(0,i.jsx)(j,{angle:0}),value:"up"},{label:(0,i.jsx)(j,{angle:180}),value:"down"},{label:(0,i.jsx)(j,{angle:90}),value:"right"}]}):"input"===t.type?(0,i.jsx)(g,{options:[{label:(0,i.jsx)(j,{angle:-90}),value:"left"},{label:(0,i.jsx)(j,{angle:0}),value:"up"},{label:(0,i.jsx)(j,{angle:180}),value:"down"},{label:(0,i.jsx)(j,{angle:90}),value:"right"}],moreOptions:[{label:"A",value:"a"},{label:"B",value:"b"},{label:"Start",value:"start"},{label:"Select",value:"select"}]}):"select"===t.type?(0,i.jsx)(y,{children:(t.options.find((e=>e[0]===t.defaultValue))||t.options[0])[1]}):"sprite"===t.type?(0,i.jsxs)(y,{children:[(0,i.jsx)("img",{className:n.selectIcon,src:"/img/script-glossary/actor.png"}),(0,i.jsx)("div",{className:n.flexGrow,children:"cat"})]}):"tileset"===t.type?(0,i.jsxs)(y,{children:[(0,i.jsx)("img",{className:n.selectIcon,src:"/img/script-glossary/tileset.png"}),(0,i.jsx)("div",{className:n.flexGrow,children:"flowers"})]}):"variable"===t.type?(0,i.jsx)(y,{children:"$Variable0"}):"selectFlags"===t.type?(0,i.jsx)(y,{children:"Flag 1"}):"palette"===t.type?(0,i.jsxs)(y,{children:[(0,i.jsx)(m,{}),void 0!==t.paletteIndex?`${t.paletteIndex}: `:""," ","Palette ",t.paletteIndex]}):"collisionMask"===t.type?(0,i.jsx)(g,{value:t.defaultValue,options:[].concat(t.includePlayer?{label:"Player",value:"player",selected:"player"===t.defaultValue}:[],[{label:"1",value:"1",selected:"1"===t.defaultValue},{label:"2",value:"2",selected:"2"===t.defaultValue},{label:"3",value:"3",selected:"3"===t.defaultValue}])}):"selectbutton"===t.type?(0,i.jsx)(d,{}):"togglebuttons"===t.type?(0,i.jsx)(g,{options:t.options.map((e=>({label:e[1],value:e[0]}))),value:t.defaultValue}):"tabs"===t.type?(0,i.jsx)("div",{className:(0,l.Z)(n.tabs,{[n.tabsEventSection]:"eventSection"===t.variant}),children:Object.keys(t.values).map((e=>(0,i.jsx)("div",{className:(0,l.Z)(n.tab,{[n.tabSelected]:e===t.defaultValue}),children:t.values[e]},e)))}):"value"===t.type||"constvalue"===t.type?(0,i.jsx)(h,{children:t.defaultValue}):(0,i.jsxs)("div",{className:n.unknown,children:["Unknown Type ",t.type]}):(0,i.jsx)(f,{children:t.placeholder||t.defaultValue})}function b(e){let{field:t,args:s}=e;if(t.type||t.label){if(t.conditions){if(!t.conditions.reduce(((e,t)=>{const l=s?.[t.key];return e&&(!t.eq||l===t.eq)&&(!t.ne||l!==t.ne)&&(!t.gt||Number(l)>Number(t.gt))&&(!t.gte||Number(l)>=Number(t.gte))&&(!t.lt||Number(l)>Number(t.lt))&&(!t.lte||Number(l)>=Number(t.lte))&&(!t.in||t.in.indexOf(l)>
1=0)&&!t.sceneType}),!0))return null}if("group"===t.type)return(0,i.jsx)("div",{className:n.group,children:t.fields.map(((e,t)=>(0,i.jsx)(b,{field:e,args:s},t)))});if("checkbox"===t.type)return(0,i.jsx)("div",{className:(0,l.Z)(n.field,{[n.fieldHalf]:"50%"===t.width}),style:{flexBasis:t.flexBasis,flexGrow:t.flexGrow,flexShrink:t.flexShrink},children:(0,i.jsxs)("div",{className:n.checkbox,children:[(0,i.jsx)("div",{className:(0,l.Z)(n.checkboxInput,{[n.checkboxInputChecked]:t.defaultValue}),children:(0,i.jsx)("svg",{viewBox:"0 0 24 24",children:(0,i.jsx)("polyline",{points:"20 6 9 17 4 12"})})})," ",t.label]})});if("flag"===t.type)return(0,i.jsx)("div",{className:(0,l.Z)(n.field,{[n.fieldHalf]:"50%"===t.width}),style:{flexBasis:t.flexBasis,flexGrow:t.flexGrow,flexShrink:t.flexShrink},children:(0,i.jsxs)("div",{className:n.checkbox,children:[(0,i.jsx)("input",{className:n.checkboxInput,checked:t.defaultValue})," ",t.label]})});if("collapsable"===t.type)return(0,i.jsx)("div",{className:(0,l.Z)(n.collapsableHeader),children:t.label});if("events"===t.type)return(0,i.jsxs)("div",{title:t.label,className:n.conditional,children:[(0,i.jsx)("div",{className:n.conditionalLabel,children:t.label}),(0,i.jsx)("div",{className:n.eventsWrapper,children:(0,i.jsx)("div",{class:"sc-JsfGe eFPlT","data-handler-id":"T48",children:(0,i.jsx)("div",{class:"sc-eiQXzm cklbLv",children:(0,i.jsxs)("div",{className:(0,l.Z)(n.button,n.eventButton),children:[(0,i.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",children:(0,i.jsx)("path",{d:"M24 9h-9v-9h-6v9h-9v6h9v9h6v-9h9z"})}),"Add Event"]})})})})]});if("union"===t.type){const e={...t,type:t.defaultType,union:!0,defaultValue:t.defaultValue[t.defaultType]};return(0,i.jsx)(b,{field:e,args:s})}return"break"===t.type?(0,i.jsx)("div",{className:n.break}):(0,i.jsxs)("div",{className:(0,l.Z)(n.field,{[n.fieldHalf]:"50%"===t.width}),style:{flexBasis:t.flexBasis,flexGrow:t.flexGrow,flexShrink:t.flexShrink},children:[!t.hideLabel&&t.label,(0,i.jsxs)("div",{className:n.fieldInput,children:[t.type&&(0,i.jsx)(v,{field:t}),t.union&&(0,i.jsx)(d,{})]})]})}}const w=(e,t)=>{t||(t={});for(const s of e)s.key&&void 0!==s.defaultValue&&(t[s.key]=s.defaultValue),"group"===s.type&&w(s.fields,t);return t};function k(e){let{title:t,fields:s}=e;const a=w(s);return(0,i.jsxs)("div",{className:(0,l.Z)(n.wrapper),children:[(0,i.jsx)("div",{className:(0,l.Z)(n.header),children:t}),(0,i.jsx)("div",{className:(0,l.Z)(n.form),children:s.map(((e,t)=>(0,i.jsx)(b,{field:e,args:a},t)))})]})}},1151:(e,t,s)=>{s.d(t,{Z:()=>c,a:()=>a});var l=s(7294);const n={},i=l.createContext(n);function a(e){const t=l.useContext(i);return l.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function c(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(n):e.components||n:a(e.components),l.createElement(i.Provider,{value:t},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.